docs(solutions): port the use-cases section into /solutions#56
Merged
Conversation
Ports the use-cases section into /solutions, correcting three API errors
found by checking the examples against the generated TypeDoc for
@cipherstash/stack v0.18.0.
- provable-access used `client.withLockContext({ identityToken }).encrypt()`,
which does not exist. The real API constructs a LockContext, identifies it
with the JWT, and attaches it to the operation:
`client.encrypt(v, opts).withLockContext(lockContext.data)`.
- data-residency passed credentials as top-level keys to `Encryption()`.
They belong in the nested `config` object.
- ai-and-rag queried with `eql_v2.eq(user_id, $1)`, removed in EQL 3.0.0.
Now a typed operand: `WHERE user_id = $1::public.text_eq`.
The legacy use-cases index was not a section index. Its "what data should I
protect" primer moves onto the Solutions index; its data-sovereignty section
folds into data-residency, which already covered the same ground.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
coderdan
commented
Jul 9, 2026
coderdan
commented
Jul 9, 2026
coderdan
commented
Jul 9, 2026
- provable-access: rewrite on the strategy-based API. LockContext.identify()
is deprecated (per-operation CTS tokens were removed in protect-ffi 0.25).
Authenticate the client as the end user with OidcFederationStrategy via
config.authStrategy, then bind with .withLockContext({ identityClaim }).
Verified against @cipherstash/stack 0.19.0 and @cipherstash/auth 0.42.0.
- regions: extract the ZeroKMS region list into @/lib/zerokms-regions and a
<ZeroKmsRegions /> MDX component, used by both the regions reference and
data-residency so the list can't drift. Adds the two missing regions, the
.aws suffix on identifiers, and states that ZeroKMS is AWS-only.
- ai-and-rag: remove pending a rewrite. Its legacy URL now redirects to the
Solutions index rather than a page that no longer exists.
Only identify() and getLockContext() are deprecated. The constructor is not:
.withLockContext() accepts a LockContext or a plain { identityClaim }.
coderdan
commented
Jul 9, 2026
…e-access - Note that OidcFederationStrategy is the only strategy supporting lock contexts; AccessKeyStrategy authenticates as the service, so there is no end-user identity to bind a claim to. - Say that the examples depend on the authStrategy-configured client. - Explain that the '_' in the dashboard OIDC providers URL is the current workspace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports
content/stack/reference/use-cases/*into/solutions, per the mapping inv2-redirects.mjs. Four pages: the section index,ai-and-rag,data-residency,provable-access.Three API errors found and fixed
This was supposed to be a mechanical port. It wasn't. I checked every code example against the generated TypeDoc for
@cipherstash/stackv0.18.0, and three of them were wrong:1.
provable-accessused an API that does not exist. Every code block calledclient.withLockContext({ identityToken: jwt }).encrypt(...). The real API constructs aLockContext, identifies it with the JWT (which returns aResult, because the CTS token exchange can fail), and attaches it to the operation:2.
data-residencypassed credentials as top-level keys toEncryption({ schemas, workspaceCrn, clientId, ... }).EncryptionClientConfigputs them in a nestedconfigobject.3.
ai-and-ragqueried witheql_v2.eq(user_id, $1), removed in EQL 3.0.0. Now uses a typed operand,WHERE user_id = $1::public.text_eq, with a pointer to the typed-operand rule and to indexes, since that predicate needs a functional index to avoid a sequential scan.The
provable-accessbug is exactly the signature drift this overhaul exists to eliminate, and it survived on a live page.The legacy index was not an index
use-cases/index.mdxwas three unrelated things. Handled as follows:data-residencyalmost line for line. Folded in; the distinct material (the three properties that give you residency) is now that page's opening section./concepts/compare/data-vaultsand is a sixth comparison page beyond the five in IA.md. It is distinct fromhashicorp-vault: Skyflow and VGS are PII data vaults, HashiCorp Vault is a secrets manager. Until that lands,/stack/reference/use-casesredirects to/solutionsand that comparison is not reachable from its old URL.Other changes
ai-and-ragnoting that CipherStash encrypts chunks and metadata, not the embeddings, and that embeddings should themselves be treated as sensitive. The original page implied full coverage.ai-and-ragingest now usesencryptModeland retrieval usesbulkDecryptModelsrather than per-field calls in aPromise.all, so a reranking pass is one ZeroKMS round trip instead of one per row.provable-access's "mathematically impossible to bypass" framing. A lock context moves enforcement into key derivation; it does not stop a caller holding a valid token.Checks
bun run buildpasses; all four pages prerender.bun run validate-redirectspasses (194 legacy pages covered)./stack/cipherstash/kms/*,/stack/cipherstash/proxy/audit) point at legacy homes and are tracked for repointing.packageVersion: v0.18.0. Pages carryverifiedAgainst: { stack: "0.18.0" }.One upstream nit
The TypeDoc for
EncryptionClientcontains an example that passes theResultto.withLockContext(lockContext), whileLockContext's own example correctly passes.withLockContext(identified.data).withLockContexttakes aLockContext, so theEncryptionClientexample is wrong. Worth fixing in the SDK's doc comments.