feat: cipherstash-client 0.40.0, v3 payload format, and OIDC federation auth#6
Open
calvinbrewer wants to merge 1 commit into
Open
feat: cipherstash-client 0.40.0, v3 payload format, and OIDC federation auth#6calvinbrewer wants to merge 1 commit into
calvinbrewer wants to merge 1 commit into
Conversation
…ederation Upgrade the native layer from cipherstash-client 0.34.1-alpha.2 to 0.40.0, adding eql-bindings 3.0.0 (v3 payload format) and stack-auth 0.40.0 (client auth strategies including OIDC federation with no lock context required). Rust: replace the hand-rolled encrypt-config parser with the canonical schema config, port the v3 conversion layer, add a token-callback auth seam to the C ABI, and remove per-operation service tokens (deleted platform-wide in client 0.36). Go: add WithOIDCFederation / WithTokenProvider / WithEncryptedFormat, an opaque QueryTerm for query results, canonical cast types, exact int64 / date / timestamp / decimal round-trips, host-side env credential loading, and remove WithServiceToken. CI: add the missing linux-arm64-gnu build, fix arm64-musl static linking, and run Go tests against the freshly built libraries. Non-darwin-arm64 static libraries are stale in this commit; the PR build workflow rebuilds and commits all platforms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Upgrades the entire stack — the Rust FFI layer and the Go SDK — from cipherstash-client
0.34.1-alpha.2to the current crate set, bringing the Go SDK to feature parity with protectjs-ffi v0.29.0:cipherstash-client0.34.1-alpha.20.40.0cts-common0.34.1-alpha.20.40.0stack-profile0.34.1-alpha.20.40.0stack-auth0.40.0(new — auth strategies)eql-bindings3.0.0(new — EQL 3.0.0 payload format)cipherstash-config,cipherstash-corecipherstash_client::schema)OIDC federation without lock context
The headline feature:
WithOIDCFederationmakes every operation identity-aware at the client level, with no per-operation context.Design: the Go side registers a JWT callback across the FFI (
//export+runtime/cgo.Handle, panic-safe, result-envelope protocol);stack-auth's nativeOidcFederationStrategyin Rust does thePOST /api/authoriseexchange, caches the CTS token until expiry, re-federates on demand, and verifies every token against the workspace CRN. Also included:WithTokenProviderfor supplying raw service tokens, and host-side env credential loading (CS_CLIENT_ID/CS_CLIENT_KEYare no longer read by the native layer in 0.40 — the SDK now fills them in, matching protectjs).Consequences of the platform's auth model change:
WithServiceTokenis removed — per-operation service tokens were deleted platform-wide in client 0.36.v3 payload format
WithEncryptedFormat(EncryptedFormatV3)targets databases provisioned with the EQL 3 schema (typed encrypted columns). V2 remains the default. Notes:NewClientwithErrUnsupportedFormat+ hint, instead of silently dropping a search capability.*QueryTerm(v3 selector terms are bare JSON strings, which the old*Encryptedreturn type could not represent). Breaking:EncryptQuery/EncryptQueryBulksignatures changed.eql_v3.query_*casts, ordering extractors), taken from protectjs-ffi's live integration tests.Correctness improvements
int64range — the wire and both conversion layers no longer pass throughf64(values > 2^53 previously rounded). Integer conversions are exact-or-error: fractional/overflow/NaN rejected instead of truncated.decimalvalues stored exactly (string-parsed, not via float);date/timestampcolumns now actually work, acceptingtime.Timeand RFC 3339 strings.CanonicalEncryptionConfig; Go normalizes legacy cast names (string→text,number→float,bigint→big_int) on the wire.big_int(wasnumber/float),time.Timetotimestamp.CI
libprotect_ffi_linux_arm64.awas committed but never rebuilt — permanently stale).+crt-static(the config was hardcoded to the x86_64 target).test-gojob runs the Go suite against freshly built libraries on macOS and Linux.Important
Only the darwin-arm64 static library in this PR is current; the build workflow on this PR rebuilds and commits all six platforms.
Verification
cargo test: 172 passing;cargo clippy --all-targets -- -D warningsclean.go test ./...: passing (pure unit tests, no network).int64> 2^53); v3 query operand shapes (all domain terms, no ciphertext);IsEncryptedon both formats; token-provider errors propagating Go→Rust→Go intact; and the OIDC path exercised against the real/api/authoriseendpoint (rejected with401 InvalidTokenas expected for a non-IdP JWT — the full pipeline works, only a real IdP token is needed).Breaking API changes
WithServiceTokenremovedWithOIDCFederation(identity) orWithTokenProvider(raw tokens)EncryptQueryreturns*QueryTerm(was*Encrypted).String()/.Bytes()to inspectEncryptQueryBulkreturns[]*QueryTermjson.Numberfor numeric columns (wasfloat64)DecryptModel/BulkDecryptModelscoerce automatically; directDecryptcallers should switch onjson.Numberbig_int(was float)cast=floatto keep old behavior for a column with existing data🤖 Generated with Claude Code