sumo-wrapper-python 1.0.23__tar.gz → 1.0.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.gitignore +1 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/PKG-INFO +1 -1
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_auth_provider.py +29 -30
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_version.py +2 -2
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/sumo_client.py +4 -3
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/PKG-INFO +1 -1
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.github/workflows/build_docs.yaml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.github/workflows/linting.yml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.github/workflows/publish_release.yml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.github/workflows/pytest.yml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.pre-commit-config.yaml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.readthedocs.yaml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/CONTRIBUTING.md +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/LICENSE +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/README.md +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/SECURITY.md +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/Makefile +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_static/equinor-logo.png +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_static/equinor-logo2.jpg +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_static/equinor_logo.jpg +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_static/equinor_logo_only.jpg +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_templates/layout.html +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/api.rst +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/conf.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/index.rst +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/make.bat +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/sumo-wrapper-python.rst +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/pyproject.toml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/setup.cfg +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/__init__.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/__init__.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_blob_client.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_decorators.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_logging.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_retry_strategy.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/config.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/login.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/SOURCES.txt +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/dependency_links.txt +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/entry_points.txt +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/requires.txt +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo_wrapper_python.egg-info/top_level.txt +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/tests/conftest.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/tests/test_sumo_thin_client.py +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/tests/testdata/case.yml +0 -0
- {sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/tests/testdata/surface.yml +0 -0
{sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_auth_provider.py
RENAMED
|
@@ -4,7 +4,7 @@ import os
|
|
|
4
4
|
import stat
|
|
5
5
|
import sys
|
|
6
6
|
import time
|
|
7
|
-
from datetime import datetime, timedelta
|
|
7
|
+
from datetime import datetime, timedelta, timezone
|
|
8
8
|
from urllib.parse import parse_qs
|
|
9
9
|
|
|
10
10
|
import jwt
|
|
@@ -91,35 +91,6 @@ class AuthProvider:
|
|
|
91
91
|
protect_token_cache(self._resource_id, ".sharedkey", case_uuid)
|
|
92
92
|
return
|
|
93
93
|
|
|
94
|
-
def cleanup_shared_keys(self):
|
|
95
|
-
tokendir = get_token_dir()
|
|
96
|
-
if not os.path.exists(tokendir):
|
|
97
|
-
return
|
|
98
|
-
for f in os.listdir(tokendir):
|
|
99
|
-
ff = os.path.join(tokendir, f)
|
|
100
|
-
if os.path.isfile(ff):
|
|
101
|
-
(name, ext) = os.path.splitext(ff)
|
|
102
|
-
if ext.lower() == ".sharedkey":
|
|
103
|
-
try:
|
|
104
|
-
with open(ff, "r") as file:
|
|
105
|
-
token = file.read()
|
|
106
|
-
pq = parse_qs(token)
|
|
107
|
-
se = pq["se"][0]
|
|
108
|
-
end = datetime.strptime(
|
|
109
|
-
se, "%Y-%m-%dT%H:%M:%S.%fZ"
|
|
110
|
-
)
|
|
111
|
-
now = datetime.utcnow()
|
|
112
|
-
if now > end:
|
|
113
|
-
os.unlink(ff)
|
|
114
|
-
pass
|
|
115
|
-
pass
|
|
116
|
-
pass
|
|
117
|
-
except Exception:
|
|
118
|
-
pass
|
|
119
|
-
pass
|
|
120
|
-
pass
|
|
121
|
-
return
|
|
122
|
-
|
|
123
94
|
def has_case_token(self, case_uuid):
|
|
124
95
|
return os.path.exists(
|
|
125
96
|
get_token_path(self._resource_id, ".sharedkey", case_uuid)
|
|
@@ -487,3 +458,31 @@ def get_auth_provider(
|
|
|
487
458
|
]
|
|
488
459
|
):
|
|
489
460
|
return AuthProviderManaged(resource_id)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def cleanup_shared_keys():
|
|
464
|
+
tokendir = get_token_dir()
|
|
465
|
+
if not os.path.exists(tokendir):
|
|
466
|
+
return
|
|
467
|
+
for f in os.listdir(tokendir):
|
|
468
|
+
ff = os.path.join(tokendir, f)
|
|
469
|
+
if os.path.isfile(ff):
|
|
470
|
+
(name, ext) = os.path.splitext(ff)
|
|
471
|
+
if ext.lower() == ".sharedkey":
|
|
472
|
+
try:
|
|
473
|
+
with open(ff, "r") as file:
|
|
474
|
+
token = file.read()
|
|
475
|
+
pq = parse_qs(token)
|
|
476
|
+
se = pq["se"][0]
|
|
477
|
+
end = datetime.strptime(se, "%Y-%m-%dT%H:%M:%S.%fZ")
|
|
478
|
+
now = datetime.now(timezone.utc)
|
|
479
|
+
if now.timestamp() > end.timestamp():
|
|
480
|
+
os.unlink(ff)
|
|
481
|
+
pass
|
|
482
|
+
pass
|
|
483
|
+
pass
|
|
484
|
+
except Exception:
|
|
485
|
+
pass
|
|
486
|
+
pass
|
|
487
|
+
pass
|
|
488
|
+
return
|
|
@@ -6,7 +6,7 @@ import re
|
|
|
6
6
|
import httpx
|
|
7
7
|
import jwt
|
|
8
8
|
|
|
9
|
-
from ._auth_provider import get_auth_provider
|
|
9
|
+
from ._auth_provider import cleanup_shared_keys, get_auth_provider
|
|
10
10
|
from ._blob_client import BlobClient
|
|
11
11
|
from ._decorators import (
|
|
12
12
|
raise_for_status,
|
|
@@ -94,6 +94,9 @@ class SumoClient:
|
|
|
94
94
|
refresh_token = token
|
|
95
95
|
pass
|
|
96
96
|
pass
|
|
97
|
+
|
|
98
|
+
cleanup_shared_keys()
|
|
99
|
+
|
|
97
100
|
self.auth = get_auth_provider(
|
|
98
101
|
client_id=APP_REGISTRATION[env]["CLIENT_ID"],
|
|
99
102
|
authority=f"{AUTHORITY_HOST_URI}/{TENANT_ID}",
|
|
@@ -105,8 +108,6 @@ class SumoClient:
|
|
|
105
108
|
case_uuid=case_uuid,
|
|
106
109
|
)
|
|
107
110
|
|
|
108
|
-
self.auth.cleanup_shared_keys()
|
|
109
|
-
|
|
110
111
|
if env == "localhost":
|
|
111
112
|
self.base_url = "http://localhost:8084/api/v1"
|
|
112
113
|
else:
|
|
File without changes
|
|
File without changes
|
{sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/.github/workflows/publish_release.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/docs/_static/equinor_logo_only.jpg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sumo_wrapper_python-1.0.23 → sumo_wrapper_python-1.0.24}/src/sumo/wrapper/_retry_strategy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|