[keymanager/wsd] Add /keys:destroy Go KOL handler with KEM + binding key destruction#651
Open
atulpatildbz wants to merge 1 commit intogoogle:mainfrom
Open
[keymanager/wsd] Add /keys:destroy Go KOL handler with KEM + binding key destruction#651atulpatildbz wants to merge 1 commit intogoogle:mainfrom
atulpatildbz wants to merge 1 commit intogoogle:mainfrom
Conversation
60466aa to
cff8e70
Compare
4d76482 to
87f6a9f
Compare
atulpatildbz
commented
Feb 26, 2026
|
|
||
| // NewServer creates a new WSD server with the given dependencies. | ||
| func NewServer(bindingGen BindingKeyGenerator, kemGen KEMKeyGenerator) *Server { | ||
| func NewServer(bindingGen BindingKeyGenerator, kemGen KEMKeyGenerator, kemKeyDestroyer KEMKeyDestroyer, bindingKeyDestroyer BindingKeyDestroyer) *Server { |
Collaborator
Author
There was a problem hiding this comment.
this will need change after #678 is merged.
May have to rebase over that
…struction
Implement the Go KOL handler for POST /keys:destroy that orchestrates
the full key destruction flow:
1. Workload sends {kemKeyHandle} to WSD
2. WSD looks up binding UUID from KEM-to-binding map
3. WSD calls KPS DestroyKEMKey to destroy the KEM key
4. WSD calls WSD KCC DestroyBindingKey to destroy the binding key
5. WSD removes the KEM→Binding mapping
6. Returns 204 No Content
Changes:
- C headers: add key_manager_destroy_kem_key (KPS) and
key_manager_destroy_binding_key (WSD) declarations
- CGO bridges: add DestroyKEMKey and DestroyBindingKey Go wrappers
- KPS service: extend with DestroyKEMKey method and KEMKeyDestroyer
interface
- WSD server: add KEMKeyDestroyer/BindingKeyDestroyer interfaces,
DestroyRequest type, handleDestroy handler, /keys:destroy route
- Tests: 7 new destroy handler tests + 2 new KPS service tests
Remove DecapAndSeal and Open from KPS and WSD
87f6a9f to
dcac4cd
Compare
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.
Implements the Go orchestration layer (KOL) for
POST /v1/keys:destroy, the key destruction endpoint that allows workloads to explicitly destroy a key pair.Flow:
{key_handle: {handle: ...}}to WSDDestroyKEMKey— destroys the KEM key from the registryDestroyBindingKey— destroys the binding key from the registry204 No ContentChanges:
key_manager_destroy_kem_key(KPS) andkey_manager_destroy_binding_key(WSD) declarationsDestroyKEMKey()andDestroyBindingKey()Go wrappers for the Rust FFI functionsServicewithDestroyKEMKeymethod andKEMKeyDestroyerinterfaceKEMKeyDestroyer/BindingKeyDestroyerinterfaces,DestroyRequesttype,handleDestroyhandler,/v1/keys:destroyroute registrationTestIntegrationDestroyKeyDependencies
This PR is built on top of:
key_manager_destroy_ffi) — Rust FFI changes (Base commit:d1d6bad)wsd_generate_key_go) — Included via merge (Commit:d7f52c6)What to review
Please review the following commits:
d1d6bad—feat(keymanager): Add manual FFI headers for destroy(C headers for destroy)60466aa—[keymanager/wsd] Add /keys:destroy endpoint with KEM + binding key destruction(Go implementation)All other commits are from dependencies (PRs #647, #652) that are not yet merged to main but required for this build.
Verification
Automated Tests
go test ./keymanager/workload_service/...(Passed)go test -tags=integration ./keymanager/workload_service/...(Passed)Manual Verification (Curl)
Manually verified the destruction workflow locally:
POST /v1/keys:generate_kem-> Returns Handle.POST /v1/keys:destroy-> Returns 204.POST /v1/keys:destroy-> Returns 404 (Key mapping removed).