feat: delegate credential loading to protect-ffi#326
Conversation
Remove eager workspace CRN checks from ProtectClient and EncryptionClient constructors — protect-ffi now handles credential resolution internally via stack-auth and the cipherstash profile. - Remove loadWorkSpaceId calls and unused clientInfo methods - Override protect-ffi to use local linked build - Use ensureKeyset in keyset tests instead of hardcoded UUIDs
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR upgrades Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Replace the local link override with the published 0.21.0 version of @cipherstash/protect-ffi across all packages.
Set array_index_mode to 'all' on STE vec indexes so the FFI correctly flags array entries and generates distinct hashes for array element values. This fixes JSON array operations including jsonb_array_elements, jsonb_array_length, and array containment queries.
newClient in protect-ffi already handles env var fallback via withEnvCredentials, so remove the manual fallback from EncryptionClient. Add typedocs to ProtectClientConfig fields documenting env var fallbacks, and remove stale TOML config reference from ClientConfig.
Remove hardcoded EQL SQL files from local/ and packages/schema/. The local Docker setup now downloads the latest EQL release at build time, and the drizzle migration generator fetches it at runtime. This matches the pattern already used in stack-forge.
- Add array_index_mode support to packages/stack/src/schema (was only in packages/schema, causing silent divergence) - Update stack schema builder tests for array_index_mode - Remove empty constructors from ProtectClient and EncryptionClient - Replace TOCTOU existsSync check with try/catch in drizzle migration generator
Summary
ProtectClientandEncryptionClientconstructors. Credential resolution (workspace CRN, access key, client key) is now fully handled byprotect-ffiviastack-authand the~/.cipherstashprofile — no env vars orcipherstash.tomlrequired.ensureKeysetfrom protect-ffi in keyset tests instead of hardcoded UUIDs, so tests create/find the keyset dynamically.Dependency
Summary by CodeRabbit
New Features
Improvements
@cipherstash/protect-ffito 0.21.0.ProtectClientConfigwith optional credential fields for flexible multi-tenant scenarios.