pypomes-jwt 0.6.9__py3-none-any.whl → 0.7.0__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
@@ -2,7 +2,6 @@ from .jwt_data import (
2
2
  jwt_request_token, jwt_validate_token
3
3
  )
4
4
  from .jwt_pomes import (
5
- JWT_ENDPOINT_URL,
6
5
  JWT_ACCESS_MAX_AGE, JWT_REFRESH_MAX_AGE,
7
6
  JWT_HS_SECRET_KEY, JWT_RSA_PRIVATE_KEY, JWT_RSA_PUBLIC_KEY,
8
7
  jwt_needed, jwt_verify_request, jwt_claims, jwt_token,
@@ -14,7 +13,6 @@ __all__ = [
14
13
  # jwt_data
15
14
  "jwt_request_token", "jwt_validate_token",
16
15
  # jwt_pomes
17
- "JWT_ENDPOINT_URL",
18
16
  "JWT_ACCESS_MAX_AGE", "JWT_REFRESH_MAX_AGE",
19
17
  "JWT_HS_SECRET_KEY", "JWT_RSA_PRIVATE_KEY", "JWT_RSA_PUBLIC_KEY",
20
18
  "jwt_needed", "jwt_verify_request", "jwt_claims", "jwt_token",
pypomes_jwt/jwt_data.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import jwt
2
2
  import requests
3
+ import string
3
4
  from datetime import datetime, timezone
4
5
  from jwt.exceptions import InvalidTokenError
5
6
  from logging import Logger
@@ -214,7 +215,8 @@ class JwtData:
214
215
  # obtain a new token, if the current token has expired
215
216
  just_now: int = int(datetime.now(tz=timezone.utc).timestamp())
216
217
  if just_now > reserved_claims.get("exp"):
217
- token_jti: str = str_random(size=16)
218
+ token_jti: str = str_random(size=32,
219
+ chars=string.ascii_letters + string.digits)
218
220
  # where is the JWT service provider ?
219
221
  if control_data.get("remote-provider"):
220
222
  # JWT service is being provided by a remote server
@@ -260,7 +262,7 @@ class JwtData:
260
262
  reserved_claims["exp"] = token_exp
261
263
  control_data["access-token"] = token
262
264
 
263
- # return the token
265
+ # return the token data
264
266
  result = {
265
267
  "access_token": control_data.get("access-token"),
266
268
  "created_in": reserved_claims.get("iat"),
@@ -334,7 +336,7 @@ class JwtData:
334
336
  """
335
337
  # initialize the return variable
336
338
  result: dict[str, dict[str, Any]] | None = None
337
-
339
+
338
340
  if logger:
339
341
  target: str = f"account id '{account_id}'" if account_id else f"token '{access_token}'"
340
342
  logger.debug(f"Retrieve access data for {target}")
pypomes_jwt/jwt_pomes.py CHANGED
@@ -19,7 +19,6 @@ JWT_REFRESH_MAX_AGE: Final[int] = env_get_int(key=f"{APP_PREFIX}_JWT_REFRESH_MAX
19
19
  def_value=43200)
20
20
  JWT_HS_SECRET_KEY: Final[bytes] = env_get_bytes(key=f"{APP_PREFIX}_JWT_HS_SECRET_KEY",
21
21
  def_value=token_bytes(nbytes=32))
22
- JWT_ENDPOINT_URL: Final[str] = env_get_str(key=f"{APP_PREFIX}_JWT_ENDPOINT_URL")
23
22
 
24
23
  # obtain a RSA private/public key pair
25
24
  __priv_bytes: bytes = env_get_bytes(key=f"{APP_PREFIX}_JWT_RSA_PRIVATE_KEY")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_jwt
3
- Version: 0.6.9
3
+ Version: 0.7.0
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,4 +12,4 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.12
13
13
  Requires-Dist: cryptography>=44.0.1
14
14
  Requires-Dist: pyjwt>=2.10.1
15
- Requires-Dist: pypomes-core>=1.7.9
15
+ Requires-Dist: pypomes-core>=1.8.3
@@ -0,0 +1,7 @@
1
+ pypomes_jwt/__init__.py,sha256=jHyN7gJR575f8djqu7ZsYYxSuhpcy46S4ALAl7SSmHk,940
2
+ pypomes_jwt/jwt_data.py,sha256=U_Bl2F-HAbDOxD-VshE3wD6wXxcWqv6fcaAf1J1pK9Y,20050
3
+ pypomes_jwt/jwt_pomes.py,sha256=ehi_mtFn6LE5QBpPHnLWYDTnuwbz5Cg4tovz0KcZW3k,14140
4
+ pypomes_jwt-0.7.0.dist-info/METADATA,sha256=k8lWDHA8vjQrqa8bi9tep1MRiM6eopzzM5MSTNjbjA4,599
5
+ pypomes_jwt-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ pypomes_jwt-0.7.0.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
+ pypomes_jwt-0.7.0.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- pypomes_jwt/__init__.py,sha256=CwpFtZEi1Yo1i4ulyR65yvo_fJpSRMJsXwzV75E3K0A,988
2
- pypomes_jwt/jwt_data.py,sha256=o89rMzaUp3-GpX3zei2UkFzYacyjmMvi2QPq1vBaNGY,19945
3
- pypomes_jwt/jwt_pomes.py,sha256=rhYoqD57yXayJoePdjbB3RfPAIg23o6YQKkdnD4tz0c,14222
4
- pypomes_jwt-0.6.9.dist-info/METADATA,sha256=penqUj2BH3vbm9Br2kOv15Gcj5fkBj6Jx6tug_bbYxY,599
5
- pypomes_jwt-0.6.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- pypomes_jwt-0.6.9.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
7
- pypomes_jwt-0.6.9.dist-info/RECORD,,