pypomes-jwt 0.4.6__py3-none-any.whl → 0.4.7__py3-none-any.whl

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/jwt_data.py CHANGED
@@ -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 s"torage
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 '{service_url}'")
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 the given parameters.
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
- if service_url == item_data.get("control-data").get("service-url"):
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:
pypomes_jwt/jwt_pomes.py CHANGED
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pypomes_jwt
3
- Version: 0.4.6
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
@@ -0,0 +1,7 @@
1
+ pypomes_jwt/__init__.py,sha256=wIbTPmnxyGFuSdawdyglNn7GVKEvPZ_57MF9HBbWclc,952
2
+ pypomes_jwt/jwt_data.py,sha256=g8wnWYI7bueCIuK67eW2Uy21ALYk5RbLigUHwljjzt4,17496
3
+ pypomes_jwt/jwt_pomes.py,sha256=z8T28KRL09mk3wg3weU3F7SBE6pRapB6T9zmlq9Rv1U,10538
4
+ pypomes_jwt-0.4.7.dist-info/METADATA,sha256=OyqPFEIyfKvw4FtnawyNzwx81vLITmcArlS3Y8AF8VU,687
5
+ pypomes_jwt-0.4.7.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
6
+ pypomes_jwt-0.4.7.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
+ pypomes_jwt-0.4.7.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- pypomes_jwt/__init__.py,sha256=wIbTPmnxyGFuSdawdyglNn7GVKEvPZ_57MF9HBbWclc,952
2
- pypomes_jwt/jwt_data.py,sha256=HZGZiCoaGI7yYSiv5iotA-adMYC2ZUCqOlf49O0MrEg,16819
3
- pypomes_jwt/jwt_pomes.py,sha256=CTMbpBwHXpvKjHD7qqWKQwh1mtcCMvBDlefyKMlPAM0,10351
4
- pypomes_jwt-0.4.6.dist-info/METADATA,sha256=MF5c1q6pGRs6Af3ANWh36gK4r5erXSy1rqdj8bOmJxI,687
5
- pypomes_jwt-0.4.6.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
6
- pypomes_jwt-0.4.6.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
- pypomes_jwt-0.4.6.dist-info/RECORD,,