I was wondering if it was possible to do an expans...
# talk-keto
a
I was wondering if it was possible to do an expansion or a recursive query for subjects that have a relation and get back objects? Lets say I have the following tuples:
Copy code
> keto relation-tuple get
neither flag --read-remote nor env var KETO_READ_REMOTE are set, falling back to 127.0.0.1:4466
NAMESPACE	OBJECT		RELATION NAME	SUBJECT
groups		group-119	member		user-150
facilities	facility-104	view		groups:group-119#member
Is there a way for me to get back the facility objects for a particular user, something like this:
Copy code
> curl '<http://localhost:4466/relation-tuples/expand?namespace=positions&relation=view&subject_id=user-150>'
{"error":{"code":500,"status":"Internal Server Error","message":"ERROR: new row for relation \"keto_uuid_mappings\" violates check constraint \"keto_uuid_mappings_string_representation_check\" (SQLSTATE 23514)"}}
(but without an error) Is this covered by the re-write PR I keep hearing about?
My goal here is that I want to get a list of all the facilities that a user can view. I'm considering dropping the idea of groups of users and just creating tuples with users directly
facilities:facility-104#view@user-150
(then I could get what I need with the query endpoint) but would really appreciate some advice on what's a better fit for usage with keto.
s
this is not implemented right now, and is also not related to the rewrites
have a look at https://www.ory.sh/docs/keto/guides/list-api-display-objects for how we currently recommend to solve this
we will look into a reverse expand once some other underlying issues are solved
The error you see from curl is caused by you not providing an object, which then is interpreted as the empty string object (which in-turn causes the constrain to fail)
but it should not be a 500, but rather 400