-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Change REST API to not work with encoded subjects #708
Labels
breaking change
Changes behavior in a breaking manner.
bug
Something is not working.
help wanted
We are looking for help on this one.
rfc
A request for comments to discuss and share ideas.
upstream
Issue is caused by an upstream dependency.
Milestone
Comments
zepatrik
added
bug
Something is not working.
help wanted
We are looking for help on this one.
breaking change
Changes behavior in a breaking manner.
rfc
A request for comments to discuss and share ideas.
labels
Sep 14, 2021
Outdated proposalProposal for the new relationtuple schema: {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required": ["namespace", "relation", "object", "subject"],
"properties": {
"$schema": {
"type": "string",
"format": "uri-reference",
"description": "Add this to allow defining the schema, useful for IDE integration"
},
"namespace": {
"type": "string",
"description": "The namespace of the object and relation in this tuple."
},
"relation": {
"type": "string",
"description": "The relation of the object and subject."
},
"object": {
"type": "string",
"description": "The object affected by this relation."
},
"subject": {
"oneOf": [
{
"type": "object",
"description": "The subject set affected by this relation.",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace of the object and relation in this subject set."
},
"relation": {
"type": "string",
"description": "The relation of this subject set."
},
"object": {
"type": "string",
"description": "The object referenced in this subject set."
}
},
"additionalProperties": false,
"required": ["namespace", "relation", "object"]
},
{
"type": "string",
"description": "The subject ID affected by this relation."
}
]
}
}
} with the changes "subject": {
"oneOf": [
{
- "type": "string",
- "pattern": "^.*:.*#.*$",
- "description": "The subject set affected by this relation. Uses the encoding of \"<namespace>:<object>#<relation>\"."
+ "type": "object",
+ "description": "The subject set affected by this relation.",
+ "properties": {
+ "namespace": {
+ "type": "string",
+ "description": "The namespace of the object and relation in this subject set."
+ },
+ "relation": {
+ "type": "string",
+ "description": "The relation of this subject set."
+ },
+ "object": {
+ "type": "string",
+ "description": "The object referenced in this subject set."
+ }
+ },
+ "additionalProperties": false,
+ "required": ["namespace", "relation", "object"]
},
{
"type": "string",
- "description": "The subject affected by this relation. Use \"<namespace>:<object>#<relation>\" to describe a subject set.",
- "not": {
- "pattern": "^.*:.*#.*$"
- }
+ "description": "The subject ID affected by this relation."
}
]
} |
As per discussion with @aeneasr, this will become {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"allOf": [
{
"required": [
"namespace",
"relation",
"object"
],
"properties": {
"$schema": {
"type": "string",
"format": "uri-reference",
"description": "Add this to allow defining the schema, useful for IDE integration"
},
"namespace": {
"type": "string",
"description": "The namespace of the object and relation in this tuple."
},
"object": {
"type": "string",
"description": "The object affected by this relation."
},
"relation": {
"type": "string",
"description": "The relation of the object and subject."
}
}
},
{
"oneOf": [
{
"required": [
"subject_id"
],
"properties": {
"subject_id": {
"type": "string",
"description": "The subject ID affected by this relation."
}
}
},
{
"required": [
"subject_set"
],
"properties": {
"subject_set": {
"type": "object",
"description": "The subject set affected by this relation.",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace of the object and relation in this subject set."
},
"object": {
"type": "string",
"description": "The object referenced in this subject set."
},
"relation": {
"type": "string",
"description": "The relation of this subject set."
}
},
"additionalProperties": false,
"required": [
"namespace",
"relation",
"object"
]
}
}
}
]
}
]
} |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
Changes behavior in a breaking manner.
bug
Something is not working.
help wanted
We are looking for help on this one.
rfc
A request for comments to discuss and share ideas.
upstream
Issue is caused by an upstream dependency.
Describe the bug
The REST handler returns and expects subjects encoded. This disallows to put some characters into the subject when using REST, but it works over gRPC. The APIs should however be compatible and work with the same inputs/outputs.
This is a follow up of #661.
Reproducing the bug
Steps to reproduce the behavior:
work as expected over gRPC, but give 400 and 404 over REST.
Expected behavior
Parity between the API interfaces.
Breaking change
We will have to change the schema of the JSON data:
will become
The text was updated successfully, but these errors were encountered: