pypomes-jwt 1.0.6__py3-none-any.whl → 1.0.8__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_pomes.py CHANGED
@@ -56,8 +56,7 @@ def jwt_verify_request(request: Request) -> Response:
56
56
  if auth_header and auth_header.startswith("Bearer "):
57
57
  # yes, extract and validate the JWT access token
58
58
  token: str = auth_header.split(" ")[1]
59
- errors: list[str] = []
60
- if jwt_validate_token(errors=errors,
59
+ if jwt_validate_token(errors=None,
61
60
  nature="A",
62
61
  token=token):
63
62
  bad_token = False
@@ -177,6 +176,8 @@ def jwt_validate_token(errors: list[str] | None,
177
176
 
178
177
  # retrieve token data from database
179
178
  if nature and not (token_kid and token_kid[0:1] == nature):
179
+ if logger:
180
+ logger.error(f"Nature of token's 'kid' ('{token_kid}') not '{nature}'")
180
181
  op_errors.append("Invalid token")
181
182
  elif token_kid and len(token_kid) > 1 and \
182
183
  token_kid[0:1] in ["A", "R"] and token_kid[1:].isdigit():
@@ -225,7 +226,9 @@ def jwt_validate_token(errors: list[str] | None,
225
226
  require=["iat", "iss", "exp", "sub"],
226
227
  algorithms=token_alg)
227
228
  if account_id and payload.get("sub") != account_id:
228
- op_errors.append("Token does not belong to account")
229
+ if logger:
230
+ logger.error(msg=f"Token does not belong to account '{account_id}'")
231
+ op_errors.append("Invalid token")
229
232
  else:
230
233
  result = {
231
234
  "header": token_header,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_jwt
3
- Version: 1.0.6
3
+ Version: 1.0.8
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>=1.8.7
16
- Requires-Dist: pypomes-db>=2.0.0
15
+ Requires-Dist: pypomes-core>=1.9.2
16
+ Requires-Dist: pypomes-db>=2.0.3
@@ -0,0 +1,8 @@
1
+ pypomes_jwt/__init__.py,sha256=fLr_M8yXlcmSTNPMdJOJQlMmtaiK5YKh0vKjOp3z2E4,1446
2
+ pypomes_jwt/jwt_constants.py,sha256=IQV39AiZKGuU8XxZBgJ-KJZQZ_mmnxyOnRZeuxlqDRk,4045
3
+ pypomes_jwt/jwt_pomes.py,sha256=Oh4j6sj8DnQaVKzfFkPcCIZU590jXgNoMpWzyKYIdUQ,23224
4
+ pypomes_jwt/jwt_registry.py,sha256=S_-M6rcXwKy73H6uE4EwFx4F1gVfVg_DHCVYsqAbiWU,23005
5
+ pypomes_jwt-1.0.8.dist-info/METADATA,sha256=G3tsXNOnY332OdUz70cngOC9PP4zAwe-X3avwVJPhHM,632
6
+ pypomes_jwt-1.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ pypomes_jwt-1.0.8.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
8
+ pypomes_jwt-1.0.8.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- pypomes_jwt/__init__.py,sha256=fLr_M8yXlcmSTNPMdJOJQlMmtaiK5YKh0vKjOp3z2E4,1446
2
- pypomes_jwt/jwt_constants.py,sha256=IQV39AiZKGuU8XxZBgJ-KJZQZ_mmnxyOnRZeuxlqDRk,4045
3
- pypomes_jwt/jwt_pomes.py,sha256=eW9vvlCcDfIjgTVwJeE_EL8nwiBMe7Q4PlU7HRbn-rg,23038
4
- pypomes_jwt/jwt_registry.py,sha256=S_-M6rcXwKy73H6uE4EwFx4F1gVfVg_DHCVYsqAbiWU,23005
5
- pypomes_jwt-1.0.6.dist-info/METADATA,sha256=67io_BFb6EGOsKzibNWgi4QZWbLKos7iAiaHQQdJNm4,632
6
- pypomes_jwt-1.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- pypomes_jwt-1.0.6.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
8
- pypomes_jwt-1.0.6.dist-info/RECORD,,