pypomes-jwt 0.4.9__tar.gz → 0.5.1__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.4.9 → pypomes_jwt-0.5.1}/PKG-INFO +8 -9
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/pyproject.toml +8 -8
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/src/pypomes_jwt/jwt_data.py +3 -3
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/src/pypomes_jwt/jwt_pomes.py +3 -0
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/.gitignore +0 -0
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/LICENSE +0 -0
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/README.md +0 -0
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/src/__init__.py +0 -0
- {pypomes_jwt-0.4.9 → pypomes_jwt-0.5.1}/src/pypomes_jwt/__init__.py +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
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
|
|
7
7
|
Author-email: GT Nunes <wisecoder01@gmail.com>
|
|
8
|
-
License-File: LICENSE
|
|
9
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
9
|
Classifier: Operating System :: OS Independent
|
|
11
10
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Requires-Python: >=3.
|
|
13
|
-
Requires-Dist: pip>=24.
|
|
14
|
-
Requires-Dist: pyjwt>=2.
|
|
15
|
-
Requires-Dist: pypomes-core>=1.
|
|
16
|
-
Requires-Dist: pypomes-crypto>=0.3.
|
|
17
|
-
Requires-Dist: setuptools>=75.
|
|
18
|
-
Requires-Dist: wheel>=0.
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Requires-Dist: pip>=24.3.1
|
|
13
|
+
Requires-Dist: pyjwt>=2.10.0
|
|
14
|
+
Requires-Dist: pypomes-core>=1.6.2
|
|
15
|
+
Requires-Dist: pypomes-crypto>=0.3.1
|
|
16
|
+
Requires-Dist: setuptools>=75.5.0
|
|
17
|
+
Requires-Dist: wheel>=0.45.0
|
|
@@ -6,25 +6,25 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "pypomes_jwt"
|
|
9
|
-
version = "0.
|
|
9
|
+
version = "0.5.1"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="GT Nunes", email="wisecoder01@gmail.com" }
|
|
12
12
|
]
|
|
13
13
|
description = "A collection of Python pomes, penyeach (JWT module)"
|
|
14
14
|
readme = "README.md"
|
|
15
|
-
requires-python = ">=3.
|
|
15
|
+
requires-python = ">=3.12"
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Programming Language :: Python :: 3",
|
|
18
18
|
"License :: OSI Approved :: MIT License",
|
|
19
19
|
"Operating System :: OS Independent"
|
|
20
20
|
]
|
|
21
21
|
dependencies = [
|
|
22
|
-
"pip>=24.
|
|
23
|
-
"PyJWT>=2.
|
|
24
|
-
"pypomes_core>=1.
|
|
25
|
-
"pypomes_crypto>=0.3.
|
|
26
|
-
"setuptools>=75.
|
|
27
|
-
"wheel>=0.
|
|
22
|
+
"pip>=24.3.1",
|
|
23
|
+
"PyJWT>=2.10.0",
|
|
24
|
+
"pypomes_core>=1.6.2",
|
|
25
|
+
"pypomes_crypto>=0.3.1",
|
|
26
|
+
"setuptools>=75.5.0",
|
|
27
|
+
"wheel>=0.45.0"
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import jwt
|
|
2
2
|
import math
|
|
3
3
|
import requests
|
|
4
|
-
from datetime import datetime, timedelta
|
|
4
|
+
from datetime import datetime, timedelta, timezone
|
|
5
5
|
from jwt.exceptions import InvalidTokenError
|
|
6
6
|
from logging import Logger
|
|
7
7
|
from requests import Response
|
|
@@ -98,7 +98,7 @@ class JwtData:
|
|
|
98
98
|
"access-max-age": access_max_age,
|
|
99
99
|
"request-timeout": request_timeout,
|
|
100
100
|
"local-provider": local_provider,
|
|
101
|
-
"refresh-exp": datetime.
|
|
101
|
+
"refresh-exp": datetime.now(timezone.utc) + timedelta(seconds=refresh_max_age)
|
|
102
102
|
}
|
|
103
103
|
if algorithm in ["HS256", "HS512"]:
|
|
104
104
|
control_data["secret-key"] = secret_key
|
|
@@ -190,7 +190,7 @@ class JwtData:
|
|
|
190
190
|
control_data: dict[str, Any] = item_data.get("control-data")
|
|
191
191
|
custom_claims: dict[str, Any] = item_data.get("custom-claims")
|
|
192
192
|
standard_claims: dict[str, Any] = item_data.get("standard-claims")
|
|
193
|
-
just_now: datetime = datetime.
|
|
193
|
+
just_now: datetime = datetime.now(timezone.utc)
|
|
194
194
|
|
|
195
195
|
# is the current token still valid ?
|
|
196
196
|
if just_now > standard_claims.get("exp"):
|
|
@@ -41,6 +41,9 @@ def jwt_needed(func: callable) -> callable:
|
|
|
41
41
|
response: Response = jwt_verify_request(request=request) if JWT_ENDPOINT_URL else None
|
|
42
42
|
return response if response else func(*args, **kwargs)
|
|
43
43
|
|
|
44
|
+
# prevent a rogue error ("View function mapping is overwriting an existing endpoint function")
|
|
45
|
+
wrapper.__name__ = func.__name__
|
|
46
|
+
|
|
44
47
|
return wrapper
|
|
45
48
|
|
|
46
49
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|