-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add broken permissions service #150
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
base: main
Are you sure you want to change the base?
Changes from all commits
371d544
2250e8c
aa6c853
d710cc1
ca83c6f
a5527a5
02ecba6
f86ee7f
67e9ef4
2db5891
c0e0bd8
47ef97c
b9f09ed
66cb2ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| syntax = "proto3"; | ||
| package authzed.api.materialize.v0; | ||
|
|
||
| import "authzed/api/v1/core.proto"; | ||
|
|
||
| option go_package = "github.com/authzed/authzed-go/proto/authzed/api/materialize/v0"; | ||
| option java_multiple_files = true; | ||
| option java_package = "com.authzed.api.materialize.v0"; | ||
|
|
||
| service BrokenPermissionsService { | ||
| // ReadBrokenWatchedPermissions returns all cycles detected during | ||
| // the hydration process. | ||
| // | ||
| // Each cycle a circular dependency in the permission graph. | ||
| // The response includes the broken permission, along with the resources involved in each cycle. | ||
| rpc ReadBrokenWatchedPermissions(ReadBrokenWatchedPermissionsRequest) returns (stream ReadBrokenWatchedPermissionsResponse) {} | ||
| } | ||
|
|
||
| message ReadBrokenWatchedPermissionsRequest { | ||
| // optional_at_revision defines the specific revision at which the broken watched permissions should be evaluated. | ||
| // At this time, it is only compared against the revision of the provided backing store snapshot. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I follow this. The first line is sufficient to explain the semantics, I'd drop it. |
||
| authzed.api.v1.ZedToken optional_at_revision = 2; | ||
| } | ||
|
|
||
| message ReadBrokenWatchedPermissionsResponse { | ||
| // revision is the ZedToken at which the request was evaluated. | ||
| authzed.api.v1.ZedToken revision = 1; | ||
| // The watched permission that broke. | ||
| BrokenWatchedPermission watched_permission = 2; | ||
| // The resources involved in the cycle. The resource order does not represent the cycle traversal order. | ||
| repeated Resource cycle = 3; | ||
| } | ||
|
|
||
| message BrokenWatchedPermission { | ||
| // resource_type is the type of the resource to watch for changes. | ||
| string resource_type = 1; | ||
| // permission is the permission to watch for changes. | ||
| string permission = 2; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The part that gives me a pause is the fact you could technically use a relation here too. Or you could use |
||
| } | ||
|
|
||
| message Resource { | ||
| // object_type is the type of the resource. | ||
| string object_type = 1; | ||
| // object_id is the id of the resource. | ||
| string object_id = 2; | ||
| // permission_or_relation is the resource's permission or relation. | ||
| string permission_or_relation = 3; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
BrokenWatchedPermissionsService? I'm also not opposed to leaving it as-isThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't line up; I think we should just use
BrokenPermissionsService, since these will be found during LPSThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? They could also happen during updates, wouldn't they?