From 4e792984e29f281889783837c2afeeb70dfd5286 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Tue, 16 Nov 2021 15:44:37 +0100 Subject: [PATCH 1/6] CryptoJWT version 1.6.0 doesn't exit yet. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f9d55d8..c463c73 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ def run_tests(self): "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries :: Python Modules"], install_requires=[ - "cryptojwt>=1.6.0", + "cryptojwt>=1.5.2", "pyOpenSSL", "filelock>=3.0.12", 'pyyaml>=5.1.2' From b63cf62bbd64d33cfd3ec4718588bd1ffd2ecfb7 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Tue, 16 Nov 2021 15:47:12 +0100 Subject: [PATCH 2/6] Updated version. --- src/oidcmsg/__init__.py | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/src/oidcmsg/__init__.py b/src/oidcmsg/__init__.py index 724b7a7..c122148 100644 --- a/src/oidcmsg/__init__.py +++ b/src/oidcmsg/__init__.py @@ -1,5 +1,5 @@ __author__ = "Roland Hedberg" -__version__ = "1.5.1" +__version__ = "1.5.2" import os from typing import Dict @@ -32,39 +32,3 @@ def proper_path(path): path += "/" return path - - -# def add_base_path(conf: Dict[str, str], item_paths: dict, base_path: str): -# """ -# This is for adding a base path to path specified in a configuration -# -# :param conf: Configuration -# :param item_paths: The relative item path -# :param base_path: An absolute path to add to the relative -# """ -# for section, items in item_paths.items(): -# if section == "": -# part = conf -# else: -# part = conf.get(section) -# -# if part: -# if isinstance(items, list): -# for attr in items: -# _path = part.get(attr) -# if _path: -# if _path.startswith("/"): -# continue -# elif _path == "": -# part[attr] = "./" + _path -# else: -# part[attr] = os.path.join(base_path, _path) -# elif items is None: -# if part.startswith("/"): -# continue -# elif part == "": -# conf[section] = "./" -# else: -# conf[section] = os.path.join(base_path, part) -# else: # Assume items is dictionary like -# add_base_path(part, items, base_path) From 3b89449dc34e2e6bee10ce34c95728a2eb297bf4 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Wed, 17 Nov 2021 11:12:40 +0100 Subject: [PATCH 3/6] fix: utcnow timestamp --- src/oidcmsg/time_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/oidcmsg/time_util.py b/src/oidcmsg/time_util.py index 8991bd7..6fc6bd6 100644 --- a/src/oidcmsg/time_util.py +++ b/src/oidcmsg/time_util.py @@ -26,6 +26,7 @@ import time from datetime import datetime from datetime import timedelta +from datetime import timezone TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" TIME_FORMAT_WITH_FRAGMENT = re.compile("^(\d{4,4}-\d{2,2}-\d{2,2}T\d{2,2}:\d{2,2}:\d{2,2})\.\d*Z$") @@ -351,7 +352,7 @@ def later_than(after, before): def utc_time_sans_frac(): - now_timestampt = int(datetime.utcnow().timestamp()) + now_timestampt = int(datetime.now(timezone.utc).timestamp()) return now_timestampt From df5651297c388638a81a9bc94a87cd85f8100b46 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Wed, 17 Nov 2021 11:52:38 +0100 Subject: [PATCH 4/6] fix: cryptojwt up to 1.6.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c463c73..7f3abbc 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ def run_tests(self): "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Libraries :: Python Modules"], install_requires=[ - "cryptojwt>=1.5.2", + "cryptojwt==1.6.0", "pyOpenSSL", "filelock>=3.0.12", 'pyyaml>=5.1.2' From 4dc5eec6b03217dfbe8a93a6e9dd308195f71679 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Wed, 17 Nov 2021 12:02:38 +0100 Subject: [PATCH 5/6] fix: time_utils now are timezone aware and compatible with naive datetimes --- src/oidcmsg/time_util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/oidcmsg/time_util.py b/src/oidcmsg/time_util.py index 6fc6bd6..db514c8 100644 --- a/src/oidcmsg/time_util.py +++ b/src/oidcmsg/time_util.py @@ -182,7 +182,8 @@ def time_in_a_while(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0 :return: datetime instance using UTC time """ delta = timedelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks) - return datetime.utcnow() + delta + res = datetime.now(timezone.utc) + delta + return res.replace(tzinfo=None) def time_a_while_ago( @@ -201,7 +202,8 @@ def time_a_while_ago( :return: datetime instance using UTC time """ delta = timedelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks) - return datetime.utcnow() - delta + res = datetime.now(timezone.utc) - delta + return res.replace(tzinfo=None) def in_a_while( From 40ae4c38c31c7649e6c9edd392f4f2f7c367af58 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Wed, 17 Nov 2021 12:03:52 +0100 Subject: [PATCH 6/6] v1.5.3 --- src/oidcmsg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oidcmsg/__init__.py b/src/oidcmsg/__init__.py index c122148..49f34d0 100644 --- a/src/oidcmsg/__init__.py +++ b/src/oidcmsg/__init__.py @@ -1,5 +1,5 @@ __author__ = "Roland Hedberg" -__version__ = "1.5.2" +__version__ = "1.5.3" import os from typing import Dict