Summary
Extend sf-bridge (under the busbar feature) to resolve Salesforce credentials from Busbar's credential sources rather than requiring a pre-authenticated SalesforceRestClient.
Context
Currently sf-bridge expects the caller to provide an already-authenticated SalesforceRestClient. For Busbar integration, the host must resolve credentials transparently:
- Local development: OS keychain via
busbar-keychain (existing)
- CI/CD: GitHub Environment secrets (set by the Agency's ephemeral session)
- The WASM guest never sees tokens — credential resolution happens entirely on the host side
Implementation
Credential Resolution Chain
- Check environment variables (
SF_ACCESS_TOKEN, SF_INSTANCE_URL) — set by ephemeral session
- Fall back to Busbar keychain (
busbar-keychain::SecretStore)
- If JWT credentials available, perform JWT bearer auth to get access token
- Cache access token with TTL, auto-refresh on expiry
Integration Points
SfBridge::new_with_busbar_auth(config: BusbarAuthConfig) constructor
BusbarAuthConfig holds: keychain path, env var prefix, JWT bearer params
- Token refresh handled transparently — guest never aware of auth mechanics
Acceptance Criteria
Dependencies
- Issue 1.2 (
busbar feature exists)
Part of
Epic 1: busbar-sf-api WASM Bridge Integration
Summary
Extend
sf-bridge(under thebusbarfeature) to resolve Salesforce credentials from Busbar's credential sources rather than requiring a pre-authenticatedSalesforceRestClient.Context
Currently
sf-bridgeexpects the caller to provide an already-authenticatedSalesforceRestClient. For Busbar integration, the host must resolve credentials transparently:busbar-keychain(existing)Implementation
Credential Resolution Chain
SF_ACCESS_TOKEN,SF_INSTANCE_URL) — set by ephemeral sessionbusbar-keychain::SecretStore)Integration Points
SfBridge::new_with_busbar_auth(config: BusbarAuthConfig)constructorBusbarAuthConfigholds: keychain path, env var prefix, JWT bearer paramsAcceptance Criteria
SfBridgecan be constructed withBusbarAuthConfig(no pre-authenticated client needed)Dependencies
busbarfeature exists)Part of
Epic 1: busbar-sf-api WASM Bridge Integration