Add Busbar keychain integration for WASM credential resolution#92
Add Busbar keychain integration for WASM credential resolution#92
Conversation
- Add BusbarAuthConfig and BusbarAuthResolver for transparent credential resolution - Implement credential resolution chain: env vars -> JWT bearer auth - Add token caching with TTL and auto-refresh support - Add new SfBridge::new_with_busbar_auth() constructor under busbar feature - Add Auth error variant to Error enum - Add unit tests for env var resolution - Update Cargo.toml with busbar-sf-auth dependency Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
- Add Busbar authentication section to README.md - Document credential resolution chain and caching - Add example code for both standard and Busbar auth approaches - Update lib.rs with Busbar auth example - Separate busbar and busbar-capability features Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
- Add test_bridge_with_busbar_auth_from_env for environment variable resolution - Add test_bridge_with_busbar_auth_jwt for JWT bearer authentication - Tests are ignored by default, run with --ignored when properly configured - Demonstrate usage patterns for both auth methods Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@copilot we are failing almost every single build? 0s error: unexpected error: could not compile |
The integration tests use #[cfg(feature = "busbar")] but the workspace root didn't have this feature defined, causing clippy to fail with unexpected cfg condition value error. Added empty busbar feature flag to workspace root to fix the CI build. Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
Fixed in b006f57. The integration tests were using |
|
@copilot This ENTIRE BRANCH is completely wrong! The task was to implement integration with busbar, which is in a separate git repo you need to use the This should be a default off optional feature so the crate can be used normally without Busbar or enable the feature and use it with Busbar's secure keychain system. Please DELETE all your attempts to build a parallel Busbar keychain system here and implement properly |
Reverting all custom auth implementation. The task requires integrating with the actual Busbar keychain system from composable-delivery/busbar, not creating a parallel implementation. Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
You're absolutely right - I completely misunderstood the task. I've reverted all the custom auth implementation in commit 4922743. Now implementing proper integration with busbar-keychain from the composable-delivery/busbar repository using GH_TOKEN_BUILDS. The feature will be optional and off by default. |
…ironment variable
…tead of KANTEXT_BUILD_GITHUB_TOKENS for private repo access
…eatures into a single `busbar` feature
…tting in dependencies section
Busbar Keychain Integration for WASM Credential Resolution
This PR integrates the
sf-bridgecrate with the Busbar keychain system from thecomposable-delivery/busbarrepository for transparent credential resolution without requiring pre-authenticated clients.✅ Acceptance Criteria Met
SfBridgecan be constructed with credential config (no pre-authenticated client needed)🎯 Key Features
New Public API:
KeychainAuthConfig- Configuration for Busbar keychain integrationJwtAuthConfig- JWT bearer authentication configurationKeychainAuthResolver- Credential resolution engine usingbusbar-keychain::SecretStoreSfBridge::new_with_keychain_auth()- Constructor with Busbar keychain authSfBridge::with_keychain_auth_and_handle()- Constructor with custom tokio handleCredential Resolution Chain:
busbar-keychain::SecretStore- Local developmentIntegration:
busbar-keychaincrate fromcomposable-delivery/busbarrepository📝 Files Changed
Core Implementation:
crates/sf-bridge/src/keychain_auth.rs- New module (343 lines) integrating with Busbar keychaincrates/sf-bridge/src/lib.rs- New constructors and examplescrates/sf-bridge/Cargo.toml- Added busbar-keychain and busbar-sf-auth dependenciesDocumentation:
crates/sf-bridge/README.md- Busbar keychain feature documentation with examplescrates/sf-bridge/src/lib.rs- Updated module docs with keychain auth examples🔒 Security
🚀 Usage Examples
Resolve from Busbar keychain:
With JWT bearer auth fallback:
📊 Test Results
✅ All existing workspace unit tests pass
✅ Unit tests for environment variable resolution
📦 Feature Flags
busbar- Busbar capability system integration (existing)busbar-keychain- Busbar keychain integration (NEW, optional, off by default)🔧 CI/CD Notes
The implementation is designed to work seamlessly in CI/CD environments where:
SF_ACCESS_TOKENandSF_INSTANCE_URLare set by ephemeral sessionsGH_TOKEN_BUILDSprovides access to the privatecomposable-delivery/busbarrepository dependencyThe
busbar-keychainfeature is optional and off by default, allowing the crate to be used normally without Busbar or with Busbar's secure keychain system when enabled.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.