strong-controller-46383
03/13/2023, 1:49 PMhigh-optician-2097
magnificent-energy-493
export project_id=
export project_name=
- First get the current permission config,
ory get permission-config $project_id --format json-pretty > ory-permission-config-$project_name.json
- You get a storage.googleapis link with contents like this for example:
import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
class User implements Namespace { }
class Blog implements Namespace {
related: {
viewers: User[]
}
permits = {
view: (ctx: Context): boolean =>
this.related.viewers.includes(ctx.subject)
}
}
- Save the permission config in git
- Then whenever I make changes, I first commit to this file.
- Then base64 encode it and add it to the config like so
ory-permission-config-staging.json
{
"limit": {},
"namespaces": {
"location": "<base64://somevalue>"
}
}
- Then upload this to Ory Network
ory update permission-config $project_id --file ory-permission-config-$project_name.json
- use the googleapis link in the response to confirm.
Not sure if this is the best / ideal approach, but it works for me. Let me know what you think @strong-controller-46383. If this sounds like it could work for you, I will turn it into a tutorial.strong-controller-46383
03/13/2023, 3:15 PMstrong-controller-46383
03/13/2023, 3:16 PMmagnificent-energy-493
wide-nightfall-69566
03/15/2023, 8:10 AMory auth
CLI. It is interactive in terminal. Is it possible to set flag and pass user credential as parameters directly by using ory auth command? Or do you have any other suggested way to do it? Thank you! 🙂