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 support for pyjwt leeway #790

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Commits on Jul 19, 2023

  1. Add support for pyjwt leeway

    On the surface, this may look like a potentially incompatible change
    because we remove `leeway` from the passed `jwt_params`. However,
    those are passed to `options` and `leeway` isn't a supported value
    there for pyjwt, so the change is in effect strictly additive.
    
    pyjwt source has a comment indicating that `leeway` might be added to
    `options` in the future (it would make sense), along with values we
    control like `audience`. For the time being, however, this makes sense
    as a mechanism for passing `leeway` for JWT handling in the SDK.
    
    Because the same `leeway` is used for the `iat`, `nbf`, and `exp`
    claims, we can check that `leeway` is passed correctly by using it to
    make a very old `exp` claim pass validation in our tests.
    
    A new default is set for `leeway` of 0.5s internally. This is not part
    of the `decode_id_token` docs -- kept as an implementation detail --
    but it makes the default behavior slightly more tolerant of clock
    drift. As such, this part of the change is documented as a fix in the
    changelog, whereas the rest is an addition.
    sirosen committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    951020f View commit details
    Browse the repository at this point in the history