Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .cargo/mutants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ exclude_re = [
# Under `http` the body is `false`; the no-`http` arm is pinned by
# `a_builder_without_a_transport_is_refused_when_there_is_no_bundled_one`.
'stack-auth/src/error\.rs:\d+:\d+: replace RequestError::is_no_transport -> bool with false$',
'stack-auth/src/auto_strategy\.rs:150:9: replace AutoStrategy::detect_inner -> Result<Self, AuthError> with Ok\(Default::default\(\)\)$',
'stack-auth/src/auto_strategy\.rs:167:9: replace AutoStrategy::detect_inner -> Result<Self, AuthError> with Ok\(Default::default\(\)\)$',
# The wasm32 RS256 dispatch (`rs256::verify` over RustCrypto). The native
# one shares its name, so this anchors on the line. The RustCrypto backend
# it calls is compiled into the host tests and pinned there.
'stack-auth/src/token_verifier\.rs:470:9: replace rs256::verify -> bool with (true|false)$',
'stack-auth/src/token_store\.rs:(261|269):9: replace <impl TokenStore for TokenStoreFn<L, S>>::(load|save)',
# stack-auth — equivalent.
'stack-auth/src/(access_key|oidc)_refresher\.rs:\d+:\d+: replace <impl Refresher for \w+(<P>)?>::try_credential -> Option<Self::Credential> with Some\(Default::default\(\)\)$',
Expand Down
5 changes: 5 additions & 0 deletions .changeset/auth-verify-cts-tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cipherstash/auth": patch
---

The Rust `stack-auth` crate behind `@cipherstash/auth` can now verify the access tokens CTS issues before using them: RS256 signature against the keys CTS publishes at `/.well-known/jwks.json`, plus issuer, expiry and (when requested) audience. The trusted issuer is the CTS for the workspace's region, pinned separately from `CS_CTS_HOST` and any `baseUrl` override. Verification is opt-in in this release and is not yet exposed through the JavaScript API, so `@cipherstash/auth`'s behaviour is unchanged.
7 changes: 5 additions & 2 deletions .github/workflows/tests-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,14 @@ jobs:
- name: rustdoc
run: mise run doc

# The stack-encrypt examples need live credentials, so they are built
# here and run in tests-golang.yml `live`.
# The stack-encrypt examples and stack-auth's `verify_tokens` need live
# credentials, so they are built here and run in tests-golang.yml `live`.
- name: Build the stack-encrypt examples
run: cargo build --locked -p stack-encrypt --examples

- name: Build the stack-auth verify_tokens example
run: cargo build --locked -p stack-auth --example verify_tokens

# The crates release-plz publishes. `--dry-run` packages and compiles
# each the way crates.io would (all five together, so each resolves the
# others from cargo's temporary local registry rather than from
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ jobs:
working-directory: languages/golang
run: CGO_ENABLED=0 go test -v ./encrypt/...

# Verifies a real CTS token against CTS's published signing keys: the
# live proof that the token verifier's assumptions (RS256, the region's
# CTS as issuer, keys at its /.well-known/jwks.json) hold.
- name: stack-auth verifies a live CTS token
run: cargo run --locked -p stack-auth --example verify_tokens

- name: stack-encrypt examples
run: |
for example in encrypted_record mixed_user search_terms zerokms_auth; do
Expand Down
108 changes: 107 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading