Skip to content

feat: DeleteKey for DELETE /key - #6

Merged
catsika merged 2 commits into
mainfrom
feat/delete-key
Oct 26, 2026
Merged

catsika merged 2 commits into
mainfrom
feat/delete-key

Conversation

@catsika

@catsika catsika commented Oct 26, 2026

Copy link
Copy Markdown
Member

What

Adds DeleteKey(DeleteKeyParams) to permanently delete a license key. BlockKey remains the reversible option.

Contract

DELETE /key with Authorization: Bearer <admin key> and JSON body { "productId", "licenseKey" }. The license key goes in the body, never in the URL. Returns { "message": "Key deleted", "code": 0 }; an unknown key returns 404 { "message": "Invalid license key", "code": 1 } as a failed KeyMintResult. A new private HandleDeleteRequestWithBody helper sends the body; the existing query-param DELETE helper (used by DeleteCustomer) is unchanged.

Tests

  • Contract tests: method, path /key, empty query, license key not in URL, Bearer auth, JSON body fields; parses 200; 404 surfaces status/code/message; invalid params send no request.
  • Live test: after the existing workflow it deletes the node-locked key and checks that a follow-up GetKey fails. Cleanup in finally now deletes both created keys (falling back to block), so the shared test workspace stops filling up.

Adds DeleteKey(DeleteKeyParams), sending productId and licenseKey in the
JSON body of DELETE /key so the license key never appears in the URL.
The live test now deletes the keys it creates.
@catsika
catsika merged commit 71bdb8e into main Oct 26, 2026
2 checks passed
@catsika
catsika deleted the feat/delete-key branch October 26, 2026 03:17
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.

1 participant