Saved connections vault (encrypted DSNs) - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A saved-connections vault, so you don't paste a DSN every time. Store a database connection once and reference it by name when creating an operation.
MARATHON_SECRET) and is never returned by the API; only name/driver/created-at are exposed.connection_idinstead of an inline DSN; the DSN is resolved (decrypted) only when a run starts. Works in solo and fleet mode, and for dry-run and quarantine retry.Changes
internal/secret— AES-256-GCM box (random nonce, tamper-detecting), keyed fromMARATHON_SECRET(falls back to a dev passphrase locally). Unit-tested: round-trip, non-determinism, wrong-key and tamper failures.connectionsCRUD +/connections/{id}/test+/connections/test(draft) endpoints.tasks.connection_id. Task validation makes the DSN optional when a connection is used.How to test
Screenshots
Captured with headless Chrome.
Saved connections vault
New-operation wizard — pick a saved connection
Notes
MARATHON_SECRETin production so stored DSNs are protected by your own key. Without it, a fixed dev passphrase is used (fine for local, not for production).