Skip to content

kms: add ImportKeyVersion.MACKey for importing a MAC key - #47

Merged
aead merged 1 commit into
mainfrom
key-ring-import
Oct 13, 2026
Merged

aead merged 1 commit into
mainfrom
key-ring-import

Conversation

@aead

@aead aead commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

This commit adds the optional MACKey field to ImportKeyVersion and the matching MACKey field to the ImportKeyRingVersion protobuf message. It allows Client.ImportKeyRing to import the secret key used for computing message authentication codes (MACs) together with the encryption key of a key version.

Summary by CodeRabbit

  • New Features
    • Key ring version imports can now include an optional MAC key alongside the existing key material. The MAC key is preserved as import requests are encoded and decoded, allowing clients to provide authentication-key material as part of an import. Versions that do not include a MAC key remain supported.

This commit adds the optional `MACKey` field to `ImportKeyVersion`
and the matching `MACKey` field to the `ImportKeyRingVersion`
protobuf message. It allows `Client.ImportKeyRing` to import the
secret key used for computing message authentication codes (MACs)
together with the encryption key of a key version.

Signed-off-by: Andreas Auernhammer <git@aead.dev>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: aaf2d651-0945-441c-9bc7-9d6c4df21557
📥 Commits

Reviewing files that changed from the base of the PR and between 671d6f7 and c8b2dd2.

⛔ Files ignored due to path filters (1)
  • kms/protobuf/request.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (2)
  • kms/protobuf/request.proto
  • kms/request.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The import key version request adds an optional MAC key field. Marshal and unmarshal operations copy the field between the Go request and protobuf representations.

Changes: Imported key MAC field

Layer / File(s) Summary
MAC key contract and conversion
kms/protobuf/request.proto, kms/request.go
ImportKeyRingVersion and ImportKeyVersion include a MAC key field. MarshalPB copies the field into the protobuf representation, and UnmarshalPB restores it.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to c8b2d

Imported key versions now round-trip the MAC key through the protobuf message. No merge-blocking risk is apparent from the reviewed changes.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: adding MACKey to ImportKeyVersion for MAC key import.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit packed a key with care,
A MAC key nestled safely there.
It crossed the wire, then came back,
In protobuf form, still on track.
The rabbit thumped, “The fields align!”

Comment @coderabbitai help to get the list of available commands.

@aead
aead merged commit 39cd855 into main Oct 13, 2026
6 checks passed
@aead
aead deleted the key-ring-import branch October 13, 2026 12:02
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