Configurable/explicit password sources and precedence#2018
Merged
Conversation
Track the various password sources in PasswordCandidates, rather than overwriting values, and resolve the credential to use in a defined order, making explicit the precedence which was previously laid out only in a code comment. The sources, and the precedence, then easily become configurable in ~/.myclirc. Motivation: as we add more sources, such as Vault, some users may wish to disable those sources entirely. Similarly, the precedence of the environment variable may be something users may want to change. It comes before the DSN, but after the CLI literal, which is a bit wonky if you think of the DSN as a CLI literal. Followups here might be warnings on uses of insecure password sources, and some additional finesse such as skipping the system keyring in the case of taking the credentials from Vault. It could also be nice to settle all PasswordCandidates in one place, before calling connect().
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.
Description
Track the various password sources in
PasswordCandidates, rather than overwriting values, and resolve the credential to use in a defined order, making explicit the precedence which was previously laid out only in a code comment.The sources, and the precedence, then easily become configurable in
~/.myclirc.Motivation: as we add more sources, such as Vault, some users may wish to disable those sources entirely. Similarly, the precedence of the environment variable may be something users may want to change. It comes before the DSN, but after the CLI literal, which is a bit wonky if you think of the DSN as a CLI literal.
Followups here might be warnings on uses of insecure password sources, and some additional finesse such as skipping the system keyring in the case of taking the credentials from Vault.
It could also be nice to settle all
PasswordCandidatesin one place, before callingconnect().Checklist
changelog.mdfile.AUTHORSfile (or it's already there).