Skip to content

feat(go): key vendor backends through the encrypt guest (CIP-5311) - #1532

Draft
freshtonic wants to merge 5 commits into
james/cip-5309-azure-key-vault-key-vendor-backend-stack-kms-azurefrom
james/cip-5311-go-sdk-key-vendor-backends-through-the-encrypt-guest
Draft

freshtonic wants to merge 5 commits into
james/cip-5309-azure-key-vault-key-vendor-backend-stack-kms-azurefrom
james/cip-5311-go-sdk-key-vendor-backends-through-the-encrypt-guest

Conversation

@freshtonic

@freshtonic freshtonic commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Layer 9 of the CIP-5203 stack. Implements CIP-5311 (ADR-0011).

  • New host import vendor_credential_get. The host supplies short-lived credentials only: AWS temporary credentials, or an OAuth or Vault token. The guest signs and holds all key material. There is no RSA in the guest; the GCP service-account login is now behind a default feature.
  • Go API: WithKeyVendor, WithKeysetRecords, WithDefaultKeyset, WithRootKeyTTL, ErrNoZeroKMS. The vendor types are AWSKMS, GoogleCloudKMS, AzureKeyVault, VaultTransit and StaticKey. Credential seams are added; no vendor SDK is added to go.mod.
  • A vendor-only client needs no CipherStash credentials.
  • One guest with all backends. Size grows +24.1% (plain) and +23.4% (EQL).
  • Tests: hermetic Go tests with the static key, and with AWS through a fake RoundTripper that checks SigV4 and call counts.

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

@freshtonic
freshtonic added this pull request to stack #1523 November 6, 2026 01:25
@changeset-bot

changeset-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 40e1527

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

@freshtonic freshtonic changed the title james/cip 5311 go sdk key vendor backends through the encrypt guest feat(go): key vendor backends through the encrypt guest (CIP-5311) Nov 6, 2026
@coderabbitai

coderabbitai Bot commented Nov 6, 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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing (cargo-mutants, --in-diff, stack-auth + stack-encrypt)

caught missed unviable timeout
60 0 94 0

Every mutant in the changed lines was caught by a test.

@freshtonic
freshtonic force-pushed the james/cip-5311-go-sdk-key-vendor-backends-through-the-encrypt-guest branch from f6e5996 to dda3a35 Compare November 6, 2026 02:15
@freshtonic
freshtonic force-pushed the james/cip-5311-go-sdk-key-vendor-backends-through-the-encrypt-guest branch from dda3a35 to fe5023c Compare November 6, 2026 05:10
…CIP-5311)

The feature is on by default. A build without it has no RSA code.
The guest routes keysets between ZeroKMS and at most one key vendor
backend (KeyRouter over GuestVendor: AWS KMS, Google Cloud KMS, Azure
Key Vault, Vault Transit or a static key). The vendor clients sign in the
guest and send through transport_send. The new import
vendor_credential_get gives them a short-lived credential per request.

The Go host adds WithKeyVendor and WithKeysetRecords, a credential source
for each vendor kind with no vendor SDK dependency, the import, and the
capability matrix in the package docs.
Add WithDefaultKeyset, WithRootKeyTTL and ErrNoZeroKMS.

With WithKeyVendor and no WithCredentials, NewClient resolves no ZeroKMS
credentials. The guest routes the default keyset to the vendor
(KeyRouter::with_vendor_default) and refuses every ZeroKMS request with
the new STATUS_NO_ZEROKMS.
StaticKey had no String, GoString or LogValue, so a %+v or a slog of the
value printed the root key. Add the three methods, as AWSCredentials and
AccessToken have, and a test for each output.
@freshtonic
freshtonic force-pushed the james/cip-5311-go-sdk-key-vendor-backends-through-the-encrypt-guest branch from fe5023c to 40e1527 Compare November 6, 2026 05:13

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