Skip to content

Kms describe public key - #150

Merged
amirylm merged 3 commits into
mainfrom
kms-describe-public-key
Sep 23, 2026
Merged

amirylm merged 3 commits into
mainfrom
kms-describe-public-key

Conversation

@DaniDeltaT

@DaniDeltaT DaniDeltaT commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

PR renames the KMS metadata lookup API from kms.DescribeKey to kms.GetKeyMetadata and adds a narrower kms.GetPublicKey API for callers that only need verification material.

kms.GetKeyMetadata preserves the existing authenticated, tenant-scoped metadata lookup behavior and accepts either canonical key id (kms:) or raw alias.

kms.GetPublicKey uses the same lookup path, but returns only the public key for asymmetric signing/key-agreement keys.

Symmetric keys are rejected because they do not have public key material.
This also keeps the Transit asymmetric public-key extraction fix, which reads OpenBao’s versioned keys response shape so ECDSA public keys are correctly persisted and returned.

Validated in k8s dev using image tags:
v0.2.21-rc-1
v0.2.21-rc-2

Changes

  • Main feature or fix implemented
  • Tests added
  • Documentation updated

Checklist

  • Code compiles without warnings
  • All tests and pipelines pass
  • Commit messages are clear and descriptive
  • PR linked to an issue if applicable (Fixes #XX)

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

The regenerated kms_grpc.pb.go header reports a non-existent protoc v7.34.1, which is misleading and suggests the codegen toolchain/version metadata needs correction for reproducibility.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: None

What changed in this PR

Adds new KMS RPCs to separate full key metadata retrieval from public-key-only retrieval, while updating the Transit/OpenBao integration to correctly persist and return asymmetric public keys from versioned key responses.

Changes:

  • Introduces GetKeyMetadata and GetPublicKey across the public service proto, internal plugin proto, gateway routing/validation, and plugin implementation.
  • Fixes Transit asymmetric public-key extraction by reading OpenBao’s versioned keys response shape.
  • Adds/updates Go and Rust tests plus documentation for the new APIs and JSON-RPC PascalCase behavior.
File Description
proto/​services/​kms.proto Adds public RPCs/messages for key metadata and public-key retrieval.
proto/​plugins/​kms.proto Adds internal plugin RPCs/messages carrying client_id for tenant scoping.
plugins/​proto/​plugins/​kms.pb.go Regenerated Go protobuf types for the plugin contract.
plugins/​proto/​plugins/​kms_grpc.pb.go Regenerated Go gRPC stubs for the plugin contract (new methods).
plugins/​pkg/​plugin/​kms/​transit_provider.go Uses version-aware Transit public-key extraction when persisting metadata.
plugins/​pkg/​plugin/​kms/​README.md Documents GetKeyMetadata/GetPublicKey semantics and tenant scoping.
plugins/​pkg/​plugin/​kms/​plugin.go Implements GetKeyMetadata and GetPublicKey in the KMS plugin.
plugins/​pkg/​plugin/​kms/​plugin_test.go Adds test coverage for new RPCs and updated Transit key response shape.
plugins/​pkg/​plugin/​kms/​openbao.go Implements versioned Transit public-key extraction (keys map parsing).
gateway/​src/​services/​kms.rs Adds gateway RPC wiring, plugin calls, and validation for new methods.
gateway/​src/​services/​jrpc.rs Adds JSON-RPC routing + (de)serialization tests for new methods.
gateway/​build.rs Registers new KMS types for PascalCase JSON serialization.
Files not reviewed (2)
  • plugins/proto/plugins/kms.pb.go: Generated file
  • plugins/proto/plugins/kms_grpc.pb.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@amirylm
amirylm merged commit 1b28415 into main Sep 23, 2026
7 checks passed
@amirylm
amirylm deleted the kms-describe-public-key branch September 23, 2026 20:14
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