Skip to content

support decoding and encoding DEFLATE-encoded JWT bodies#666

Closed
Roguelazer wants to merge 3 commits intojpadilla:masterfrom
Roguelazer:deflate
Closed

support decoding and encoding DEFLATE-encoded JWT bodies#666
Roguelazer wants to merge 3 commits intojpadilla:masterfrom
Roguelazer:deflate

Conversation

@Roguelazer
Copy link
Copy Markdown

These are used in the Smart Health Card framework that several regions (including California and Quebec) are using for COVID-19 proofs of vaccination, and are supported by some other JWT libraries, such as jwt-go.

If y'all like this approach, I'm glad to write tests. I could also see putting this logic in api_jws.py.

@tahnok
Copy link
Copy Markdown

tahnok commented Oct 16, 2021

I'd also volunteer to help write some tests. I am also looking at decoding the data in an SHC encoded JWT and at the moment pyjwt cannot be used for this

Overall, change looks solid and straightforward

Copy link
Copy Markdown
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

I think we can add this

@auvipy
Copy link
Copy Markdown
Collaborator

auvipy commented Oct 16, 2021

I'd also volunteer to help write some tests. I am also looking at decoding the data in an SHC encoded JWT and at the moment pyjwt cannot be used for this

Overall, change looks solid and straightforward

you are welcome to do so

@tahnok
Copy link
Copy Markdown

tahnok commented Oct 16, 2021

I added some tests in this commit tahnok@5d15874 if you want to pull it into your branch @Roguelazer

@akx
Copy link
Copy Markdown
Contributor

akx commented Mar 30, 2022

Hmm – I'd be a little wary against adding a non-spec feature like this. In fact, the golang library PR @Roguelazer merged was actually not merged due to the same concern: dgrijalva/jwt-go#102 (comment)

I think the better approach would be to refactor payload decoding (lines 98..104 in the preimage) to a separate function that can be easily augmented in a subclass.

@jpadilla
Copy link
Copy Markdown
Owner

Closing this one for now, same reason as #753.

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.

6 participants