This repository was archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Add middleware for optional strict CLI version checking #3564
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## main #3564 +/- ##
==========================================
- Coverage 39.03% 39.01% -0.03%
==========================================
Files 302 302
Lines 36924 36954 +30
==========================================
+ Hits 14415 14417 +2
- Misses 22509 22537 +28
|
chkeita
reviewed
Oct 11, 2023
chkeita
reviewed
Oct 11, 2023
mgreisen
reviewed
Oct 11, 2023
chkeita
reviewed
Oct 12, 2023
chkeita
approved these changes
Oct 12, 2023
c0c3e1a to
a359b06
Compare
tevoinea
reviewed
Oct 12, 2023
tevoinea
reviewed
Oct 12, 2023
tevoinea
suggested changes
Oct 12, 2023
Member
tevoinea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semver parsing of dev deploys is blocking this PR
Contributor
Author
Changed version parsing to use the Semver library and included versions with metadata and prerelease components to the unit tests. |
tevoinea
approved these changes
Oct 12, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 of the Pull Request
Adds middleware to the ApiService that checks for two headers:
cli-versionandstrict-versionIf both headers are present and the
strict-versionis set to true, then the middleware will compare the supplied version with the service version and immediately send back a 400 response to requests with out of date versions.On the CLI end, this feature is opted into by setting the
ONEFUZZ_STRICT_VERSIONINGenvironment variable to true (case insensitive).PR Checklist
Info on Pull Request
What does this include?
Validation Steps Performed
Added unit tests for the following cases:
strict-version!= truestrict-version== true(Both valid and invalid values are tested for each case, where applicable)