Skip to content

Expand API behaves weirdly when no object is specified #608

Open
@zepatrik

Description

@zepatrik

Describe the bug

Noticed by @radekg in #598 (comment):

curl --silent 'http://localhost:4466/expand?namespace=default-namespace&subject=Fry&relation=member&max-depth=2' | jq '.'

returns

{
  "type": "union",
  "subject": "default-namespace:#member",
  "children": [
    {
      "type": "leaf",
      "subject": "Bender"
    },
    {
      "type": "leaf",
      "subject": "Fry"
    },
    {
      "type": "leaf",
      "subject": "Hermes"
    },
    {
      "type": "leaf",
      "subject": "default-namespace:it-director#member"
    },
    {
      "type": "leaf",
      "subject": "default-namespace:it-director#member"
    },
    {
      "type": "leaf",
      "subject": "default-namespace:dev-director#member"
    },
    {
      "type": "leaf",
      "subject": "default-namespace:it-director#member"
    }
  ]
}

this is completely not what the logic suggests the result should be.

Reproducing the bug

Steps to reproduce the behavior:

Setup from https://gruchalski.com/posts/2021-05-15-rbac-with-ory-keto/ and above query.

Metadata

Metadata

Assignees

Labels

bugSomething is not working.corp/m8Up for M8 at Ory Corp.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions