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

add max_clock_skew to HTTPMessageVerifier #11

Merged
merged 1 commit into from
Feb 20, 2024
Merged

add max_clock_skew to HTTPMessageVerifier #11

merged 1 commit into from
Feb 20, 2024

Conversation

achille-roussel
Copy link
Contributor

This PR adds a max_clock_skew attribute to HTTPMessageVerifier so the verification of timestamps is more tolerant to deltas between clocks of the signer and verifier, which are common when

In #10 (comment), we suggested a 30s default. However, in my experience, this is much higher than common clock deltas, which should usually be less than a few hundred milliseconds in healthy systems. I suggest starting with a 5s default, which should be good enough for most use cases. It will be easy to raise the default if needed in the future; however, lowering it could cause damage to production systems that may have been relying on it.

The tolerance applies to all timestamp verification: creation, expiration, and max age. The original issue I reported only mentioned problems with verifying creation time, but I tried to keep it simple and have all time checks behave the same instead of making special cases.

@kislyuk, let me know if you feel strongly about any of those points, and I'll make the change.

Fixes #10

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
Copy link
Member

@kislyuk kislyuk left a comment

Choose a reason for hiding this comment

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

LGTM, don't worry about the test failures, the linters are out of date. I'll fix them and do a release soon.

@kislyuk kislyuk merged commit c6bbddc into pyauth:main Feb 20, 2024
2 of 6 checks passed
@achille-roussel
Copy link
Contributor Author

Thanks for the quick resolution, looking forward to the next release!

@achille-roussel achille-roussel deleted the max-clock-skew branch February 20, 2024 04:30
@kislyuk
Copy link
Member

kislyuk commented Feb 22, 2024

Released in v0.5.0.

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.

Verification of the created field is too strict
2 participants