https://authzed.com logo
Title
y

youling66

03/27/2023, 8:40 AM
I'm new to gRPC and I'm trying to get all subjects(users) have access to a specific case(resource in my system) with LookupSubjects API, but I don't know how to read the response with the authzed python SDK, though i've noticed that it's a "server_stream"-type grpc call. I'm confused that LookupSubjects(req) returns a 'grpc._channel._MultiThreadedRendezvous' object and spiceDB instance correctly processed the request, for log shows: 4:28PM INF finished call grpc.code=OK grpc.component=server grpc.method=LookupSubjects grpc.method_type=server_stream grpc.service=authzed.api.v1.PermissionsService grpc.start_time=2023-03-27T16:28:59+08:00 grpc.time_ms=0.426 peer.address=127.0.0.1:45206 protocol=grpc requestID=6b9e42701aac5a56dd018fe55871b612 -------------------------------------- [update] it works fine to me like this:
# 流式调用
    iter = client.LookupSubjects(request=req)
    for resp in iter:
        print("xxx", resp, "|", type(resp))