-
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
role-binding v2 schema and IAPL #219
Conversation
8efc9e7
to
c5fd68b
Compare
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.
Leaving a partial review here of the policy language stuff. Moving on to the rest.
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.
More thoughts. Overall, the direction of this is good, but it looks like we're adding more customizability than may be warranted and the code could stand to be broken down into smaller, more easily consumed units than it currently is.
27840bd
to
41bcf2e
Compare
41bcf2e
to
0080dfb
Compare
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.
More thoughts.
8d903da
to
0de1390
Compare
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.
More thoughts.
// Relationships like member_roles, available_roles, are created to support | ||
// role inheritance, e.g., an org should be able to use roles defined by its |
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 needs more explanation, I think, preferably in the Markdown doc.
internal/iapl/rbac.go
Outdated
// AvailableRoleRelation is the name of the relationship that list all roles | ||
// that are available for a given resource | ||
AvailableRoleRelation = "avail_role" |
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 seems like it could be named a little better, since it's actually used as an action everywhere, not as a relation. Maybe this would be better? Not sure.
// AvailableRoleRelation is the name of the relationship that list all roles | |
// that are available for a given resource | |
AvailableRoleRelation = "avail_role" | |
// UseRoleAction is the name of the action that allows the use of a role | |
// for listing, binding, etc in the context of a given resource | |
UseRoleAction = "iam_use_role" |
0dc1a3a
to
8d474ee
Compare
*/ | ||
type RBAC struct { | ||
// RoleResource is the name of the resource type that represents a role. | ||
RoleResource RBACResourceDefinition |
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.
Is RBACResourceDefinition
here so we can create the resource type?
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.
Yes. I changed that to be not private because I realized at some point we need to create a policy for tests
d96eb76
to
2563696
Compare
Co-authored-by: John Schaeffer <[email protected]> Signed-off-by: Bailin He <[email protected]>
2563696
to
4d0a201
Compare
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.
Looks good enough to build on. Work on things like moving ConditionSets
into conditions and fixing the generated Mermaid graph will come later.
In order to separate roles from bindings in permissions-api, we need to update the generated SpiceDB schema with a definition for bindings and permissions that check both direct assignment to roles and bindings (i.e., we don’t want to break existing assignments). The scope of this task is to update permissions-api to generate a SpiceDB schema with a binding definition that associates a subject (i.e., any principal) to a role.
see this doc for more