-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Implement grant deletion provider api #524
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?
feat: Implement grant deletion provider api #524
Conversation
| | AssignmentType::GroupProject | ||
| | AssignmentType::UserDomain | ||
| | AssignmentType::UserProject => { | ||
| db_assignment::Entity::delete_many() |
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.
all those fields are part of the composed PK. It is better to access it this way. Reason is that when some of the filter parameters here are wrong we may end up deleting what we should not
| #[derive(Builder, Clone, Debug, Deserialize, PartialEq, Serialize, Validate)] | ||
| #[builder(build_fn(error = "BuilderError"))] | ||
| #[builder(setter(strip_option, into))] | ||
| pub struct AssignmentRevoke { |
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.
please implement the From for AssignmentRevoke. I think this is going to be more comfortable to use it this way (check the assignment and pass it down to the revoke), but honestly I doubt whether we need AssignmentRevoke at all (it's same except few optional fields) and we should just use the Assignment directly?
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.
During implementation, I also had doubts about the necessity of AssignmentRevoke.
Then I realized that the AssignmentCreate struct is almost the same as Assignment.
So I kept the same approach for AssignmentRevoke but use Assignment directly look more clear. I will update PR accordingly
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.
create/update is a slightly different usecase. Usually they look very similar, but have differences (i.e. some attributes are not updatable)
|
|
||
| policy | ||
| .enforce( | ||
| "identity/project/user/role/check", |
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.
that is definitely wrong - check policy is pretty permissive while role assignment/revokation is intended to be used by admin/domain_manager only (similar to the grant policy). I would need to implement this policy first
No description provided.