Skip to content

Commit

Permalink
fix: subject expansion is terminated unexpectedly (#1256)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrik <zepatrik@users.noreply.github.com>
  • Loading branch information
stonelgh and zepatrik committed Feb 27, 2023
1 parent db59a33 commit f88a479
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 175 deletions.
322 changes: 150 additions & 172 deletions .schema/version.schema.json
Original file line number Diff line number Diff line change
@@ -1,193 +1,171 @@
{
"$id": "https://github.com/ory/keto/.schema/versions.config.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"oneOf": [
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.11.0-alpha.0"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.11.0-alpha.0/.schema/config.schema.json"
}
]
"$id": "https://github.com/ory/keto/.schema/versions.config.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"oneOf": [
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.11.0-alpha.0"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.10.0-alpha.0"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.10.0-alpha.0/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.11.0-alpha.0/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.10.0-alpha.0"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.9.0-alpha.0"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.9.0-alpha.0/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.10.0-alpha.0/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.9.0-alpha.0"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.8.0-alpha.2"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.8.0-alpha.2/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.9.0-alpha.0/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.8.0-alpha.2"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.6.0-alpha.1"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.6.0-alpha.1/internal/driver/config/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.8.0-alpha.2/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.6.0-alpha.1"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.6.0-alpha.3"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.6.0-alpha.3/internal/driver/config/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.6.0-alpha.1/internal/driver/config/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.6.0-alpha.3"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.7.0-alpha.0"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.7.0-alpha.0/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.6.0-alpha.3/internal/driver/config/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.7.0-alpha.0"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.7.0-alpha.1"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.7.0-alpha.1/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.7.0-alpha.0/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.7.0-alpha.1"
}
},
"required": ["version"]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.8.0-alpha.1"
}
},
"required": [
"version"
]
},
{
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.8.0-alpha.1/.schema/config.schema.json"
}
]
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.7.0-alpha.1/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"properties": {
"version": {
"const": "v0.8.0-alpha.1"
}
},
"required": ["version"]
},
{
"allOf": [
{
"oneOf": [
{
"properties": {
"version": {
"type": "string",
"maxLength": 0
}
},
"required": [
"version"
]
},
{
"not": {
"properties": {
"version": {}
},
"required": [
"version"
]
}
}
]
},
{
"$ref": "#/oneOf/0/allOf/1"
"$ref": "https://raw.githubusercontent.com/ory/keto/v0.8.0-alpha.1/.schema/config.schema.json"
}
]
},
{
"allOf": [
{
"oneOf": [
{
"properties": {
"version": {
"type": "string",
"maxLength": 0
}
]
},
"required": ["version"]
},
{
"not": {
"properties": {
"version": {}
},
"required": ["version"]
}
}
]
},
{
"$ref": "#/oneOf/0/allOf/1"
}
],
"title": "All Versions of the ORY Keto Configuration",
"type": "object"
}
]
}
],
"title": "All Versions of the ORY Keto Configuration",
"type": "object"
}
7 changes: 6 additions & 1 deletion internal/check/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ func (e *Engine) checkExpandSubject(r *relationTuple, restDepth int) checkgroup.

// If not, we must go another hop:
for _, result := range results {
innerCtx, visited = graph.CheckAndAddVisited(innerCtx, result.To.Subject)
sub := &relationtuple.SubjectSet{
Namespace: result.To.Namespace,
Object: result.To.Object,
Relation: result.To.Relation,
}
innerCtx, visited = graph.CheckAndAddVisited(innerCtx, sub)
if visited {
continue
}
Expand Down

0 comments on commit f88a479

Please sign in to comment.