kaducha
08/19/2024, 8:32 AMvroldanbet
08/19/2024, 10:34 AMkaducha
08/19/2024, 11:35 AMkaducha
08/19/2024, 12:19 PMvroldanbet
08/19/2024, 1:09 PMkaducha
08/20/2024, 6:23 AMvroldanbet
08/20/2024, 10:06 AMkaducha
08/20/2024, 11:55 AMfrom 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
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:
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'kaducha
08/20/2024, 11:57 AMkaducha
09/05/2024, 11:43 AMvroldanbet
09/06/2024, 9:08 AM