jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
5.08k stars 679 forks source link

adding support for compressed payloads #753

Closed danieltmiles closed 2 years ago

danieltmiles commented 2 years ago

A bunch of US states are using Smart Health Cards (https://smarthealth.cards/en/) to issue digital proof of COVID-19 vaccination. The QR code on the certificate decodes to a JWT token, but it has a compressed payload and upstream PyJWT didn't handle it. So I offer this contribution.

This patch introduces a dependency on zlib but as an old, salty python developer who hasn't lifted myself out of the requirements.txt era, I haven't figured out how this project is managing dependencies. Can you help me understand what needs to be done?

jpadilla commented 2 years ago

Is this something we can instead provide some kind of hook for? This seems kinda specific use case that I’d think would better live outside this lib

jpadilla commented 2 years ago

@auvipy let's revert this please. I'd like to think it through a bit more. Sorry for the last minute comments.

auvipy commented 2 years ago

I am going to revert this for now, but supporting compressed payload may be a future endeaviour

akx commented 2 years ago

It's strange that this was merged when https://github.com/jpadilla/pyjwt/pull/666 is pending to do the same thing.

jpadilla commented 2 years ago

@akx we just reverted this in #761 while we figure a better way to allow third parties to implement things like this.

russoale commented 1 year ago

@jpadilla Gan you give some update if there is already a way for some sort of callback that can be passed to do this? Would be open to help

akx commented 1 year ago

@russoale Maybe https://github.com/jpadilla/pyjwt/pull/829 might get merged. :)