Covey
03/08/2024, 9:29 AMdefinition token {}
definition service {
relation token: token
}
definition resource {
relation viewer: service#token
}
Is there a way for me to return all tokens
in SpiceDB?Covey
03/08/2024, 9:48 AMpython
res = client.ReadRelationships(
spice_db.ReadRelationshipsRequest(
relationship_filter=spice_db.RelationshipFilter(
resource_type="service",
optional_subject_filter=spice_db.SubjectFilter(
subject_type="token"
)
)
)
)
This returns a response where I can do:
python
relationship = await res.read()
Is there a way for me to "exhaust" the stream without calling client.ReadRelationships
again with the cursor-token?Covey
03/08/2024, 10:15 AMres.read()
and check for EOF
or res.done() is True
yetitwo
03/08/2024, 3:06 PMvroldanbet
03/08/2024, 3:40 PMCovey
03/08/2024, 5:51 PM