refined-architect-59368
02/07/2025, 4:37 PMfatal error
.
This is also happening with my own custom namespaces file.
Here's the request I'm using:
curl --request POST \
--url <https://ory-network-endpoint/opl/syntax/check> \
--header 'authorization: Bearer {{some key}}' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/keto/contrib/rewrites-example/namespaces.keto.ts
Testing with the sample file from https://github.com/ory/keto/blob/master/contrib/rewrites-example/namespaces.keto.tsrefined-architect-59368
02/07/2025, 4:38 PMcheckOplSyntaxBody
as outlined in the API docs: https://www.ory.sh/docs/keto/reference/rest-api#tag/relationship/operation/checkOplSyntaxearly-magician-18981
02/07/2025, 5:40 PMcheckOplSyntaxBody
key with the content of your namespaces.keto.ts file as the body. (unless I am misunderstanding your second part in the thread that you attempted this.)refined-architect-59368
02/10/2025, 7:33 AMcheckOplSyntaxBody
anywhere)
This works well for me
curl --request POST \
--url <https://ory-network-endpoint/opl/syntax/check> \
--header 'authorization: Bearer {{ory_keto_api_key}}' \
--header 'content-type: text/plain' \
--data '// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
class User implements Namespace {
related: {
manager: User[]
}
}
class Group implements Namespace {
related: {
members: (User | Group)[]
}
}
class Folder implements Namespace {
related: {
parents: (File | Folder)[]
viewers: SubjectSet<Group, "members">[]
}
permits = {
view: (ctx: Context): boolean =>
this.related.viewers.includes(ctx.subject) ||
this.related.parents.traverse((p) => p.permits.view(ctx)),
}
}
class File implements Namespace {
related: {
parents: (File | Folder)[]
viewers: (User | SubjectSet<Group, "members">)[]
owners: (User | SubjectSet<Group, "members">)[]
}
// Some comment
permits = {
view: (ctx: Context): boolean =>
this.related.parents.traverse((p) => p.permits.view(ctx)) ||
this.related.viewers.includes(ctx.subject) ||
this.related.owners.includes(ctx.subject),
edit: (ctx: Context) => this.related.owners.includes(ctx.subject),
}
}'
refined-architect-59368
02/10/2025, 7:34 AMsteep-lamp-91158
steep-lamp-91158