-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make subject sets and subject IDs unambiguous (#729)
BREAKING CHANGES: This patch changes the payload of the REST API. The gRPC API is **not** affected. The parameter `subject` was previously an encoded string. With this change clients have to explicitly use either `subject_id` or (`subject_set.namespace` and `subject_set.object` and `subject_set.relation`). The same is true for REST responses returned by Keto. An error with a hint will be returned if `subject` is still used.
- Loading branch information
Showing
55 changed files
with
2,944 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"namespace": "videos", | ||
"object": "/cats/1.mp4", | ||
"relation": "view", | ||
"subject": "*" | ||
"subject_id": "*" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"namespace": "videos", | ||
"object": "/cats", | ||
"relation": "owner", | ||
"subject": "cat lady" | ||
"subject_id": "cat lady" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 25 additions & 9 deletions
34
contrib/docs-code-samples/expand-api-display-access/01-expand-beach/expected_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,46 @@ | ||
{ | ||
"type": "union", | ||
"subject": "files:/photos/beach.jpg#access", | ||
"children": [ | ||
{ | ||
"type": "union", | ||
"subject": "files:/photos/beach.jpg#owner", | ||
"children": [ | ||
{ | ||
"type": "leaf", | ||
"subject": "maureen" | ||
"subject_id": "maureen" | ||
} | ||
] | ||
], | ||
"subject_set": { | ||
"namespace": "files", | ||
"object": "/photos/beach.jpg", | ||
"relation": "owner" | ||
} | ||
}, | ||
{ | ||
"type": "union", | ||
"subject": "directories:/photos#access", | ||
"children": [ | ||
{ | ||
"type": "leaf", | ||
"subject": "directories:/photos#owner" | ||
"subject_set": { | ||
"namespace": "directories", | ||
"object": "/photos", | ||
"relation": "owner" | ||
} | ||
}, | ||
{ | ||
"type": "leaf", | ||
"subject": "laura" | ||
"subject_id": "laura" | ||
} | ||
] | ||
], | ||
"subject_set": { | ||
"namespace": "directories", | ||
"object": "/photos", | ||
"relation": "access" | ||
} | ||
} | ||
] | ||
], | ||
"subject_set": { | ||
"namespace": "files", | ||
"object": "/photos/beach.jpg", | ||
"relation": "access" | ||
} | ||
} |
Oops, something went wrong.