Doing a bit of test with the Permission Language ...
# talk-keto
a
Doing a bit of test with the Permission Language
Copy code
keto │ [keto-automigrate] time=2022-12-08T18:02:02Z level=error msg=Failed to parse OPL config files at target file:///etc/config/namespaces.keto.ts. audience=application error=map[message:error from 1:48 to 1:48: fatal: at "@ory/keto-namespace-types\"\n\nclass User implements Namespace {\n  related: {\n    manager: User[]\n  }\n}\n\nclass Group implements Namespace {\n  related: {\n    members: (User | Group)[]\n  }\n}\n\nclass Folder implements Namespace {\n  related: {\n    parents: (File | Folder)[]\n    viewers: SubjectSet<Group, \"members\">[]\n  }\n\n  permits = {\n    view: (ctx: Context): boolean =>\n      this.related.viewers.includes(ctx.subject) ||\n      this.related.parents.traverse((p) => p.permits.view(ctx)),\n  }\n}\n\nclass File implements Namespace {\n  related: {\n    parents: (File | Folder)[]\n    viewers: (User | SubjectSet<Group, \"members\">)[]\n    owners: (User | SubjectSet<Group, \"members\">)[]\n  }\n\n  // Some comment\n  permits = {\n    view: (ctx: Context): boolean =>\n      this.related.parents.traverse((p) => p.permits.view(ctx)) ||\n      this.related.viewers.includes(ctx.subject) ||\n      this.related.owners.includes(ctx.subject),\n\n    edit: (ctx: Context) => this.related.owners.includes(ctx.subject),\n  }\n}\n": unclosed string literal
         keto │ [keto-automigrate] 
         keto │ [keto-automigrate]    0 | import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
         keto │ [keto-automigrate]                                                        ^                         
         keto │ [keto-automigrate]    0 | 
         keto │ [keto-automigrate] 
         keto │ [keto-automigrate]  stack_trace:stack trace could not be recovered from error type *schema.ParseError] service_name=Ory Keto service_version=v0.10.0-alpha.0
the TS file comes from https://www.ory.sh/docs/keto/guides/userset-rewrites ... any idea why ?
t
Faced the same issue. Just comment out the line with the ory import
Copy code
// import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
s
we fixed that with https://github.com/ory/keto/pull/1041 but that is not yet released
I'll put a release on my todo list
you can build from master if you just want to tinker locally
a
Tested on master works fine @steep-lamp-91158 thanks, did you plan the release before the holidays ?