Skip to content

Allow admin revocation of API Keys - #1391

Open
k-burt-uch wants to merge 1 commit into
masterfrom
fix/denylist-username
Open

k-burt-uch wants to merge 1 commit into
masterfrom
fix/denylist-username

Conversation

@k-burt-uch

Copy link
Copy Markdown
Contributor

Link to JIRA ticket if there is one:

New Features

  • Allows admins to revoke api keys through API

Breaking Changes

Bug Fixes

Improvements

Dependency updates

Deployment changes

@coveralls

coveralls commented Oct 20, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39494915305

Coverage increased (+0.07%) to 75.813%

Details

  • Coverage increased (+0.07%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 10 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

10 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
blueprints/storage_creds/api.py 10 86.67%

Coverage Stats

Coverage Status
Relevant Lines: 12019
Covered Lines: 9112
Line Coverage: 75.81%
Coverage Strength: 0.76 hits per line

💛 - Coveralls

@k-burt-uch
k-burt-uch force-pushed the fix/denylist-username branch from 977774f to 128ffca Compare October 20, 2026 20:46
@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 0 34 34
tests/test_audit_service.py 3 3 6
tests/test_ras_authn.py 0 3 3
tests/test_ras_passport.py 0 3 3
tests/test_dbgap.py 4 1 5
tests/test_data_upload.py 8 1 9
tests/test_user_login_activation.py 2 1 3
tests/test_oauth2.py 15 0 15
tests/test_drs_endpoint.py 25 0 25
tests/test_centralized_auth.py 16 0 16
tests/test_presigned_url.py 8 0 8
tests/test_task_token.py 6 0 6
tests/test_user_token.py 5 0 5
tests/test_fence_admin.py 2 0 2
tests/test_register_user.py 2 0 2
tests/test_oidc_client.py 2 0 2
tests/test_google_data_access.py 1 0 1
tests/test_client_credentials.py 1 0 1
TOTAL 100 46 146

Please find the detailed integration test report here

Please find the Github Action logs here

Comment on lines 144 to +149
if not api_key:
flask.abort(404, "token not found with JTI {} for current user".format(jti))
flask.abort(404, "token not found with JTI {}".format(jti))

# Check if the admin can delete the token.
if str(api_key.userid) != user_id:
authz_authorize(

@paulineribeyre paulineribeyre Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If a user who is not an admin and not the key's owner tries to delete a key that does exist, i think this would return a 401 instead of a 404.

Can we return 404 in that case? And maybe add a lil test case?

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.

3 participants