Skip to content

@ory/keto - Latest image - Blocker #1528

Open
@raolak

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions