[WIP][RHCLOUD-37288] add option to list both principal types in one query to the /principals/ endpoint #1512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link(s) to Jira
Description of Intent of Change(s)
the
/principals/
endpoint allow to list the user based principals withtype=user
query param (default option)you can list service account based principals with
type=service-account
query paramthis PR adds third option
type=all
to list both principal types in one query:usernames
query param is working too (you can combine usernames of both principal types)type=service-account
)example of the response:
Local Testing
use tenant with few user based principals and service accounts and test queries with(out) the
type
query paramfor example if
GET /api/rbac/v1/principals/
returns 10 user based principals andGET /api/rbac/v1/principals/?type=service-account
returns 3 service accounts, thenGET /api/rbac/v1/principals/?type=all
should return 13 principals (both types)try combinations of limit and offset to check that pagination is working as expected
for example if your tenant contains 3 SA (service accounts) and 4 U (user based principals) then with
limit=2
andoffset=0
you get this pagination:Checklist