Skip to content

feat(stack-kms): typed errors and payload checks for key vendor backends (CIP-5304) - #1632

Draft
freshtonic wants to merge 1 commit into
james/cip-5203-key-vendor-backend-designfrom
james/cip-5304-stack-kms-key-vendor-errors
Draft

freshtonic wants to merge 1 commit into
james/cip-5203-key-vendor-backend-designfrom
james/cip-5304-stack-kms-key-vendor-errors

Conversation

@freshtonic

@freshtonic freshtonic commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Layer 2 of the CIP-5203 stack. Implements CIP-5304.

  • Error::Backend { vendor, kind, source } and Error::ZeroKmsOnly are added, with refuse_zerokms_extensions for key vendor backends.
  • KeyBackend, KeyVendor and KeyMode, with stable bytes that a keyset record stores. KeyMode has one variant, Derived, and is #[non_exhaustive].
  • IndexKey::from_key_bytes is a public constructor.
  • The ZeroKmsKeySource marker, so a key router cannot hold a second router.
  • The key source traits do not change, so stack-encrypt does not change.
  • Error is not #[non_exhaustive], so the new variants are a breaking change to stack-kms.

Decisions are in docs/plans/2026-11-05-key-vendor-backends-decisions.md (CIP-5304 sections).

…nds (CIP-5304)

Add Error::Backend and Error::ZeroKmsOnly, refuse_zerokms_extensions,
IndexKey::from_key_bytes, the stable KeyVendor and KeyMode bytes, and the
ZeroKmsKeySource marker. The key source traits are unchanged, so
stack-encrypt does not change.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@changeset-bot

changeset-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: cd90970

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This branch has not been deployed

No deployments
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