Skip to content

docs: what production assurance means for a native client - #533

Merged
osanderson merged 1 commit into
mainfrom
docs/client-native-assurance
Oct 3, 2026
Merged

osanderson merged 1 commit into
mainfrom
docs/client-native-assurance

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

Summary

This is point 3 of the native-wallet asks. client.AssuranceProduction's three checks hold for a native client, but their docs were written for a server, and two of them caught a wallet out.

  • Key custody. keys.KeyCustody.Durable spoke only of tokens and cached JWKS surviving a restart. For a client, it now says, Durable means a key outlives the process that made it until the client is done with it: an in-progress authorization can be completed after a restart, and a DPoP-bound token stays usable. A native app's per-flow keys held in the platform key store (the iOS Keychain or Secure Enclave, the Android Keystore) qualify, so embedders can declare it honestly.
  • The random-source check stays an identity check. Accepting a self-declared CSPRNG would be unverifiable, and the server takes the same stance. Its error now says to pass crypto/rand.Reader itself, not a wrapper, which is the trap gomobile-bound packages fall into.
  • AtomicConsume: for a store used by one process, such as a native app's own session store, a mutex around the read and the delete is enough. A store another process also opens, such as an app extension or widget sharing the app's data container, needs a file lock or the database's own transaction.

No behaviour changes beyond the error's wording.

Tests

go test for client, keys, storage and server passes, and golangci-lint is clean.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- keys.KeyCustody.Durable was written for a server: tokens and cached
  JWKS surviving a restart. For a client it means a key outlives the
  process that made it until the client is done with it, so an
  in-progress authorization or a DPoP-bound token survives a restart.
  The doc now says so, with a native app's per-flow platform-keystore
  keys as an example that qualifies.
- client's AssuranceProduction refusal of a Random that isn't
  crypto/rand.Reader now says to pass it directly rather than a
  wrapper, which nothing can verify.
- storage.Capabilities.AtomicConsume says a mutex suffices for a store
  one process uses, and not for one other processes open too, such as
  an app extension sharing the app's data container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@osanderson
osanderson force-pushed the docs/client-native-assurance branch from d6a69f9 to d47e035 Compare October 3, 2026 12:52
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

@osanderson
osanderson merged commit fa120ab into main Oct 3, 2026
17 checks passed
@osanderson
osanderson deleted the docs/client-native-assurance branch October 3, 2026 12:58
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