authzed async insecure client
# spicedb
m
Hello everyone! I have a question about the Python InsecureClient. In the Authzed API code, I noticed that InsecureClient uses grpc.insecure_channel, which isn’t compatible with asyncio. So I tried to implement an async version of InsecureClient: https://gist.github.com/chero858/0bd209116039dff7db8e2cc74f56a0d4 Everything worked fine until I had to deal with the LookupResources method, which returns a UnaryStreamCall. I’m now getting a gRPC error: “Request unauthenticated with bearer.” Does anyone know how to handle this, or is there an existing workaround?
y
i'm not sure why your approach isn't working though 🤔
m
Hi, first of all, thank you for your answer. It’s really awesome that you have such a great community that helps regular developers using your tool. Secondly, my code wasn’t working because of how [gRPC handles interceptors](https://github.com/grpc/grpc/blob/d139c4a014b226af23c515a2e78e92600087e12c/src/python/grpcio/grpc/aio/_channel.py#L349) — it assigns an interceptor for each client. So, I had to split one class into four, one for each client (just like in the example you provided). Once again, thank you for your time! I’ll also leave a comment on the GitHub issue.
y
ah, that's good to know! thanks for adding to it 🙂
6 Views