Repository navigation
fix(secrets): warn when the vault beside config.toml disagrees with the home vault - #160
Merged
Merged
Conversation
…he home vault import_config_dir_vault now also returns the names present in both vaults with different values. Boot logs one warn per name (never the value) saying the home vault value is used. Behaviour is unchanged.
Owner
Author
|
TL ACCEPT at Returns Note: PR base is |
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.
Follow-up to #157 (issue #156).
Problem
import_config_dir_vaultcopies secrets from<config_dir>/secrets/vaultinto the home vault, and names already in the home vault win. When the same name holds a different value in both vaults, the old value was ignored silently, so a user who re-ran the wizard in another folder had no hint why a secret they just entered was not used.Change
import_config_dir_vaultnow returns(copied, conflicts).conflictsis the sorted list of names present in both vaults with different values. Values are never returned or logged.main.rslogs one warn per name:Secret `<name>` differs between vaults: using the home vault value, ignoring the vault beside config.toml.Tests
config_dir_vault_secrets_are_copied_without_overwritingnow asserts the differing name is reported on the first and second run, and that a name with the same value in both vaults is not reported.(0, []).cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked: 921 passed.