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 JWTPayload(dict) for extended verification #322

Closed
wants to merge 1 commit into from

Commits on May 14, 2020

  1. Add JWTPayload(dict) for extended verification

    The JWTPayload class allows PyJWT.decode() to expose header, signature,
    signing_input, and compute_hash_digest() (based on header) without
    changing the pyjwt API in a breaking way.
    Merely making this info accessible to the client without specifying an
    additional verification callback scheme is simpler for everyone.
    
    Include doc on why JWTPayload is a good idea in a module docstring,
    since it's a little unusual to subclass `dict`. The intent is to make
    the JWT payload change as little as possible while still making it easy
    to add more verification after the fact.
    
    Add a simple test for `JWTPayload.compute_hash_digest()` and a test
    for compute_hash_digest with cryptography (which is compared against a
    manual hashlib usage).
    
    Closes jpadilla#314, jpadilla#295
    sirosen committed May 14, 2020
    Configuration menu
    Copy the full SHA
    e3222ad View commit details
    Browse the repository at this point in the history