glideinWMS / glideinwms

The glideinWMS Project
http://tinyurl.com/glideinwms
Apache License 2.0
16 stars 45 forks source link

Workaround for EL7 PyJWT generating bytes instead of str #355

Closed mambelli closed 1 year ago

mambelli commented 1 year ago

There is a bug in older PyJWT versions, like the one in EL7. jwt.encode() is returning bytes instead of str. Here I'm adding a workaround to protect against it and work with both new and older versions of PyJWT

Here is the PyJWT issue: https://github.com/jpadilla/pyjwt/issues/391 This was fixed in PyJWT v2.0.0, https://github.com/jpadilla/pyjwt/pull/513

mambelli commented 1 year ago

To Patch an existing EL7 installation, replace /usr/lib/python3.6/site-packages/glideinwms/lib/token_util.py with the one form this PR, https://raw.githubusercontent.com/mambelli/glideinwms/v310/pyjwt_encode_bug_workaround/lib/token_util.py and restart the Frontend with systemctl restart gwms-frontend