Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Timezone awareness #53

Merged
merged 8 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0",
"pyOpenSSL",
"filelock>=3.0.12",
'pyyaml>=5.1.2'
Expand Down
38 changes: 1 addition & 37 deletions src/oidcmsg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Roland Hedberg"
__version__ = "1.5.1"
__version__ = "1.5.2"

import os
from typing import Dict
Expand Down Expand Up @@ -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)
3 changes: 2 additions & 1 deletion src/oidcmsg/time_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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$")
Expand Down Expand Up @@ -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


Expand Down