Skip to content

Conversation

fdrab
Copy link
Contributor

@fdrab fdrab commented Jul 13, 2025

WHAT:

This PR updates the get_all method of API V1 KeyValue controller so that if it's called by a non-admin user, instead of iterating over a list of keys that the user has access to and fetching them one by one, we fetch them in the same way as if we were an admin and then only add those to the output that the user has access to.

WHY:

This makes it so that the 'prefix' and 'name' filters are honoured even before we only return keys that the user has access to. This should also correct the st2client behaviour that throws an error when calling get_key_by_name (or whatever the name of the method is), as that one does a call to keys?name=key_name instead of keys/key_name.

Fixes #6335

@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Jul 13, 2025
Copy link
Contributor Author

fdrab commented Jul 13, 2025

Test failures seem completely unrelated to the change made. One is a failure to dispose of a sensor and another failed test is due to RMQ channel missing.

@guzzijones guzzijones self-requested a review July 15, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M PR that changes 30-99 lines. Good size to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keypair API response inconsistency admin vs. non-admin when calling system scoped keys
2 participants