From 8fb68c9d36e00d358088706befd201e5a571c2a306f1b71dea092855ec3792d4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 1 May 2021 22:27:49 +0000 Subject: [PATCH] Accepting request 889634 from home:bnavigator:branches:devel:languages:python - Update to 1.4.2 * no release notes * released on PyPI but not tagged in git repository - Add py39-tobytes.patch for Python 3.9 compat - Not actively maintained anymore. Just packaged because it is a BuildRequirement of other packages * python-oic * python-django-oidc-provider OBS-URL: https://build.opensuse.org/request/show/889634 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyjwkest?expand=0&rev=3 --- py39-tobytes.patch | 16 ++++++++++++++++ pyjwkest-1.4.0.tar.gz | 3 --- pyjwkest-1.4.2-gh.tar.gz | 3 +++ python-pyjwkest.changes | 12 ++++++++++++ python-pyjwkest.spec | 30 ++++++++++++++++++------------ 5 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 py39-tobytes.patch delete mode 100644 pyjwkest-1.4.0.tar.gz create mode 100644 pyjwkest-1.4.2-gh.tar.gz diff --git a/py39-tobytes.patch b/py39-tobytes.patch new file mode 100644 index 0000000..f3e3965 --- /dev/null +++ b/py39-tobytes.patch @@ -0,0 +1,16 @@ +Index: pyjwkest-9ed11b406911dde70b281b2473a976ec88afd1a9/tests/test_4_jwe.py +=================================================================== +--- pyjwkest-9ed11b406911dde70b281b2473a976ec88afd1a9.orig/tests/test_4_jwe.py ++++ pyjwkest-9ed11b406911dde70b281b2473a976ec88afd1a9/tests/test_4_jwe.py +@@ -25,7 +25,10 @@ __author__ = 'rohe0002' + + + def intarr2bytes(arr): +- return array.array('B', arr).tostring() ++ if sys.version_info[0] >= 3: ++ return array.array('B', arr).tobytes() ++ else: ++ return array.array('B', arr).tostring() + + + def bytes2intarr(bts): diff --git a/pyjwkest-1.4.0.tar.gz b/pyjwkest-1.4.0.tar.gz deleted file mode 100644 index 1e75622..0000000 --- a/pyjwkest-1.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da7c2a0fa21bde050525a50b4b6ae7b265fc2319d598e44e84a4430961bed420 -size 91254 diff --git a/pyjwkest-1.4.2-gh.tar.gz b/pyjwkest-1.4.2-gh.tar.gz new file mode 100644 index 0000000..56a85a1 --- /dev/null +++ b/pyjwkest-1.4.2-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2323990fe33aebf0e47300f2ce77da001d87445f6387912b3e5758b11e1ad860 +size 94026 diff --git a/python-pyjwkest.changes b/python-pyjwkest.changes index 5bf0c9a..180f91f 100644 --- a/python-pyjwkest.changes +++ b/python-pyjwkest.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Apr 30 18:38:03 UTC 2021 - Ben Greiner + +- Update to 1.4.2 + * no release notes + * released on PyPI but not tagged in git repository +- Add py39-tobytes.patch for Python 3.9 compat +- Not actively maintained anymore. Just packaged because it is + a BuildRequirement of other packages + * python-oic + * python-django-oidc-provider + ------------------------------------------------------------------- Thu Apr 11 12:41:06 UTC 2019 - John Vandenberg diff --git a/python-pyjwkest.spec b/python-pyjwkest.spec index 5281bfa..a9b3ba5 100644 --- a/python-pyjwkest.spec +++ b/python-pyjwkest.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyjwkest # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define commit 9ed11b406911dde70b281b2473a976ec88afd1a9 Name: python-pyjwkest -Version: 1.4.0 +Version: 1.4.2 Release: 0 Summary: Python implementation of JWT, JWE, JWS and JWK License: Apache-2.0 Group: Development/Languages/Python -URL: https://github.com/rohe/pyjwkest -Source: https://github.com/rohe/pyjwkest/archive/v1.4.0.tar.gz#/pyjwkest-%{version}.tar.gz +URL: https://github.com//IdentityPython/pyjwkest +#Source: https://files.pythonhosted.org/packages/source/p/pyjwkest/pyjwkest-%%{version}.tar.gz +# 1.4.2, released on PyPI is untagged on GitHub, but we need the tests +Source: https://github.com/IdentityPython/pyjwkest/archive/%{commit}.tar.gz#/pyjwkest-%{version}-gh.tar.gz +# PATCH-FIX-OPENSUSE (upstream is unmaintained) -- py 3.9 compatibility. Works for all of py3. +Patch0: py39-tobytes.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -33,27 +38,28 @@ Requires: python-pycryptodomex Requires: python-requests Requires: python-six Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch BuildRequires: %{python_module future} BuildRequires: %{python_module pycryptodomex} +BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module requests} BuildRequires: %{python_module six} -BuildRequires: %{python_module pytest-runner} %python_subpackages %description Python implementation of JWT, JWE, JWS and JWK. +(JSON web signarure) + +Note: This library is NOT actively maintained anymore. %prep -%setup -q -n pyjwkest-%{version} +%autosetup -p1 -n pyjwkest-%{commit} # https://github.com/rohe/pyjwkest/pull/1 chmod a+x script/gen_symkey.py sed -i '1 {s:^#!:#!/usr/bin/env python:}' script/gen_symkey.py sed -i '1 {/^#!/d}' src/jwkest/*.py -# This interferes with pytest collection, and is unused. -rm debug/A256KW/jwe_test.py %build %python_build @@ -75,7 +81,7 @@ mv %{buildroot}%{_bindir}/peek.py %{buildroot}%{_bindir}/jwpeek.py %python_clone -a %{buildroot}%{_bindir}/jwkutil.py %check -%python_exec setup.py pytest +%pytest %post %python_install_alternative gen_symkey.py jwdecrypt.py jwenc.py jwpeek.py jwk_create.py jwk_export.py jwkutil.py @@ -84,9 +90,9 @@ mv %{buildroot}%{_bindir}/peek.py %{buildroot}%{_bindir}/jwpeek.py %python_uninstall_alternative gen_symkey.py jwdecrypt.py jwenc.py jwpeek.py jwk_create.py jwk_export.py jwkutil.py %files %{python_files} -%license LICENSE.txt +%license LICENSE %doc README.rst -%{python_sitelib}/pyjwkest* +%{python_sitelib}/pyjwkest-%{version}*-info %{python_sitelib}/jwkest %python_alternative %{_bindir}/gen_symkey.py %python_alternative %{_bindir}/jwdecrypt.py