-
Notifications
You must be signed in to change notification settings - Fork 12
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
RBAC V2 - Roles APIs #245
RBAC V2 - Roles APIs #245
Conversation
Signed-off-by: Bailin He <[email protected]>
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.
Nice first pass. Not all of these are requested changes.
Signed-off-by: Bailin He <[email protected]>
@@ -26,6 +26,22 @@ const ( | |||
GrantRelationship = "grant" | |||
) | |||
|
|||
// RoleAction is the list of actions that can be performed on a role resource | |||
type RoleAction string |
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.
Why do we have an entire type for this?
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.
I think the actions should be an enum, same goes with RoleBindingActions
internal/query/roles_v2.go
Outdated
|
||
defer span.End() | ||
|
||
roleName = strings.TrimSpace(roleName) |
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.
Right; I think that would be good.
// there could be multiple subject types for a permission, | ||
// e.g. | ||
// infratographer/rolev2:lb_viewer#loadbalancer_get_rel@infratographer/user:* | ||
// infratographer/rolev2:lb_viewer#loadbalancer_get_rel@infratographer/client:* | ||
// here we only need one of them since the action is the only thing we care | ||
// about |
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.
This will probably bite us. A better solution would probably be to have some singleton subject set definition that points to all subject types.
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.
I agree a more elegant solution is more desirable, but I think we can have a seperate PR to play with the IAPL
6f0d6c2
to
03ddab7
Compare
Co-authored-by: John Schaeffer <[email protected]> Signed-off-by: Bailin He <[email protected]>
continue work on #219
The API should be updated to use them in place of direct role assignments. The scope of this task is to make the following API changes: