Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ory/keto - Latest image - Blocker #1528

Open
3 of 5 tasks
raolak opened this issue May 18, 2024 · 1 comment
Open
3 of 5 tasks

@ory/keto - Latest image - Blocker #1528

raolak opened this issue May 18, 2024 · 1 comment
Labels
bug Something is not working.

Comments

@raolak
Copy link

raolak commented May 18, 2024

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:
- internal
ports:
- '8888:5001'
keto:
image: oryd/keto:v0.9.0
ports:
- '4466:4466'
- '4467:4467'
command: serve -c /home/ory/keto.yml
restart: on-failure
volumes:
- type: bind
source: ./containers/keto
target: /home/ory
networks:
- internal

keto-init:
image: oryd/keto:v0.9.0
environment:
- KETO_WRITE_REMOTE=keto:4467
# entrypoint: tail -f /dev/null
volumes:
- type: bind
source: ./containers/keto
target: /home/ory
command: relation-tuple create /home/ory/relation_tuples
restart: on-failure
networks:
- internal

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 raolak added the bug Something is not working. label May 18, 2024
@raolak
Copy link
Author

raolak commented May 18, 2024

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:
- '4466:4466'
- '4467:4467'
command: serve -c /home/ory/keto.yml
restart: on-failure
volumes:
- type: bind
source: ./containers/keto
target: /home/ory
networks:
- internal

keto-init:
image: oryd/keto:v0.9.0
environment:
- KETO_WRITE_REMOTE=keto:4467
# entrypoint: tail -f /dev/null
volumes:
- type: bind
source: ./containers/keto
target: /home/ory
command: relation-tuple create /home/ory/relation_tuples
restart: on-failure
networks:
- internal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant