-
Notifications
You must be signed in to change notification settings - Fork 32
🎨 Filter autogenerated api-keys when listing #7855
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
🎨 Filter autogenerated api-keys when listing #7855
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7855 +/- ##
==========================================
+ Coverage 87.89% 88.21% +0.32%
==========================================
Files 1836 1474 -362
Lines 71014 61242 -9772
Branches 1219 476 -743
==========================================
- Hits 62415 54025 -8390
+ Misses 8256 7096 -1160
+ Partials 343 121 -222
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR enhances the API key management by introducing a filter for auto‐generated API keys when listing them.
- Updated the list API endpoint to accept a new query parameter ("includeAutogenerated") which controls whether auto-generated keys are returned.
- Added new tests and fixtures to verify the filter behavior.
- Updated OpenAPI specifications and related modules to reflect the changes in API behavior.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/with_dbs/01/test_api_keys.py | Added fake_auto_api_keys fixture and tests to verify filtering of autogenerated API keys |
| src/simcore_service_webserver/api_keys/_service.py | Updated list_api_keys signature to include the include_autogenerated flag |
| src/simcore_service_webserver/api_keys/_repository.py | Modified the SQL query to conditionally filter out auto-generated API keys based on the new flag |
| src/simcore_service_webserver/api_keys/_controller/rest.py | Updated the endpoint controller to handle query parameters for filtering autogenerated keys |
| src/simcore_service_webserver/api/v0/openapi.yaml | Revised OpenAPI definitions to add a POST endpoint for key creation and a GET endpoint supporting the new query parameter |
| services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/_api_auth.py | Updated auto-generated API key naming scheme to use the new prefix constant |
| packages/models-library/src/models_library/auth.py | Introduced API_KEY_AUTOGENERATED_PREFIX constant for consistency |
| packages/models-library/src/models_library/api_schemas_webserver/auth.py | Added a new ApiKeyListQueryParams schema to support query parameter in API key listing |
| api/specs/web-server/_auth_api_keys.py | Updated FastAPI endpoint definitions to incorporate the new query parameter via dependency injection |
Comments suppressed due to low confidence (1)
services/web/server/src/simcore_service_webserver/api_keys/_repository.py:171
- Consider adding a brief comment here to explain that this condition filters out auto-generated API keys based on the display_name prefix.
if not include_autogenerated:
bisgaard-itis
left a comment
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.
Thanks a lot for the quick fix
GitHK
left a comment
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.
OK, but please consider my comment
services/web/server/src/simcore_service_webserver/api_keys/_repository.py
Show resolved
Hide resolved
…ncarloromeo/osparc-simcore into is7852/filter-autogenerated-api-keys
services/web/server/src/simcore_service_webserver/api_keys/_repository.py
Show resolved
Hide resolved
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
1ce595e
into
ITISFoundation:master



What do these changes do?
This PR enhances the list API Keys endpoint, adding a new query parameter (
includeAutogenerated) that filters out (by default) the autogenerated ones.Related issue/s
How to test
Dev-ops