Repository navigation
fix(doctor): derive the sensitive files line from the built-in rule list - #721
Merged
Merged
Conversation
The line listed the six original names and drifted after #683. The matcher and the report now share one list, with a test for each.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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
The
sensitive filesline oftole doctoris now built from the same rule list the matcher uses.Why
The line still listed the six original names (
.env*,*.pem,id_*,.npmrc,.netrc,*.key) after #683 added more (*.env,credentials,.pgpass,kubeconfig,*.tfvars, and others), so the report understated what is withheld.Changes
tole-core/src/sensitive.rs:BUILTIN_NAME_GLOBSandBUILTIN_PATH_RULES(.docker/config.json) are the single source;is_sensitive_namematches against the glob list (same behaviour, now data-driven) andbuiltin_rules()exposes the list.tole-cli/src/doctor.rs: the line joinsbuiltin_rules().the_builtin_rules_are_what_the_matcher_uses(every glob matches a name made from it, every known sensitive name is covered by a listed rule) andthe_sensitive_files_line_lists_every_builtin_rule(the doctor line lists every rule).Testing
cargo fmt,clippy --workspace --all-targets --all-features -D warnings,cargo test --workspacetwice,tole-core --no-default-features: green. Not changed: theread_file_rawtool description inread_file.rsstill names the six original patterns; it is part of the tool spec wire size, so it is left for its own change.Refs #683