Skip to content

feat: Add api to list user roles on project#639

Open
konac-hamza wants to merge 3 commits into
openstack-experimental:mainfrom
konac-hamza:feature/user-roles-on-project
Open

feat: Add api to list user roles on project#639
konac-hamza wants to merge 3 commits into
openstack-experimental:mainfrom
konac-hamza:feature/user-roles-on-project

Conversation

@konac-hamza
Copy link
Copy Markdown
Collaborator

No description provided.

@konac-hamza konac-hamza requested a review from gtema March 24, 2026 20:46
Comment thread crates/core/src/assignment/mock.rs Outdated
Comment thread crates/keystone/src/api/v3/role_assignment/project/user/role/list.rs Outdated
Comment thread policy/project/user/role/list.rego Outdated
Comment thread policy/project/user/role/list_test.rego Outdated
@konac-hamza konac-hamza marked this pull request as draft May 21, 2026 10:04
@konac-hamza konac-hamza force-pushed the feature/user-roles-on-project branch from eaef383 to f5adf10 Compare May 21, 2026 22:00
@konac-hamza konac-hamza marked this pull request as ready for review May 22, 2026 05:03
@gtema gtema force-pushed the feature/user-roles-on-project branch from f5adf10 to f726ce9 Compare May 26, 2026 11:51
Copy link
Copy Markdown
Collaborator

@gtema gtema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for reviving the work here. Unfortunately some more fixes are necessary since in the meanwhile the code base run away slightly ;-)

let query_params = RoleAssignmentListParameters {
user_id: Some(user_id.clone()),
project_id: Some(project_id.clone()),
effective: Some(true),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meanwhile I have spotted the python keystone return the list of direct grants on those apis, and not the effective ones. We would need to adopt the existing methods that we have already.

Request::builder()
.method("GET")
.uri("/projects/project_id/users/user_id/roles")
.header("x-auth-token", "foo")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you would need to adopt this slightly - in the meanwhile a quite massive rework landed that changed few things about authentication handling and the tests now also pass a mocked ValidatedSecurityContext as extension instead of expecting the token would be validated.

assignment.project_role_domain_matches
}

allow if {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the user should NOT be able to read own roles when he doesn't have any role on the scope. Technically the whole rule should be removed. For now just repeat the 'check' policy

@gtema gtema linked an issue May 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add v3 api to list all roles that the user has on the project

3 participants