sumo-wrapper-python 1.0.18__tar.gz → 1.0.20__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.
Potentially problematic release.
This version of sumo-wrapper-python might be problematic. Click here for more details.
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/PKG-INFO +1 -1
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_auth_provider.py +24 -13
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_version.py +2 -2
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/sumo_client.py +10 -7
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/PKG-INFO +1 -1
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.github/workflows/build_docs.yaml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.github/workflows/linting.yml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.github/workflows/publish_release.yml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.github/workflows/pytest.yml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.gitignore +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.pre-commit-config.yaml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.readthedocs.yaml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/CONTRIBUTING.md +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/LICENSE +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/README.md +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/SECURITY.md +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/Makefile +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/_static/equinor-logo.png +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/_static/equinor-logo2.jpg +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/_static/equinor_logo.jpg +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/_static/equinor_logo_only.jpg +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/_templates/layout.html +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/api.rst +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/conf.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/index.rst +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/make.bat +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/docs/sumo-wrapper-python.rst +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/pyproject.toml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/setup.cfg +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/__init__.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/__init__.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_blob_client.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_decorators.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_logging.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_retry_strategy.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/config.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/login.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/SOURCES.txt +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/dependency_links.txt +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/entry_points.txt +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/requires.txt +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo_wrapper_python.egg-info/top_level.txt +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/tests/conftest.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/tests/test_sumo_thin_client.py +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/tests/testdata/case.yml +0 -0
- {sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/tests/testdata/surface.yml +0 -0
{sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/src/sumo/wrapper/_auth_provider.py
RENAMED
|
@@ -29,6 +29,23 @@ def _maybe_nfs_exception(exception):
|
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def get_token_dir():
|
|
33
|
+
return os.path.join(os.path.expanduser("~"), ".sumo")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_token_path(resource_id, suffix, case_uuid=None):
|
|
37
|
+
if case_uuid is not None:
|
|
38
|
+
return os.path.join(
|
|
39
|
+
os.path.expanduser("~"),
|
|
40
|
+
".sumo",
|
|
41
|
+
str(resource_id) + "+" + str(case_uuid) + suffix,
|
|
42
|
+
)
|
|
43
|
+
else:
|
|
44
|
+
return os.path.join(
|
|
45
|
+
os.path.expanduser("~"), ".sumo", str(resource_id) + suffix
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
32
49
|
class AuthProvider:
|
|
33
50
|
def __init__(self, resource_id):
|
|
34
51
|
self._resource_id = resource_id
|
|
@@ -67,11 +84,18 @@ class AuthProvider:
|
|
|
67
84
|
return {"Authorization": "Bearer " + token}
|
|
68
85
|
|
|
69
86
|
def store_shared_access_key_for_case(self, case_uuid, token):
|
|
87
|
+
os.makedirs(get_token_dir(), mode=0o700, exist_ok=True)
|
|
70
88
|
with open(
|
|
71
89
|
get_token_path(self._resource_id, ".sharedkey", case_uuid),
|
|
72
90
|
"w",
|
|
73
91
|
) as f:
|
|
74
92
|
f.write(token)
|
|
93
|
+
protect_token_cache(self._resource_id, ".sharedkey", case_uuid)
|
|
94
|
+
|
|
95
|
+
def has_case_token(self, case_uuid):
|
|
96
|
+
return os.path.exists(
|
|
97
|
+
get_token_path(self._resource_id, ".sharedkey", case_uuid)
|
|
98
|
+
)
|
|
75
99
|
|
|
76
100
|
pass
|
|
77
101
|
|
|
@@ -118,19 +142,6 @@ class AuthProviderRefreshToken(AuthProvider):
|
|
|
118
142
|
pass
|
|
119
143
|
|
|
120
144
|
|
|
121
|
-
def get_token_path(resource_id, suffix, case_uuid=None):
|
|
122
|
-
if case_uuid is not None:
|
|
123
|
-
return os.path.join(
|
|
124
|
-
os.path.expanduser("~"),
|
|
125
|
-
".sumo",
|
|
126
|
-
str(resource_id) + "+" + str(case_uuid) + suffix,
|
|
127
|
-
)
|
|
128
|
-
else:
|
|
129
|
-
return os.path.join(
|
|
130
|
-
os.path.expanduser("~"), ".sumo", str(resource_id) + suffix
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
|
|
134
145
|
@tn.retry(
|
|
135
146
|
retry=tn.retry_if_exception(_maybe_nfs_exception),
|
|
136
147
|
stop=tn.stop_after_attempt(6),
|
|
@@ -424,13 +424,16 @@ class SumoClient:
|
|
|
424
424
|
def client_for_case(self, case_uuid):
|
|
425
425
|
"""Instantiate and return new SumoClient for accessing the
|
|
426
426
|
case identified by *case_uuid*."""
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
427
|
+
if self.auth.has_case_token(case_uuid):
|
|
428
|
+
return SumoClient(
|
|
429
|
+
env=self.env,
|
|
430
|
+
verbosity=self._verbosity,
|
|
431
|
+
retry_strategy=self._retry_strategy,
|
|
432
|
+
timeout=self._timeout,
|
|
433
|
+
case_uuid=case_uuid,
|
|
434
|
+
)
|
|
435
|
+
else:
|
|
436
|
+
return self
|
|
434
437
|
|
|
435
438
|
@raise_for_status_async
|
|
436
439
|
async def get_async(self, path: str, params: dict = None):
|
|
File without changes
|
|
File without changes
|
{sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/.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
|
|
File without changes
|
{sumo_wrapper_python-1.0.18 → sumo_wrapper_python-1.0.20}/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.18 → sumo_wrapper_python-1.0.20}/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
|