-
Notifications
You must be signed in to change notification settings - Fork 15
[New Feature]Add grpc.default_authority option for authorization #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
In python grpclib tools, you need to feed Can you read from the metadata ? |
Use channel option,not metadata |
@jcai Yes, adding option to channel is easy, but there are some incompatibility problems between
|
Find a trick solution: import asyncio
from chatie_grpc.wechaty import PuppetStub
from grpclib.client import Channel
async def main():
target = "server-address:port"
channel = Channel(host="server-address", port=port)
# this is the private field
channel._authority = "your-token"
sub = PuppetStub(channel)
await sub.start()
print("started ...")
async for response in sub.event():
print(response)
asyncio.run(main()) output:
this works for me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to use
grpc.default_authority
to identify the current user.Could we addgrpc.default_authority
option to gRPC channel?see:
wechaty/puppet-service#78
wechaty/go-wechaty#69
wechaty/java-wechaty#77
The text was updated successfully, but these errors were encountered: