summaryrefslogtreecommitdiff
path: root/dev-python/pyjwt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-02-17 01:16:38 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-02-17 01:16:38 +0000
commit53cba99042fa967e2a93da9f8db806fe2d035543 (patch)
tree9780d3b87dfc6bdebc6b7b7d15af1ecb813c6853 /dev-python/pyjwt
parent71deace00d1a2b091313fe137ab7092418c6f87c (diff)
gentoo resync : 17.02.2020
Diffstat (limited to 'dev-python/pyjwt')
-rw-r--r--dev-python/pyjwt/Manifest2
-rw-r--r--dev-python/pyjwt/files/pyjwt-1.7.1-ecdsa-fix.patch27
-rw-r--r--dev-python/pyjwt/pyjwt-1.7.1-r1.ebuild56
3 files changed, 85 insertions, 0 deletions
diff --git a/dev-python/pyjwt/Manifest b/dev-python/pyjwt/Manifest
index ba2bf3b438a4..bdd99654340a 100644
--- a/dev-python/pyjwt/Manifest
+++ b/dev-python/pyjwt/Manifest
@@ -1,5 +1,7 @@
+AUX pyjwt-1.7.1-ecdsa-fix.patch 1179 BLAKE2B 79fcaf69d6021f04fb624fc36314135c9704a8abeef8eb6872d1f2dc24bcd9372f2372e8022fb24e9db736c9014756805d608415e8893084ca45fbb3e76a8948 SHA512 6fb83a17ebe768a147f6f610c823a11a500cc1828efe8cb12f3623be153574c94abacabb441150ee9d3bcba5762cb2eea73e30b46cc748044842e787172808da
DIST PyJWT-1.5.3.tar.gz 73044 BLAKE2B ae2e3caec52ddd768d573e0398bbc355c6eedca238db9b1808ff1d723b9fdee0845cf119d78e561833fe770e5ec39000905cec43a5e96102865f60e204c72c22 SHA512 b25a9f6a04bd072020fcf00bb559b7560902adb79746fb880432c01fa356748238432f53f6b9a21db50ece3e59ed4c45ca3f48ecec0ca3c4095e6a739a5c150c
DIST PyJWT-1.7.1.tar.gz 41979 BLAKE2B 5604b309838b2dfb2f95e18e291c43703954664aa8acb7439072f002c1c8a1e49ff2c21d907be77a4d2f86e695ec71970d550aad2541252ac85bd7133e300b28 SHA512 70cd38127b6848933992c8b88303725ef71bfb430ad42eb63247e549b0bdab2a194137349d43ab02a1c97212dbc89f447ee3f0c5403dd14632b8b4b6b9235fc4
EBUILD pyjwt-1.5.3.ebuild 1289 BLAKE2B f949371337531c7d6f7ff8a2c06587667d50440442959aaeba7c6897106fd54413475250b6f262d37437f53161636d54ddbecb2ac98b93792d49d3ee266bc86b SHA512 836c48af9bdfd92062efb542d459d9c2fbbc1ddfaae4fd89ea60fdf82572e535c4144c7e4ce17ea39845001ae5b5ff7673c28d68ad6cc779a9f749ca31915020
+EBUILD pyjwt-1.7.1-r1.ebuild 1396 BLAKE2B 551f1b5bf97b36ea379751d98b219f59db7ade4420f4877d40c771cf13296fc65884c989e80d2189aee387c51f65e70b75c4739bb0a3ab286956b782c1c524a4 SHA512 01ee142064afe5d50121f35a031e8466b90c6082aa509b521e2df717ebceafc9e7a8f96f379cfb2b67e357fd7924038aca92ee564a0e9ceba27e43081674a08e
EBUILD pyjwt-1.7.1.ebuild 1313 BLAKE2B c6fb3d75a4af0f3bea0d91aeba245d290f491613b092d4c947a5777df6b2a19517847ec5badfc20d230dcabf24e5c57b068585432c8879461142286eea73ae24 SHA512 b83bdab9905d9a685342c229699ef8e252a77294d1a8f25886adc73e1904c24ba633eec39f79b25945bdd446250c34bd2b4955859a5f5f89500232d649131d40
MISC metadata.xml 374 BLAKE2B 29e7fb2995367400d4f8d836cda63346441ff6008ac4554cd06859827d92924d3c34f2fb9763291766014a364d1e02af1ae6412fb02d316c775c3c0c13dcb22e SHA512 87a019a49c2e355d19148214f8ac7212758f7a36f77e7b959d32df1146c145b764f93707fd7b45a8c5276209a66380c888670181bf78bc4d241d5a7294a032b4
diff --git a/dev-python/pyjwt/files/pyjwt-1.7.1-ecdsa-fix.patch b/dev-python/pyjwt/files/pyjwt-1.7.1-ecdsa-fix.patch
new file mode 100644
index 000000000000..ebd9236c7994
--- /dev/null
+++ b/dev-python/pyjwt/files/pyjwt-1.7.1-ecdsa-fix.patch
@@ -0,0 +1,27 @@
+From 36a3f9bd0cc7029e5150b1931efbd62da975e8b9 Mon Sep 17 00:00:00 2001
+From: StefanBruens <stefan.bruens@rwth-aachen.de>
+Date: Mon, 21 Oct 2019 02:07:19 +0200
+Subject: [PATCH] Catch BadSignatureError raised by ecdsa 0.13.3 on
+ verification errors (#448)
+
+The new ecdsa no longer uses AssertionError when the signature is too long.
+This happens in the test suite, where "123" is appended to the signature.
+
+Fixes #447
+---
+ jwt/contrib/algorithms/py_ecdsa.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/jwt/contrib/algorithms/py_ecdsa.py b/jwt/contrib/algorithms/py_ecdsa.py
+index bf0dea5..f1170a6 100644
+--- a/jwt/contrib/algorithms/py_ecdsa.py
++++ b/jwt/contrib/algorithms/py_ecdsa.py
+@@ -56,5 +56,7 @@ def verify(self, msg, key, sig):
+ try:
+ return key.verify(sig, msg, hashfunc=self.hash_alg,
+ sigdecode=ecdsa.util.sigdecode_string)
+- except AssertionError:
++ # ecdsa <= 0.13.2 raises AssertionError on too long signatures,
++ # ecdsa >= 0.13.3 raises BadSignatureError for verification errors.
++ except (AssertionError, ecdsa.BadSignatureError):
+ return False
diff --git a/dev-python/pyjwt/pyjwt-1.7.1-r1.ebuild b/dev-python/pyjwt/pyjwt-1.7.1-r1.ebuild
new file mode 100644
index 000000000000..1cb2f6e14153
--- /dev/null
+++ b/dev-python/pyjwt/pyjwt-1.7.1-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+
+inherit distutils-r1 eutils
+
+MY_PN="PyJWT"
+DESCRIPTION="JSON Web Token implementation in Python"
+HOMEPAGE="https://github.com/progrium/pyjwt https://pypi.org/project/PyJWT/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+S="${WORKDIR}"/${MY_PN}-${PV}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND=""
+DEPEND="
+ test? (
+ >=dev-python/cryptography-1.4.0[${PYTHON_USEDEP}]
+ )"
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ find . -name '__pycache__' -prune -exec rm -rf {} + || die
+ find . -name '*.pyc' -delete || die
+
+ # enables coverage, we don't need that
+ rm setup.cfg || die
+ # kill tests using pycrypto that break with pycryptodome
+ sed -i -e '/has_pycrypto/s:True:False:' \
+ tests/contrib/test_algorithms.py || die
+
+ local PATCHES=(
+ "${FILESDIR}"/pyjwt-1.7.1-ecdsa-fix.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ pytest -vv || die "Tests fail with ${EPYTHON}"
+}
+
+pkg_postinst() {
+ elog "Available optional features:"
+ optfeature "cryptography" dev-python/cryptography
+ optfeature "flake8" dev-python/flake8{,-import-order}
+
+ ewarn "flake8 feature requires 'pep8-naming' which is not packaged yet"
+}