hello,

update of www/py-jwt from 2.3.0 to 2.6.0 full changelog is here:

https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst

Built, and packaged on amd64 with no issues. However tests
fail quite spectacularly, but this does not seem related to
this update as trying to run tests on 2.3.0 gives the same
failures. I'm not sure but it looks like the issue is with
py-cryptography. Snippet of failure (this repeats):

tests/test_advisory.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jwt/api_jwt.py:168: in decode
    decoded = self.decode_complete(
jwt/api_jwt.py:120: in decode_complete
    decoded = api_jws.decode_complete(
jwt/api_jws.py:202: in decode_complete
    self._verify_signature(signing_input, header, signature, key, algorithms)
jwt/api_jws.py:298: in _verify_signature
    key = alg_obj.prepare_key(key)
jwt/algorithms.py:594: in prepare_key
    key = load_ssh_public_key(key)
/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/serialization/ssh.py:720:
 in load_ssh_public_key
    public_key, rest = kformat.load_public(rest)
/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/serialization/ssh.py:457:
 in load_public
    public_key = ed25519.Ed25519PublicKey.from_public_bytes(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 
'cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey'>
data = 
b'\xf2\xf5#\xda"\xab\xe0|r\xb9&\xb9^\x18V(\x94\x9e\x17K\x8c*w\x86\xfc\xb5l\xd1\xae\x19\xf3K'

    @classmethod
    def from_public_bytes(cls, data: bytes) -> "Ed25519PublicKey":
        from cryptography.hazmat.backends.openssl.backend import backend
    
        if not backend.ed25519_supported():
>           raise UnsupportedAlgorithm(
                "ed25519 is not supported by this version of OpenSSL.",
                _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM,
            )
E           cryptography.exceptions.UnsupportedAlgorithm: ed25519 is not 
supported by this version of OpenSSL.

/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py:22:
 UnsupportedAlgorithm
_______ TestOKPAlgorithms.test_okp_ed25519_should_reject_non_string_key ________

self = <tests.test_algorithms.TestOKPAlgorithms object at 0xb37bb6129d0>

    def test_okp_ed25519_should_reject_non_string_key(self):
        algo = OKPAlgorithm()
    
        with pytest.raises(InvalidKeyError):
            algo.prepare_key(None)
    
        with open(key_path("testkey_ed25519")) as keyfile:
>           algo.prepare_key(keyfile.read())


Consumers are security/py-oauthlib (update in separate email
but works fine), devel/py-buildbot/buildbot (builds, tests
are previously broken), mail/kopano/core which only uses
it for a migration script, and net/synapse (builds but
tests are broken - irrespective of this update).

As far as I can tell the failures only affect tests, however
my only real world use for this is as a dependency via
py-oauthlib to py-discogs-client which works with this
update. If there are any users of buildbot, kopano
and/or synapse which can test this it that would be good.

thanks,

.jh
Index: py-jwt/Makefile
===================================================================
RCS file: /cvs/ports/www/py-jwt/Makefile,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 Makefile
--- py-jwt/Makefile     11 Mar 2022 20:10:47 -0000      1.20
+++ py-jwt/Makefile     8 Nov 2022 20:59:05 -0000
@@ -1,6 +1,6 @@
 COMMENT =      JSON Web Token implementation in Python
 
-MODPY_EGG_VERSION = 2.3.0
+MODPY_EGG_VERSION = 2.6.0
 DISTNAME =     PyJWT-${MODPY_EGG_VERSION}
 PKGNAME =      py-jwt-${MODPY_EGG_VERSION}
 CATEGORIES =   www
@@ -20,7 +20,7 @@ MODPY_PI =    Yes
 MODPY_SETUPTOOLS = Yes
 MODPY_PYTEST = Yes
 
-RUN_DEPENDS =   security/py-cryptography${MODPY_FLAVOR}>=1.4.0
+RUN_DEPENDS =   security/py-cryptography${MODPY_FLAVOR}>=3.4.0
 
 TEST_DEPENDS = devel/py-test-cov${MODPY_FLAVOR} \
                devel/py-test-runner${MODPY_FLAVOR}
Index: py-jwt/distinfo
===================================================================
RCS file: /cvs/ports/www/py-jwt/distinfo,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 distinfo
--- py-jwt/distinfo     7 Dec 2021 10:45:33 -0000       1.10
+++ py-jwt/distinfo     8 Nov 2022 20:59:05 -0000
@@ -1,2 +1,2 @@
-SHA256 (PyJWT-2.3.0.tar.gz) = uIi01W8G9tzXdyEMM05pxze+dHVdPl6e4/5n3Big7kE=
-SIZE (PyJWT-2.3.0.tar.gz) = 62279
+SHA256 (PyJWT-2.6.0.tar.gz) = aShcfjH8RPaKH+swnpSODfUyWdV5KV5s/isXkjKfBf0=
+SIZE (PyJWT-2.6.0.tar.gz) = 72984
Index: py-jwt/pkg/PLIST
===================================================================
RCS file: /cvs/ports/www/py-jwt/pkg/PLIST,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 PLIST
--- py-jwt/pkg/PLIST    11 Mar 2022 20:10:47 -0000      1.6
+++ py-jwt/pkg/PLIST    8 Nov 2022 20:59:05 -0000
@@ -17,14 +17,18 @@ lib/python${MODPY_VERSION}/site-packages
 
lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}api_jwt.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}exceptions.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}help.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}jwk_set_cache.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}jwks_client.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}utils.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/jwt/${MODPY_PYCACHE}warnings.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/jwt/algorithms.py
 lib/python${MODPY_VERSION}/site-packages/jwt/api_jwk.py
 lib/python${MODPY_VERSION}/site-packages/jwt/api_jws.py
 lib/python${MODPY_VERSION}/site-packages/jwt/api_jwt.py
 lib/python${MODPY_VERSION}/site-packages/jwt/exceptions.py
 lib/python${MODPY_VERSION}/site-packages/jwt/help.py
+lib/python${MODPY_VERSION}/site-packages/jwt/jwk_set_cache.py
 lib/python${MODPY_VERSION}/site-packages/jwt/jwks_client.py
 lib/python${MODPY_VERSION}/site-packages/jwt/py.typed
 lib/python${MODPY_VERSION}/site-packages/jwt/utils.py
+lib/python${MODPY_VERSION}/site-packages/jwt/warnings.py

Reply via email to