Repository navigation
fix(sse): send immediate key deletion as a confirmed two-step request - #293
Merged
Merged
Conversation
The server only accepts an immediate KMS key deletion as a JSON body that repeats the key ID, and only for a key that is already pending deletion. The console sent `force_immediate=true` in the query string with no confirmation, so "Delete Immediately" was always refused, and it offered the action on keys that had never been scheduled. Send the request as a JSON body with `confirm_key_id`, offer "Delete Immediately" only on keys in PendingDeletion, and require the operator to type the key ID before the action is enabled. Update the explanatory copy in every locale to describe the two steps and the server-side switch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request
Description
"Delete Immediately" on the SSE page never worked against a current server, and it was offered on keys it cannot apply to.
confirm_key_id; the query-string form is refused with400. The console sentforce_immediate=truein the query string, so every attempt failed.PendingDeletion. The console offered it on every key, including ones that had never been scheduled.This PR:
key_id,force_immediate,confirm_key_id); scheduling keeps its existing query form;PendingDeletion, in both the table menu and the mobile cards;confirm_key_id;The console does not know whether the server allows immediate deletion (
RUSTFS_KMS_ALLOW_IMMEDIATE_DELETION). When it does not, the server's refusal message is shown as is.Type of Change
Testing
pnpm type-check pnpm lint pnpm format:check pnpm test:run # 951 passedNew suite
tests/lib/sse-key-deletion.test.tscovers the pending-deletion check, the exact-match confirmation, the request body, and that the page offers the action only for pending keys.Manual run against a local RustFS with the Local KMS backend:
DELETE /kms/keys/deletewith a JSON body returns200and the key leaves the list.400, the server's message is shown, and the key staysPendingDeletion.Checklist
Related Issues
None.
Screenshots (if applicable)
To be attached: key list menu for an active key and a pending key, and the confirmation dialog (empty and filled).
Additional Notes