pypomes-jwt 0.6.9__tar.gz → 0.7.0__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.6.9 → pypomes_jwt-0.7.0}/PKG-INFO +2 -2
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/pyproject.toml +2 -2
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/src/pypomes_jwt/__init__.py +0 -2
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/src/pypomes_jwt/jwt_data.py +5 -3
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/src/pypomes_jwt/jwt_pomes.py +0 -1
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/.gitignore +0 -0
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/LICENSE +0 -0
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/README.md +0 -0
- {pypomes_jwt-0.6.9 → pypomes_jwt-0.7.0}/src/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.
|
|
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.
|
|
15
|
+
Requires-Dist: pypomes-core>=1.8.3
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "pypomes_jwt"
|
|
9
|
-
version = "0.
|
|
9
|
+
version = "0.7.0"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="GT Nunes", email="wisecoder01@gmail.com" }
|
|
12
12
|
]
|
|
@@ -21,7 +21,7 @@ classifiers = [
|
|
|
21
21
|
dependencies = [
|
|
22
22
|
"PyJWT>=2.10.1",
|
|
23
23
|
"cryptography>=44.0.1",
|
|
24
|
-
"pypomes_core>=1.
|
|
24
|
+
"pypomes_core>=1.8.3"
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
@@ -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",
|
|
@@ -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=
|
|
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}")
|
|
@@ -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")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|