Repository navigation
Refuse out-of-range compression levels and drop chrono from common - #249
Merged
Merged
Conversation
Nothing in common uses chrono. Removing it takes chrono, iana-time-zone and their platform crates out of Cargo.lock. Fixes #237
A policy with a Zstd level outside -5..=22, or an LZ4 level outside 1..=16, is now refused with a PolicyError naming the level and the range. The compressor used to clamp it with a warning while the capsule kept the level it was given. The compressor's clamp now reads the same ranges from common. Fixes #236
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.
Two fixes in
common.Refuse out-of-range compression levels (#236).
Policy::validatenow refuses an LZ4 level outside 1 to 16 and a Zstd level outside -5 to 22, withPolicyError::CompressionLevelOutOfRangenaming the level and the range. Those are the rangescompression::adjusted_levelclamps to, now read fromcommon::policy::LZ4_LEVELSandZSTD_LEVELSso the two can't drift. The clamp stays for any policy that skips validation.spacectl create --policy-filewith!Zstd { level: 99 }fails withinvalid policy file level.yamlbefore anything is written.Drop chrono from common (#237). Nothing in
commonused it. Cargo.lock loses chrono, iana-time-zone, android_system_properties, core-foundation-sys and the windows-core family. No other crate depends on chrono.cargo deny checkandcargo auditpass.Tests:
compression_levels_must_be_in_the_codecs_range: both ends of each range pass, levels past them fail, the message names the range, and every preset passes. Fails with the check disabled.policy_files_refuse_unknown_and_unsupported_settingsin spacectl gains a level 99 case.cargo clippy --workspace --all-targets --locked -- -D warningsis clean.CHANGELOG updated.
Fixes #236
Fixes #237