pypomes-jwt 0.4.6__tar.gz → 0.4.7__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 pypomes-jwt might be problematic. Click here for more details.
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/PKG-INFO +1 -1
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/pyproject.toml +1 -1
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/src/pypomes_jwt/jwt_data.py +17 -4
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/src/pypomes_jwt/jwt_pomes.py +3 -0
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/.gitignore +0 -0
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/LICENSE +0 -0
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/README.md +0 -0
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/src/__init__.py +0 -0
- {pypomes_jwt-0.4.6 → pypomes_jwt-0.4.7}/src/pypomes_jwt/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: A collection of Python pomes, penyeach (JWT module)
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-JWT
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-JWT/issues
|
|
@@ -68,6 +68,9 @@ class JwtData:
|
|
|
68
68
|
"""
|
|
69
69
|
Add to storage the parameters needed to obtain and validate JWT tokens.
|
|
70
70
|
|
|
71
|
+
Protocol indication in *service_url* (typically *http:* or *https:*), is disregarded, to guarantee
|
|
72
|
+
that processing herein will not be affected by in-transit protocol changes.
|
|
73
|
+
|
|
71
74
|
Presently, the *refresh_max_age* data is not relevant, as the authorization parameters in *claims*
|
|
72
75
|
(typically, an acess-key/secret-key pair), have been previously validated elsewhere.
|
|
73
76
|
This situation might change in the future.
|
|
@@ -84,7 +87,7 @@ class JwtData:
|
|
|
84
87
|
:param local_provider: whether 'service_url' is a local endpoint
|
|
85
88
|
:param logger: optional logger
|
|
86
89
|
"""
|
|
87
|
-
# obtain the item in
|
|
90
|
+
# obtain the item in storage
|
|
88
91
|
item_data: dict[str, dict[str, Any]] = self.retrieve_access_data(service_url=service_url,
|
|
89
92
|
logger=logger)
|
|
90
93
|
if not item_data:
|
|
@@ -143,7 +146,7 @@ class JwtData:
|
|
|
143
146
|
with self.access_lock:
|
|
144
147
|
self.access_data.remove(item_data)
|
|
145
148
|
if logger:
|
|
146
|
-
logger.debug(f"Removed JWT data for
|
|
149
|
+
logger.debug(f"Removed JWT data for '{service_url}'")
|
|
147
150
|
elif logger:
|
|
148
151
|
logger.warning(f"No JWT data found for '{service_url}'")
|
|
149
152
|
|
|
@@ -280,7 +283,10 @@ class JwtData:
|
|
|
280
283
|
service_url: str,
|
|
281
284
|
logger: Logger = None) -> dict[str, dict[str, Any]]:
|
|
282
285
|
"""
|
|
283
|
-
Retrieve and return the access data in storage corresponding to
|
|
286
|
+
Retrieve and return the access data in storage corresponding to *service_url*.
|
|
287
|
+
|
|
288
|
+
Protocol indication in *service_url* (typically *http:* or *https:*), is disregarded, to guarantee
|
|
289
|
+
that processing herein will not be affected by in-transit protocol changes.
|
|
284
290
|
|
|
285
291
|
:param service_url: the reference URL for obtaining JWT tokens
|
|
286
292
|
:param logger: optional logger
|
|
@@ -289,9 +295,16 @@ class JwtData:
|
|
|
289
295
|
# initialize the return variable
|
|
290
296
|
result: dict[str, dict[str, Any]] | None = None
|
|
291
297
|
|
|
298
|
+
# disregard protocol
|
|
299
|
+
if service_url.find("://") > 0:
|
|
300
|
+
service_url = service_url[service_url.index("://")+3:]
|
|
301
|
+
|
|
292
302
|
with self.access_lock:
|
|
293
303
|
for item_data in self.access_data:
|
|
294
|
-
|
|
304
|
+
item_url: str = item_data.get("control-data").get("service-url")
|
|
305
|
+
if item_url.find("://") > 0:
|
|
306
|
+
item_url = item_url[item_url.index("://")+3:]
|
|
307
|
+
if service_url == item_url:
|
|
295
308
|
result = item_data
|
|
296
309
|
break
|
|
297
310
|
if logger:
|
|
@@ -44,6 +44,9 @@ def jwt_set_service_access(service_url: str,
|
|
|
44
44
|
"""
|
|
45
45
|
Set the data needed to obtain JWT tokens from *service_url*.
|
|
46
46
|
|
|
47
|
+
Protocol indication in *service_url* (typically *http:* or *https:*), is disregarded, to guarantee
|
|
48
|
+
that processing herein will not be affected by in-transit protocol changes.
|
|
49
|
+
|
|
47
50
|
:param service_url: the reference URL
|
|
48
51
|
:param claims: the JWT claimset, as key-value pairs
|
|
49
52
|
:param algorithm: the authentication type
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|