diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-07-12 08:41:54 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-07-12 08:41:54 +0100 |
commit | 4df3bf9762850b34cd1ead5c80374d1a0fc3362e (patch) | |
tree | 3080c5cb7ad17abcb63776a9f21c4947845546a6 /www-apps/roundup | |
parent | 814f4cf860e299a046b649eaee5463427984c09c (diff) |
gentoo resync : 12.07.2021
Diffstat (limited to 'www-apps/roundup')
-rw-r--r-- | www-apps/roundup/Manifest | 3 | ||||
-rw-r--r-- | www-apps/roundup/files/roundup-2.0.0-test-pyjwt.patch | 91 | ||||
-rw-r--r-- | www-apps/roundup/roundup-2.0.0.ebuild | 3 |
3 files changed, 96 insertions, 1 deletions
diff --git a/www-apps/roundup/Manifest b/www-apps/roundup/Manifest index f74ccfb61a06..bda27fc1ddb2 100644 --- a/www-apps/roundup/Manifest +++ b/www-apps/roundup/Manifest @@ -1,3 +1,4 @@ +AUX roundup-2.0.0-test-pyjwt.patch 4712 BLAKE2B e1b8dcd070feec087f5d00eb8f71d5eaa389d543d03b671d327a9e3b23458aa97cf5681fc62be128b852a305e71efae27f12277aba61ac8ffc6d4ba2dbd23f8b SHA512 0d8d34f79b55fe48b5df9b6f1894eda22d68e0faf53b1b1ece5d7904ba98a761b4f28d9bed1e28be2342341b144d72182097d0afc9cc9884923e106b06c34e72 DIST roundup-2.0.0.tar.gz 3495554 BLAKE2B 98b7cbfebe969411282ddf6b4bd7b94ea1efb7b1d929daf44ae5f30dc23c05cb327d0f4653b22a5594f7b198dd16a172c45568a15f8704b187cd4c355455ca9c SHA512 5adb0d96be260e70fe098fd37af27bd0abee38cb8fde4ba2e130d2caac7f64af86a3b0ab09de931a693dca8bfbe15c68444db343ccf718d9d25576d49c6d6cbf -EBUILD roundup-2.0.0.ebuild 1490 BLAKE2B d2159d6b6a905dd3dea3d32660a3d9fd7e75ee4e58c2a7d83783780897fcf029e87ea14adf7b646d5d78fcca34826b2d92432da47cb93ab3147ec11acdaebc5f SHA512 e737399d5c181f8849c9a5e3b52c7d72993df65572a1ece70b9046a539c787980af1fb37b913285924d9814444433e9db14b633fa814a81f7653e1d6eaf03eb2 +EBUILD roundup-2.0.0.ebuild 1539 BLAKE2B ef3818b72421e7e2a1dd162c4459df6a4d2ba7cfab2b9d6bc044ab112609a8f66da7dd64f2bd990b64b0fc3ae380f2d083856a7b93c70cc40458e4cd09ffdc44 SHA512 2f7b448c154a87449af51f67b4b2be181b1c1934101f50600b0ef538bd0e16c9e72da4bbb0ebea4708e42f3a1f9064091f5e1db6a6685c67ad74d125e92599f6 MISC metadata.xml 858 BLAKE2B d2ad7fcf833fd7fd31c463c737d9b5c811c7dbe042afc8a39ba03dedbbb1f5b9eda13a1a14a6c39108005f4a4d7a5f7e4ebf31de7023338354dad1f919978b0f SHA512 fa11616c74a9a43934c356ad56e39ed99610bebca86a34c936400d9b59aab39336213a2df3248c7fdb8886ac6c9bfd4918322ea8d99111dd8a21014d5b549db7 diff --git a/www-apps/roundup/files/roundup-2.0.0-test-pyjwt.patch b/www-apps/roundup/files/roundup-2.0.0-test-pyjwt.patch new file mode 100644 index 000000000000..74f71dab57ff --- /dev/null +++ b/www-apps/roundup/files/roundup-2.0.0-test-pyjwt.patch @@ -0,0 +1,91 @@ +# HG changeset patch +# User John Rouillard <rouilj@ieee.org> +# Date 1609557405 18000 +# Fri Jan 01 22:16:45 2021 -0500 +# Node ID a2fbd3592322379f0c54a75446d2a282c6f40075 +# Parent e3edb0b44d94df71f46094cdda9ed4e51e6c1de4 +pyjwt 2.00 changed return type of jwt.encode from byte to str + +Need to change tests to only do b2s conversion if using version before +2.0.0. Note 2.0.0 drops support for python 2. Also it is not +installed for the python 3.4 ci test by pip install. + +diff --git a/test/rest_common.py b/test/rest_common.py +--- a/test/rest_common.py ++++ b/test/rest_common.py +@@ -68,6 +68,8 @@ class TestCase(): + url_pfx = 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/' + + def setUp(self): ++ from packaging import version ++ + self.dirname = '_test_rest' + # set up and open a tracker + # Set optimize=True as code under test (Client.main()::determine_user) +@@ -162,50 +164,58 @@ class TestCase(): + 'iat': now_ts, + 'exp': plus1min_ts, + } ++ ++ # in version 2.0.0 and newer jwt.encode returns string ++ # not bytestring. So we have to skip b2s conversion + ++ if version.parse(jwt.__version__) >= version.parse('2.0.0'): ++ tostr = lambda x: x ++ else: ++ tostr = b2s ++ + self.jwt = {} + self.claim = {} + # generate invalid claim with expired timestamp + self.claim['expired'] = copy(claim) + self.claim['expired']['exp'] = expired_ts +- self.jwt['expired'] = b2s(jwt.encode(self.claim['expired'], secret, ++ self.jwt['expired'] = tostr(jwt.encode(self.claim['expired'], secret, + algorithm='HS256')) + + # generate valid claim with user role + self.claim['user'] = copy(claim) + self.claim['user']['exp'] = plus1min_ts +- self.jwt['user'] = b2s(jwt.encode(self.claim['user'], secret, ++ self.jwt['user'] = tostr(jwt.encode(self.claim['user'], secret, + algorithm='HS256')) + # generate invalid claim bad issuer + self.claim['badiss'] = copy(claim) + self.claim['badiss']['iss'] = "http://someissuer/bugs" +- self.jwt['badiss'] = b2s(jwt.encode(self.claim['badiss'], secret, ++ self.jwt['badiss'] = tostr(jwt.encode(self.claim['badiss'], secret, + algorithm='HS256')) + # generate invalid claim bad aud(ience) + self.claim['badaud'] = copy(claim) + self.claim['badaud']['aud'] = "http://someaudience/bugs" +- self.jwt['badaud'] = b2s(jwt.encode(self.claim['badaud'], secret, ++ self.jwt['badaud'] = tostr(jwt.encode(self.claim['badaud'], secret, + algorithm='HS256')) + # generate invalid claim bad sub(ject) + self.claim['badsub'] = copy(claim) + self.claim['badsub']['sub'] = str("99") +- self.jwt['badsub'] = b2s(jwt.encode(self.claim['badsub'], secret, ++ self.jwt['badsub'] = tostr(jwt.encode(self.claim['badsub'], secret, + algorithm='HS256')) + # generate invalid claim bad roles + self.claim['badroles'] = copy(claim) + self.claim['badroles']['roles'] = [ "badrole1", "badrole2" ] +- self.jwt['badroles'] = b2s(jwt.encode(self.claim['badroles'], secret, ++ self.jwt['badroles'] = tostr(jwt.encode(self.claim['badroles'], secret, + algorithm='HS256')) + # generate valid claim with limited user:email role + self.claim['user:email'] = copy(claim) + self.claim['user:email']['roles'] = [ "user:email" ] +- self.jwt['user:email'] = b2s(jwt.encode(self.claim['user:email'], secret, ++ self.jwt['user:email'] = tostr(jwt.encode(self.claim['user:email'], secret, + algorithm='HS256')) + + # generate valid claim with limited user:emailnorest role + self.claim['user:emailnorest'] = copy(claim) + self.claim['user:emailnorest']['roles'] = [ "user:emailnorest" ] +- self.jwt['user:emailnorest'] = b2s(jwt.encode(self.claim['user:emailnorest'], secret, ++ self.jwt['user:emailnorest'] = tostr(jwt.encode(self.claim['user:emailnorest'], secret, + algorithm='HS256')) + + self.db.tx_Source = 'web' diff --git a/www-apps/roundup/roundup-2.0.0.ebuild b/www-apps/roundup/roundup-2.0.0.ebuild index 335af1be6ac9..a66c26f72f10 100644 --- a/www-apps/roundup/roundup-2.0.0.ebuild +++ b/www-apps/roundup/roundup-2.0.0.ebuild @@ -36,6 +36,9 @@ RDEPEND="${DEPEND} )" DOCS="CHANGES.txt doc/*.txt" +PATCHES=( + "${FILESDIR}/${P}-test-pyjwt.patch" +) distutils_enable_tests pytest |