Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-apns2 for openSUSE:Factory checked in at 2021-03-03 18:33:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-apns2 (Old) and /work/SRC/openSUSE:Factory/.python-apns2.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-apns2" Wed Mar 3 18:33:49 2021 rev:2 rq:875540 version:0.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-apns2/python-apns2.changes 2020-06-30 21:56:23.814746186 +0200 +++ /work/SRC/openSUSE:Factory/.python-apns2.new.2378/python-apns2.changes 2021-03-03 18:34:07.995345366 +0100 @@ -1,0 +2,21 @@ +Fri Feb 26 15:42:17 UTC 2021 - John Vandenberg <jay...@gmail.com> + +- Add pr_122.patch to fix builds + +------------------------------------------------------------------- +Fri Feb 26 14:26:56 UTC 2021 - Matej Cepl <mc...@suse.com> + +- Update to 0.7.2: + - Updated sandbox URL (#93) + - Do not ignore custom JWT lifetime when using TokenCredentials + (#108) + - Fix determination of push type for empty notifications with + badge 0 (#109) + - LICENSE and test/eckey.pem included in source tarball (#110 + #111) + - Changing DEFAULT_TOKEN_LIFETIME from 3600 to 2700 (#113) + - Added upper constraint for PyJWT (<2.0.0) +- Removed additional sources as they were included in the + upstream tarball. + +------------------------------------------------------------------- Old: ---- LICENSE apns2-0.7.1.tar.gz eckey.pem New: ---- apns2-0.7.2.tar.gz pr_122.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-apns2.spec ++++++ --- /var/tmp/diff_new_pack.oZaktu/_old 2021-03-03 18:34:08.791345943 +0100 +++ /var/tmp/diff_new_pack.oZaktu/_new 2021-03-03 18:34:08.791345943 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-apns2 # -# Copyright (c) 2020 SUSE LLC +# 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 @@ -19,19 +19,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-apns2 -Version: 0.7.1 +Version: 0.7.2 Release: 0 Summary: Python library for the HTTP/2 Apple Push Notification Service License: MIT Group: Development/Languages/Python URL: https://github.com/Pr0Ger/PyAPNs2 Source0: https://files.pythonhosted.org/packages/source/a/apns2/apns2-%{version}.tar.gz -# LICENSE gh#Pr0Ger/PyAPNs2#110 mc...@suse.com -# Missing LICENSE file -Source1: https://raw.githubusercontent.com/Pr0Ger/PyAPNs2/master/LICENSE -# eckey.pem gh#Pr0Ger/PyAPNs2#111 mc...@suse.com -# Unpackaged file breaks test_token_expiration test -Source2: https://raw.githubusercontent.com/Pr0Ger/PyAPNs2/master/test/eckey.pem +# Subset of https://github.com/Pr0Ger/PyAPNs2/pull/122.patch +Patch0: pr_122.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -53,9 +49,7 @@ via HTTP/2 protocol. %prep -%setup -q -n apns2-%{version} -cp %{SOURCE1} . -cp %{SOURCE2} test/ +%autosetup -p1 -n apns2-%{version} %build %python_build ++++++ apns2-0.7.1.tar.gz -> apns2-0.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/LICENSE new/apns2-0.7.2/LICENSE --- old/apns2-0.7.1/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/apns2-0.7.2/LICENSE 2020-12-30 22:51:08.000000000 +0100 @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Sergey Petrov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/MANIFEST.in new/apns2-0.7.2/MANIFEST.in --- old/apns2-0.7.1/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 +++ new/apns2-0.7.2/MANIFEST.in 2020-12-30 22:51:08.000000000 +0100 @@ -0,0 +1,2 @@ +include LICENSE +include test/eckey.pem diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/PKG-INFO new/apns2-0.7.2/PKG-INFO --- old/apns2-0.7.1/PKG-INFO 2019-10-08 21:52:53.000000000 +0200 +++ new/apns2-0.7.2/PKG-INFO 2020-12-30 22:51:23.346016400 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: apns2 -Version: 0.7.1 +Version: 0.7.2 Summary: A python library for interacting with the Apple Push Notification Service via HTTP/2 protocol Home-page: https://github.com/Pr0Ger/PyAPNs2 Author: Sergey Petrov @@ -13,5 +13,6 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Libraries Provides-Extra: tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/README.md new/apns2-0.7.2/README.md --- old/apns2-0.7.1/README.md 2019-10-08 21:52:49.000000000 +0200 +++ new/apns2-0.7.2/README.md 2020-12-30 22:51:08.000000000 +0100 @@ -8,9 +8,9 @@ ## Installation -Either download the source from GitHub or use easy_install: +Either download the source from GitHub or use pip: - $ easy_install apns2 + $ pip install apns2 ## Sample usage @@ -35,7 +35,7 @@ auth_key_path = 'path/to/auth_key' auth_key_id = 'app_auth_key_id' team_id = 'app_team_id' -token_credentials = TokensCredentials(auth_key_path=auth_key_path, auth_key_id=auth_key_id, team_id=team_id) +token_credentials = TokenCredentials(auth_key_path=auth_key_path, auth_key_id=auth_key_id, team_id=team_id) client = APNsClient(credentials=token_credentials, use_sandbox=False) client.send_notification_batch(notifications=notifications, topic=topic) ``` @@ -64,8 +64,8 @@ You can use `tox` for running tests with all supported Python versions: ```shell -pyenv install 3.5.6; pyenv install 3.6.7; pyenv install 3.7.1 -pyenv local 3.7.1 3.6.7 3.5.6 +pyenv install 3.5.6; pyenv install 3.6.7; pyenv install 3.7.1; pyenv install 3.8.0 +pyenv local 3.8.0 3.7.1 3.6.7 3.5.6 pip install tox tox ``` @@ -82,4 +82,4 @@ See [LICENSE](LICENSE) file for the complete license details. -[a1]:https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ +[a1]:https://developer.apple.com/documentation/usernotifications?language=objc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/apns2/client.py new/apns2-0.7.2/apns2/client.py --- old/apns2-0.7.1/apns2/client.py 2019-10-08 21:52:49.000000000 +0200 +++ new/apns2-0.7.2/apns2/client.py 2020-12-30 22:51:08.000000000 +0100 @@ -40,7 +40,7 @@ class APNsClient(object): - SANDBOX_SERVER = 'api.sandbox.push.apple.com' + SANDBOX_SERVER = 'api.development.push.apple.com' LIVE_SERVER = 'api.push.apple.com' DEFAULT_PORT = 443 @@ -117,7 +117,11 @@ inferred_push_type = NotificationType.Complication.value elif topic.endswith('.pushkit.fileprovider'): inferred_push_type = NotificationType.FileProvider.value - elif any([notification.alert, notification.badge, notification.sound]): + elif any([ + notification.alert is not None, + notification.badge is not None, + notification.sound is not None, + ]): inferred_push_type = NotificationType.Alert.value else: inferred_push_type = NotificationType.Background.value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/apns2/credentials.py new/apns2-0.7.2/apns2/credentials.py --- old/apns2-0.7.1/apns2/credentials.py 2019-10-08 21:52:49.000000000 +0200 +++ new/apns2-0.7.2/apns2/credentials.py 2020-12-30 22:51:08.000000000 +0100 @@ -9,7 +9,7 @@ if TYPE_CHECKING: from hyper.ssl_compat import SSLContext # type: ignore -DEFAULT_TOKEN_LIFETIME = 3600 +DEFAULT_TOKEN_LIFETIME = 2700 DEFAULT_TOKEN_ENCRYPTION_ALGORITHM = 'ES256' @@ -60,9 +60,8 @@ token = self._get_or_create_topic_token() return 'bearer %s' % token - @staticmethod - def _is_expired_token(issue_date: float) -> bool: - return time.time() > issue_date + DEFAULT_TOKEN_LIFETIME + def _is_expired_token(self, issue_date: float) -> bool: + return time.time() > issue_date + self.__token_lifetime @staticmethod def _get_signing_key(key_path: str) -> str: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/apns2.egg-info/PKG-INFO new/apns2-0.7.2/apns2.egg-info/PKG-INFO --- old/apns2-0.7.1/apns2.egg-info/PKG-INFO 2019-10-08 21:52:52.000000000 +0200 +++ new/apns2-0.7.2/apns2.egg-info/PKG-INFO 2020-12-30 22:51:23.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: apns2 -Version: 0.7.1 +Version: 0.7.2 Summary: A python library for interacting with the Apple Push Notification Service via HTTP/2 protocol Home-page: https://github.com/Pr0Ger/PyAPNs2 Author: Sergey Petrov @@ -13,5 +13,6 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Libraries Provides-Extra: tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/apns2.egg-info/SOURCES.txt new/apns2-0.7.2/apns2.egg-info/SOURCES.txt --- old/apns2-0.7.1/apns2.egg-info/SOURCES.txt 2019-10-08 21:52:52.000000000 +0200 +++ new/apns2-0.7.2/apns2.egg-info/SOURCES.txt 2020-12-30 22:51:23.000000000 +0100 @@ -1,3 +1,5 @@ +LICENSE +MANIFEST.in README.md setup.cfg setup.py @@ -11,6 +13,7 @@ apns2.egg-info/dependency_links.txt apns2.egg-info/requires.txt apns2.egg-info/top_level.txt +test/eckey.pem test/test_client.py test/test_credentials.py test/test_payload.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/apns2.egg-info/requires.txt new/apns2-0.7.2/apns2.egg-info/requires.txt --- old/apns2-0.7.1/apns2.egg-info/requires.txt 2019-10-08 21:52:52.000000000 +0200 +++ new/apns2-0.7.2/apns2.egg-info/requires.txt 2020-12-30 22:51:23.000000000 +0100 @@ -1,5 +1,5 @@ hyper>=0.7 -PyJWT>=1.4.0 +PyJWT<2.0.0,>=1.4.0 cryptography>=1.7.2 [tests] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/setup.py new/apns2-0.7.2/setup.py --- old/apns2-0.7.1/setup.py 2019-10-08 21:52:49.000000000 +0200 +++ new/apns2-0.7.2/setup.py 2020-12-30 22:51:08.000000000 +0100 @@ -4,11 +4,11 @@ setup( name='apns2', - version='0.7.1', + version='0.7.2', packages=['apns2'], install_requires=[ 'hyper>=0.7', - 'PyJWT>=1.4.0', + 'PyJWT>=1.4.0,<2.0.0', 'cryptography>=1.7.2', ], extras_require={ @@ -27,6 +27,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Software Development :: Libraries', ], description='A python library for interacting with the Apple Push Notification Service via HTTP/2 protocol' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/test/eckey.pem new/apns2-0.7.2/test/eckey.pem --- old/apns2-0.7.1/test/eckey.pem 1970-01-01 01:00:00.000000000 +0100 +++ new/apns2-0.7.2/test/eckey.pem 2020-12-30 22:51:08.000000000 +0100 @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BggqhkjOPQMBBw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIM0scFXkVBBc7d8DSL9rfFB1PvET/dWQa9eWfxpgaqaBoAoGCCqGSM49 +AwEHoUQDQgAEnVxQ41VKMN6uSsSYCCdOUhCms+HT2VpUhFGML5SzYGoodKtRD/6J +YI9Rxq1lPGHMwECSaPtPf9kVDCUM6UHvhA== +-----END EC PRIVATE KEY----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/apns2-0.7.1/test/test_credentials.py new/apns2-0.7.2/test/test_credentials.py --- old/apns2-0.7.1/test/test_credentials.py 2019-10-08 21:52:49.000000000 +0200 +++ new/apns2-0.7.2/test/test_credentials.py 2020-12-30 22:51:08.000000000 +0100 @@ -14,17 +14,24 @@ @pytest.fixture def token_credentials(): - return TokenCredentials('test/eckey.pem', '1QBCDJ9RST', '3Z24IP123A') + return TokenCredentials( + auth_key_path='test/eckey.pem', + auth_key_id='1QBCDJ9RST', + team_id='3Z24IP123A', + token_lifetime=30, # seconds + ) def test_token_expiration(token_credentials): - # As long as the token lifetime hasn't elapsed, this should work. To - # be really careful, we should check how much time has elapsed to - # know if it fail. But, either way, we'd have to come up with a good - # lifetime for future tests... + with freeze_time('2012-01-14 12:00:00'): + header1 = token_credentials.get_authorization_header(TOPIC) - with freeze_time('2012-01-14'): - expiring_header = token_credentials.get_authorization_header(TOPIC) + # 20 seconds later, before expiration, same JWT + with freeze_time('2012-01-14 12:00:20'): + header2 = token_credentials.get_authorization_header(TOPIC) + assert header1 == header2 - new_header = token_credentials.get_authorization_header(TOPIC) - assert expiring_header != new_header + # 35 seconds later, after expiration, new JWT + with freeze_time('2012-01-14 12:00:40'): + header3 = token_credentials.get_authorization_header(TOPIC) + assert header3 != header1 ++++++ pr_122.patch ++++++ >From 62793cb0eff591bb091d349177a7028bf6f0f6bc Mon Sep 17 00:00:00 2001 From: Joffrey MANDER <joffrey.man...@polyconseil.fr> Date: Tue, 29 Dec 2020 10:41:56 +0100 Subject: [PATCH 1/2] apns2.credentials: since version 2.0.0 pyJWT encode method return str --- apns2/credentials.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apns2/credentials.py b/apns2/credentials.py index 655893f..028093e 100644 --- a/apns2/credentials.py +++ b/apns2/credentials.py @@ -87,7 +87,7 @@ def _get_or_create_topic_token(self) -> str: } jwt_token = jwt.encode(token_dict, self.__auth_key, algorithm=self.__encryption_algorithm, - headers=headers).decode('ascii') + headers=headers) # Cache JWT token for later use. One JWT token per connection. # https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns diff --git a/setup.py b/setup.py index 2d8fafb..5837572 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ packages=['apns2'], install_requires=[ 'hyper>=0.7', - 'PyJWT>=1.4.0,<2.0.0', + 'PyJWT>=2.0.0', 'cryptography>=1.7.2', ], extras_require={