fix(drive): warn on a broken settings.json in lease resolve - #1720
Merged
Merged
Conversation
LeaseFlags::resolve used Settings::load().unwrap_or_default(), so a settings.json that failed to parse silently reverted lease.biometrics_only to device-owner authentication (password fallback allowed) and dropped backup_dir/default_expiry_minutes, with nothing on stderr/logs. Now warns via tracing::warn! before falling back to defaults, matching docs/STYLE_GUIDE.md's STYLE-0018 silent-error-suppression guidance and the existing tracing::warn! precedent in src/drive/lease/settings.rs. Fixes #1695
CoverageTotal: 97.27% ⚪ 0 pp vs Comparing
🔇 5 ignored region(s), 0 tolerated region(s)
Patch coveragePatch: 93.02% (40/43 new lines covered)
Uncovered new lines (3)
|
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.
Summary
drive leasecommand with a brokensettings.jsonnow warns instead of silently falling back to defaults — closing a gap where a broken config could silently downgrade the auth policy to the less-secure direction with no indication anything was wrong.Test plan
cargo buildcargo test --lib cli::drive::lease::(includes the new regression test)cargo clippy --all-targets -- -D warnings