Skip to content

Admin Delete Key#43

Merged
hayesZach merged 7 commits intomasterfrom
admin-delete-key
Feb 23, 2026
Merged

Admin Delete Key#43
hayesZach merged 7 commits intomasterfrom
admin-delete-key

Conversation

@hayesZach
Copy link
Copy Markdown
Collaborator

@hayesZach hayesZach commented Feb 20, 2026

Closes CSF-894


Note

Medium Risk
Adds an admin-only destructive operation (API key deletion) and related auditing; risk is mainly around accidental key removal and correct authorization enforcement, though it includes coverage for common error cases.

Overview
Adds an admin DELETE /api/v1/admin/keys/{id} endpoint to soft-delete API keys, while preventing deletion of the key currently used for authentication.

The deletion is executed in a private DB transaction and records an AdminAudit entry (TargetActionRemoveKey) containing the deleted key’s marketplace/permissions and the acting admin key ID. Includes comprehensive tests covering success, empty ID, self-delete prevention, missing key (404), and insufficient permissions (403).

Written by Cursor Bugbot for commit 890c260. This will update automatically on new commits. Configure here.

@hayesZach hayesZach self-assigned this Feb 20, 2026
@hayesZach hayesZach added the Enhancement New feature or request label Feb 20, 2026
@hayesZach hayesZach marked this pull request as ready for review February 20, 2026 20:55
@linear
Copy link
Copy Markdown

linear bot commented Feb 20, 2026

CSF-894 Delete API Key

@hayesZach hayesZach requested a review from Step7750 February 20, 2026 21:07
Base automatically changed from feature/admin-create-key to master February 23, 2026 16:19
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@hayesZach hayesZach merged commit 38e187f into master Feb 23, 2026
2 checks passed
@hayesZach hayesZach deleted the admin-delete-key branch February 23, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants