hi. when i try to check permission from
# spicedb
k
v
what version of the authzed-py client are you using? What you are describing seems similar to https://github.com/authzed/authzed-py/issues/121
k
it's the same issue actually. authzed ver 0.16.0, grpcio 1.65.5
downgrading didn't help in my case
v
any chances you could come up with a repro?
k
I don't quite understand what repro you mean, can you please clarify?
v
I'm wondering if you could come up with a reproduction of the issue, like a repo with the code that reproduces the issue, or maybe a github gist, or whather you prefer to share a self contained reproduction of the issue
k
Copy code
from authzed.api.v1 import Client, ReadSchemaRequest
from grpcutil import insecure_bearer_token_credentials


ENDPOINT = "localhost:50051"
CREDENTIALS = insecure_bearer_token_credentials("token")


client = Client(ENDPOINT, CREDENTIALS)

resp = client.ReadSchema(ReadSchemaRequest())
print(resp.schema_text)
default use case, everythings work fine
Copy code
from mitmproxy import http
from main import resp # import from first code

def request(flow: http.HTTPFlow) -> None:
    if flow.request.pretty_host == "example.org":
        flow.request.host = "mitmproxy.org"
this is simple mitmproxy addon, when i try to start mitmproxy with loading scripts which have authzed part, i get next error:
Copy code
Error logged during startup:
error in script ./addon.py
Traceback (most recent call last):
  File "./addon.py", line 4, in <module>
    from main import resp
  File "/home/user/error_repro/./main.py", line 12, in <module>
    print(resp.schema_text)
AttributeError: 'UnaryUnaryCall' object has no attribute 'schema_text'
so everywhere else works fine but with mitmproxy doesn't see attributes
fixed now. it was because mitmproxy flow is async, so authzed client became async too. putting await in front of func call solved problem
v
interesting, would you mind posting your findings in the above issue in case anyone stumbles upon this?
57 Views