ProviderConnection with encrypted credentials #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Implements ADR 0005. A
ProviderConnectionis a User's standing authorization to a namedProvider, held as an opaque credential encrypted under a key from the environment.The domain does not know what a
Provideris or how it is reached. It holds a name and an opaque credential; parsing, authenticating, and calling are entirely adapter concerns. That is what lets a secondProviderwith a different credential shape (OAuth, API key) be added later without touching the domain.The risk is accepted knowingly and recorded in the ADR: the classic Subsonic scheme computes a per-request token from the plaintext password, so the stored secret is password-equivalent. Encryption raises the bar against a stolen database file alone; it buys little if environment and data are backed up together.
The encryption key follows the existing convention for secrets — environment, not the TOML config file, alongside the JWT secret.
Acceptance criteria
Providerfrom settingsProvidername and an opaque credentialProviderwith a different credential shape needs no domain changeBlocked by
None - can start immediately.