ory / keto

Open Source (Go) implementation of "Zanzibar: Google's Consistent, Global Authorization System". Ships gRPC, REST APIs, newSQL, and an easy and granular permission language. Supports ACL, RBAC, and other access models.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=keto
Apache License 2.0
4.7k stars 342 forks source link

@ory/keto - Latest image - Blocker #1528

Open raolak opened 1 month ago

raolak commented 1 month ago

Preflight checklist

Ory Network Project

No response

Describe the bug

When I tried with @ory/keto the cat example throws following error Could not decode: json: unknown field "$schema"

If I revert the version to oryd/keto:v0.9.0 it works. but with older version, I see this issue 2024-05-18 21:27:00 The configuration contains values or keys which are invalid: 2024-05-18 21:27:00 namespaces: map[location:file:///home/ory/namespaces.keto.ts] 2024-05-18 21:27:00 ^-- expected array, but got object

This issue comes when I refer the namespaces though location attribute namespaces: location: file:///home/ory/namespaces.keto.ts

Can you please suggest which is the stable version of the images to be used? If its @ory/keto:latest, I hope there is not breaking issues.

I can not continue with either of the iessues unresolved. Also I don't see proper example tutorial which uses namespace.ts

Appreciate any help to resolve this issue asap.

_lakshmi

Reproducing the bug

keto.ts

dsn: memory

log: level: trace format: json leak_sensitive_values: true

limit: max_read_depth: 100

serve: read: host: 0.0.0.0 port: 4466 write: host: 0.0.0.0 port: 4467

namespaces: location: file:///home/ory/namespaces.keto.ts

namespace.keto.ts

import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"

class videos implements Namespace {}

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),

} }

docker compose

networks: internal: services: server: build: dockerfile: ./containers/flask/Dockerfile context: . image: tch1001/keto-explorer-server:v1 networks:

Relevant log output

No response

Relevant configuration

No response

Version

latest

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

na

raolak commented 1 month ago

This resolved the issue....but for sure there is a bug ("Could not decode: json: unknown field "$schema"") that need to be resolved with latest image

for keto - used oryd/keto:latest image & for keto-ini - used oryd/keto:v0.9.0

keto: image: oryd/keto:latest ports: