Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disallow requesting API version dates in the future #129

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Jan 21, 2022

Respond 400 when a version date is requested from the future.

@cmars cmars requested a review from a team as a code owner January 21, 2022 18:58
versionware/validator.go Outdated Show resolved Hide resolved
@cmars cmars force-pushed the fix/disallow-future-version branch from 835d5f1 to a8d6378 Compare January 21, 2022 19:52
Copy link
Contributor

@genslein genslein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly a nitpick: I think I'm still not sure why this isn't just a private member function of the Validator struct to begin with instead of exposing it. I don't think a user would want to change the definition of Today. Not blocking the PR on this

@cmars
Copy link
Contributor Author

cmars commented Jan 21, 2022

Only good reason I can think of is fixing the clock in tests -- so I won't expose Today as a config option, I'll just make it patchable in this package's tests.

Respond 400 when a version date is requested from the future.
@cmars cmars force-pushed the fix/disallow-future-version branch from a8d6378 to d4319e3 Compare January 21, 2022 23:17
@cmars cmars merged commit 5743bd3 into snyk:main Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants