pypomes-jwt 1.1.4__py3-none-any.whl → 1.1.5__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/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- from .jwt_configuration import (
1
+ from .jwt_config import (
2
2
  JwtConfig, JwtDbConfig
3
3
  )
4
4
  from .jwt_pomes import (
pypomes_jwt/jwt_pomes.py CHANGED
@@ -10,7 +10,7 @@ from pypomes_db import (
10
10
  )
11
11
  from typing import Any
12
12
 
13
- from .jwt_configuration import JwtConfig, JwtDbConfig
13
+ from .jwt_config import JwtConfig, JwtDbConfig
14
14
  from .jwt_registry import JwtRegistry
15
15
 
16
16
  # the JWT registry
@@ -511,8 +511,8 @@ def jwt_get_claims(errors: list[str] | None,
511
511
  """
512
512
  Retrieve and return the claims set of a JWT *token*.
513
513
 
514
- Any well-constructed JWT token may be provided in *token*, as this operation is not restricted to
515
- locally issued tokens. Note that neither the token's signature nor its expiration is verified.
514
+ Any well-constructed JWT token may be provided in *token*, as this operation is not restricted
515
+ to locally issued tokens. Note that neither the token's signature nor its expiration is verified.
516
516
 
517
517
  Structure of the returned data, for locally issued tokens:
518
518
  {
@@ -12,7 +12,7 @@ from pypomes_db import (
12
12
  from threading import Lock
13
13
  from typing import Any
14
14
 
15
- from .jwt_configuration import JwtConfig, JwtDbConfig
15
+ from .jwt_config import JwtConfig, JwtDbConfig
16
16
 
17
17
 
18
18
  class JwtRegistry:
@@ -205,14 +205,8 @@ class JwtRegistry:
205
205
  current_claims["iat"] = just_now
206
206
  if grace_interval:
207
207
  current_claims["nbf"] = just_now + grace_interval
208
- current_claims["valid-from"] = datetime.fromtimestamp(timestamp=current_claims["nbf"],
209
- tz=timezone.utc).isoformat()
210
- else:
211
- current_claims["valid-from"] = datetime.fromtimestamp(timestamp=current_claims["iat"],
212
- tz=timezone.utc).isoformat()
213
208
  current_claims["exp"] = just_now + duration
214
- current_claims["valid-until"] = datetime.fromtimestamp(timestamp=current_claims["exp"],
215
- tz=timezone.utc).isoformat()
209
+
216
210
  # may raise an exception
217
211
  return jwt.encode(payload=current_claims,
218
212
  key=JwtConfig.ENCODING_KEY.value,
@@ -265,15 +259,9 @@ class JwtRegistry:
265
259
  grace_interval = account_data.get("grace-interval")
266
260
  if grace_interval:
267
261
  current_claims["nbf"] = just_now + grace_interval
268
- current_claims["valid-from"] = datetime.fromtimestamp(timestamp=current_claims["nbf"],
269
- tz=timezone.utc).isoformat()
270
- else:
271
- current_claims["valid-from"] = datetime.fromtimestamp(timestamp=current_claims["iat"],
272
- tz=timezone.utc).isoformat()
262
+
273
263
  # issue a candidate refresh token first, and persist it
274
264
  current_claims["exp"] = just_now + account_data.get("refresh-max-age")
275
- current_claims["valid-until"] = datetime.fromtimestamp(timestamp=current_claims["exp"],
276
- tz=timezone.utc).isoformat()
277
265
  # may raise an exception
278
266
  refresh_token: str = jwt.encode(payload=current_claims,
279
267
  key=JwtConfig.ENCODING_KEY.value,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_jwt
3
- Version: 1.1.4
3
+ Version: 1.1.5
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
@@ -12,5 +12,5 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.12
13
13
  Requires-Dist: cryptography>=44.0.2
14
14
  Requires-Dist: pyjwt>=2.10.1
15
- Requires-Dist: pypomes-core>=2.0.3
15
+ Requires-Dist: pypomes-core>=2.0.4
16
16
  Requires-Dist: pypomes-db>=2.1.1
@@ -0,0 +1,8 @@
1
+ pypomes_jwt/__init__.py,sha256=NZzjWKnhjxNuoE32V6soKo9sG5ypmt25V0mBAh3rAIs,793
2
+ pypomes_jwt/jwt_config.py,sha256=mtihd58_O00FuFXcNBKsabftG6UHu3Cj24i6cZXoskc,3096
3
+ pypomes_jwt/jwt_pomes.py,sha256=5B5xYA6Z3zJvYwYTZoqD1sH1mraSwdYQVKEvVx2fCSY,23517
4
+ pypomes_jwt/jwt_registry.py,sha256=gMnximiWagh7OkoXEM6msvdXdrXIqosolbyajTIbhTs,22372
5
+ pypomes_jwt-1.1.5.dist-info/METADATA,sha256=tzzNQQ4bebsCN_N7qgDkuoI0D82IMKCnNsubQn_Vw_k,632
6
+ pypomes_jwt-1.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ pypomes_jwt-1.1.5.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
8
+ pypomes_jwt-1.1.5.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- pypomes_jwt/__init__.py,sha256=g4tjg7gt5_vwiHM_6-T6Ji4XYJ5py9RuzGmF2Z-qlXI,800
2
- pypomes_jwt/jwt_configuration.py,sha256=mtihd58_O00FuFXcNBKsabftG6UHu3Cj24i6cZXoskc,3096
3
- pypomes_jwt/jwt_pomes.py,sha256=oix-QLxno663wioj5W13zJahzzlQqTmtolkLqPFtKfI,23524
4
- pypomes_jwt/jwt_registry.py,sha256=8M4Ixhf3FQedqWS6icpJVe-7Z9KMd9qc9BjECDTZ_tU,23597
5
- pypomes_jwt-1.1.4.dist-info/METADATA,sha256=h4iHBGBfwx-3FFHkHFEOKvg58aFxfiXcTp6FGhfpRNI,632
6
- pypomes_jwt-1.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- pypomes_jwt-1.1.4.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
8
- pypomes_jwt-1.1.4.dist-info/RECORD,,
File without changes