Skip to content

docs: clarify that lock contexts require OidcFederationStrategy#59

Merged
coderdan merged 1 commit into
mainfrom
docs/lock-context-strategy-clarifications
Jul 9, 2026
Merged

docs: clarify that lock contexts require OidcFederationStrategy#59
coderdan merged 1 commit into
mainfrom
docs/lock-context-strategy-clarifications

Conversation

@coderdan

@coderdan coderdan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #57, applying review feedback left on the v2 port (#56, now merged).

What the reviewer caught

The client setup blocks do configure authStrategy. But the encrypt/decrypt examples below them import an already-built client:

import { client } from "./client"

await client.encrypt(...).withLockContext({ identityClaim: ["sub"] })

Someone skimming those snippets sees .withLockContext() with no strategy anywhere in view, and could reasonably conclude the claim binding works on its own. It doesn't. Without OidcFederationStrategy, the client authenticates as your service, and ZeroKMS has no end-user identity to resolve the claim against.

Changes

Applied to encryption/identity.mdx and encryption/supabase.mdx:

  1. A warn callout. OidcFederationStrategy is the only strategy that supports lock contexts. AccessKeyStrategy does not, and the callout says why. Confirmed against client.d.ts: "Lock context is an additional capability layered on top of OidcFederationStrategy: it requires that strategy, but OidcFederationStrategy does not require lock context."

  2. The examples now state their dependency on the authStrategy-configured client, rather than leaving it implicit in an import.

  3. The dashboard link explains the _, which resolves to whichever workspace you have selected.

Also dropped the "AccessKeyStrategy is also re-exported" aside from identity.mdx. Naming it in a lock-context section was what invited the confusion.

kms/oidc.mdx uses the same _ URL but already reads "Go to your workspace in the Dashboard", so it needs no change.

Checks

  • bun run build passes, 589 pages.
  • Diff is two files, prose and one callout each. No code examples changed.

Follow-up to #57, from review feedback on the v2 port (#56).

The client setup blocks configure `authStrategy`, but the examples below
them import an already-built client, so a reader skimming the encrypt and
decrypt snippets sees `.withLockContext()` with no strategy in view and
could reasonably conclude the claim binding stands alone.

- Warn that OidcFederationStrategy is the only strategy supporting lock
  contexts. AccessKeyStrategy authenticates as the service, so there is no
  end-user identity for ZeroKMS to resolve the claim against.
- State that the examples depend on the authStrategy-configured client.
- Explain that `_` in the dashboard OIDC providers URL is the selected
  workspace.

Dropped the "AccessKeyStrategy is also re-exported" aside from identity.mdx:
naming it in a lock-context section was what invited the confusion.
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
public-docs Ready Ready Preview, Comment Jul 9, 2026 6:15am

Request Review

@coderdan
coderdan merged commit 5aef217 into main Jul 9, 2026
2 checks passed
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