Summary
@cipherstash/stack (and the stash CLI + @cipherstash/wizard) were pinned to @cipherstash/auth 0.40.0. Bump to 0.41.0 and migrate to its new API.
Breaking change in @cipherstash/auth 0.41
Every fallible auth operation now returns a @byteslice/result Result<T, AuthFailure> ({ data } on success, { failure } on error) instead of throwing. Affected surface:
- Strategy construction:
AccessKeyStrategy.create, OidcFederationStrategy.create, AutoStrategy.detect, DeviceSessionStrategy.fromProfile
getToken()
- Device-code flow:
beginDeviceCodeFlow, DeviceCodeResult.pollForToken, DeviceCodeResult.openInBrowser, bindClientDevice
The AuthError type was renamed to AuthFailure — a discriminated union keyed by type ("NOT_AUTHENTICATED", "WORKSPACE_MISMATCH", …) that replaces the old error.code string. Consumers now branch on if (result.failure) / failure.type rather than try/catch.
Changes required
@cipherstash/stack (breaking type surface — minor)
stash (CLI) (patch)
@cipherstash/wizard (patch)
Catalog + tests
Verification
turbo build green for @cipherstash/stack, stash, @cipherstash/wizard
stash tests 334/334, @cipherstash/wizard 140/140, stack offline auth tests 40/40
- Remaining stack integration-test failures require a live ZeroKMS workspace profile (
~/.cipherstash/...) and are unrelated to this change
Work is on branch chore/bump-auth-0.41.
Summary
@cipherstash/stack(and thestashCLI +@cipherstash/wizard) were pinned to@cipherstash/auth0.40.0. Bump to 0.41.0 and migrate to its new API.Breaking change in
@cipherstash/auth0.41Every fallible auth operation now returns a
@byteslice/resultResult<T, AuthFailure>({ data }on success,{ failure }on error) instead of throwing. Affected surface:AccessKeyStrategy.create,OidcFederationStrategy.create,AutoStrategy.detect,DeviceSessionStrategy.fromProfilegetToken()beginDeviceCodeFlow,DeviceCodeResult.pollForToken,DeviceCodeResult.openInBrowser,bindClientDeviceThe
AuthErrortype was renamed toAuthFailure— a discriminated union keyed bytype("NOT_AUTHENTICATED","WORKSPACE_MISMATCH", …) that replaces the olderror.codestring. Consumers now branch onif (result.failure)/failure.typerather thantry/catch.Changes required
@cipherstash/stack(breaking type surface —minor)AuthError→AuthFailure(packages/stack/src/index.ts)ResultfromAccessKeyStrategy.createin the WASM-inlineresolveStrategy(packages/stack/src/wasm-inline.ts); a construction failure now throws a descriptive[encryption]error naming theAuthFailure.typestash(CLI) (patch)stash auth logindevice-code flow +bindClientDevice(packages/cli/src/commands/auth/login.ts)initexisting-auth check (packages/cli/src/commands/init/steps/authenticate.ts)@cipherstash/wizard(patch)packages/wizard/src/agent/fetch-prompt.ts)packages/wizard/src/agent/interface.ts)error.code→failure.type(packages/wizard/src/lib/prerequisites.ts)Catalog + tests
@cipherstash/auth+ 6 per-platform bindings0.40.0→0.41.0inpnpm-workspace.yamland rootpackage.json; update lockfileResultshape (packages/stack/__tests__/wasm-inline-{strategy,new-client}.test.ts,helpers/stub-auth-wasm-inline.ts,packages/wizard/src/__tests__/prerequisites.test.ts).changeset/stack-auth-0-41-result-api.md)Verification
turbo buildgreen for@cipherstash/stack,stash,@cipherstash/wizardstashtests 334/334,@cipherstash/wizard140/140, stack offline auth tests 40/40~/.cipherstash/...) and are unrelated to this changeWork is on branch
chore/bump-auth-0.41.