ripe-wall-60736
03/06/2023, 6:05 AMmagnificent-energy-493
ripe-wall-60736
03/06/2023, 10:34 AMory list relation-tuples --project=$PROJECT --format=json
which returns:
{
"relation_tuples": [
{
"namespace": "User",
"object": "Samarth",
"relation": "exists",
"subject_id": "samarth"
},
{
"namespace": "Accounts",
"object": "foobar",
"relation": "edit_rights",
"subject_id": "samarth"
}
],
"is_last_page": true,
"next_page_token": ""
}
.
When running
keto relation-tuple parse users.json
it returns:
--format=json
Could not decode users.json:1
{"relation_tuples":[{"namespace":"User","object":"Samarth","relation":"exists","subject_id":"samarth"},{"namespace":"Accounts","object":"foobar","relation":"edit_rights","subject_id":"samarth"}],"is_last_page":true,"next_page_token":""}
malformed string input
I am stuck here so to speakripe-wall-60736
03/06/2023, 1:04 PMmagnificent-energy-493
steep-lamp-91158
keto relation-tuple parse --help
Parse human readable relationships as used in the documentation.https://www.ory.sh/docs/keto/cli/keto-relation-tuple-parse you can just import the relation tuples you got from the list command through the CLI https://www.ory.sh/docs/keto/cli/keto-relation-tuple-create or API https://www.ory.sh/docs/reference/api#tag/relationship/operation/patchRelationships or https://www.ory.sh/docs/keto/reference/proto-api#ory-keto-relation_tuples-v1alpha2-TransactRelationTuplesRequest
ripe-wall-60736
03/07/2023, 3:17 AMripe-wall-60736
03/07/2023, 3:20 AMory list relation-tuples --project=$PROJECT --format=table
gives
NAMESPACE OBJECT RELATION NAME SUBJECT
User Samarth exists samarth
Accounts foobar edit_rights samarth
NEXT PAGE TOKEN
IS LAST PAGE true
Which I then pipe to a file (relations.tb)
When I run
keto relation-tuple parse relations.tb --format=table
it returns:
Could not decode relations.tb:1
NAMESPACE OBJECT RELATION NAME SUBJECT
malformed string input
ripe-wall-60736
03/07/2023, 3:33 AMripe-wall-60736
03/07/2023, 10:25 AMsteep-lamp-91158
ory list relation-tuples --project=... --format=json | jq .relation_tuples | keto relation-tuples create -
should worksteep-lamp-91158
steep-lamp-91158
namespaces: location: <file://path/to/your/namespaces.ts>
ripe-wall-60736
03/08/2023, 2:54 AM