summaryrefslogtreecommitdiff
path: root/dev-python/pyjwt
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/pyjwt
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/pyjwt')
-rw-r--r--dev-python/pyjwt/Manifest1
-rw-r--r--dev-python/pyjwt/files/pyjwt-1.7.1-ecdsa-fix.patch27
-rw-r--r--dev-python/pyjwt/metadata.xml14
-rw-r--r--dev-python/pyjwt/pyjwt-1.7.1-r1.ebuild56
4 files changed, 98 insertions, 0 deletions
diff --git a/dev-python/pyjwt/Manifest b/dev-python/pyjwt/Manifest
new file mode 100644
index 000000000000..83d65a7066a8
--- /dev/null
+++ b/dev-python/pyjwt/Manifest
@@ -0,0 +1 @@
+DIST PyJWT-1.7.1.tar.gz 41979 BLAKE2B 5604b309838b2dfb2f95e18e291c43703954664aa8acb7439072f002c1c8a1e49ff2c21d907be77a4d2f86e695ec71970d550aad2541252ac85bd7133e300b28 SHA512 70cd38127b6848933992c8b88303725ef71bfb430ad42eb63247e549b0bdab2a194137349d43ab02a1c97212dbc89f447ee3f0c5403dd14632b8b4b6b9235fc4
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/metadata.xml b/dev-python/pyjwt/metadata.xml
new file mode 100644
index 000000000000..58a89fcf955e
--- /dev/null
+++ b/dev-python/pyjwt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">PyJWT</remote-id>
+ <remote-id type="github">progrium/pyjwt</remote-id>
+ <remote-id type="cpe">cpe:/a:pyjwt_project:pyjwt</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
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..27e9e851d9e3
--- /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=( python3_{6..9} 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 ~ppc64 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"
+}