zhangbo.yang
07/02/2024, 7:04 AMvroldanbet
07/02/2024, 8:40 AMzhangbo.yang
07/02/2024, 8:40 AMzhangbo.yang
07/02/2024, 8:41 AMdocker run --name spicedb -p 50051:50051 quay.io/authzed/spicedb serve --grpc-preshared-key "somerandomkeyhere"
printf "sdbst_h256_%s\n" $(echo -n somerandomkeyhere | sha256sum | cut -d' ' -f1)
vroldanbet
07/02/2024, 8:43 AMzhangbo.yang
07/02/2024, 8:43 AMzhangbo.yang
07/02/2024, 8:44 AMprintf "sdbst_h256_%s\n" $(echo -n somerandomkeyhere | sha256sum | cut -d' ' -f1)
?vroldanbet
07/02/2024, 8:45 AMvroldanbet
07/02/2024, 8:45 AMvroldanbet
07/02/2024, 8:45 AMbearer_token_credentials
you pass that valuevroldanbet
07/02/2024, 8:47 AMbearer_token_credentials
if you are talking to localhost
without TLS. You have to use the insecure transport:
https://discord.com/channels/844600078504951838/1257320988312604814/1257325939210059807zhangbo.yang
07/02/2024, 8:49 AMzhangbo.yang
07/02/2024, 8:59 AMclient = Client(
"xxx:50051",
insecure_bearer_token_credentials("blabla")
)
will cause error :
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:10.124.106.121:50051: Endpoint is neither UDS or TCP loopback address."
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-07-02T08:58:14.0618968+00:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:10.124.106.121:50051: Endpoint is neither UDS or TCP loopback address."}"
>
zhangbo.yang
07/02/2024, 9:00 AMbearer_token_credentials
will cause the same problemzhangbo.yang
07/02/2024, 9:00 AMzhangbo.yang
07/02/2024, 9:01 AMgrpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.PERMISSION_DENIED
details = "invalid preshared key: invalid token"
debug_error_string = "UNKNOWN:Error received from peer ipv4:10.124.106.121:50051 {grpc_message:"invalid preshared key: invalid token", grpc_status:7, created_time:"2024-07-02T09:01:20.2423698+00:00"}"
>
zhangbo.yang
07/02/2024, 9:04 AMvroldanbet
07/02/2024, 9:59 AMvroldanbet
07/02/2024, 9:59 AM