Any binding config value beginning with enc: is run through decryptOrPassthrough before the adapter sees it. The decrypted chain is cached for 60 seconds with an explicit invalidate hook used by the provider admin panel.
Also called: API keys at rest · encrypted auth token · provider config secrets
- 1Secrets are written as enc:v1: ciphertext (AES-256-GCM via src/lib/crypto.ts).
- 2loadBindings reads the row; decryptConfig walks the config object and unwraps every enc: value.
- 3The adapter reads a plain string and authenticates.
- 4invalidateProviderBindings(orgId) drops the cache after an operator change.
The function carries a full incident write-up (Keith 08-14): decryptOrPassthrough returns an object, and the old code 'assigned that OBJECT straight onto the config'. Every adapter reading `typeof config.authToken === "string" ? ... : ""` saw an object and fell back to empty, which Twilio's adapter treats as unconfigured and returns 'skipped' — silently. 'The effect: any tenant whose credentials were encrypted at rest had their PRIMARY provider quietly skipped and every message delivered by the fallback. Graber's texts kept going out through GoHighLevel minutes after their own Twilio A2P campaign was approved, and the only visible symptom was GHL's error text — which made it look like a GHL problem rather than ours.'
- A silent decryption bug demoted every encrypted-credential tenant to their fallback provider.
- Provider secrets would otherwise have to sit in plaintext for adapters to read.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →