pypomes-jwt 0.6.1__py3-none-any.whl → 0.6.2__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_data.py +5 -3
- {pypomes_jwt-0.6.1.dist-info → pypomes_jwt-0.6.2.dist-info}/METADATA +2 -2
- pypomes_jwt-0.6.2.dist-info/RECORD +7 -0
- pypomes_jwt-0.6.1.dist-info/RECORD +0 -7
- {pypomes_jwt-0.6.1.dist-info → pypomes_jwt-0.6.2.dist-info}/WHEEL +0 -0
- {pypomes_jwt-0.6.1.dist-info → pypomes_jwt-0.6.2.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_data.py
CHANGED
|
@@ -3,6 +3,7 @@ import requests
|
|
|
3
3
|
from datetime import datetime, timedelta, timezone
|
|
4
4
|
from jwt.exceptions import InvalidTokenError
|
|
5
5
|
from logging import Logger
|
|
6
|
+
from pypomes_core import str_random
|
|
6
7
|
from requests import Response
|
|
7
8
|
from threading import Lock
|
|
8
9
|
from typing import Any, Literal
|
|
@@ -120,7 +121,7 @@ class JwtData:
|
|
|
120
121
|
"iss": reference_url,
|
|
121
122
|
"exp": "<numeric-UTC-datetime>",
|
|
122
123
|
"iat": "<numeric-UTC-datetime>",
|
|
123
|
-
"jti": "<jwt-id",
|
|
124
|
+
"jti": "<jwt-id>",
|
|
124
125
|
}
|
|
125
126
|
custom_claims: dict[str, Any] = {}
|
|
126
127
|
public_claims: dict[str, Any] = {}
|
|
@@ -225,11 +226,12 @@ class JwtData:
|
|
|
225
226
|
raise RuntimeError(" - ".join(errors))
|
|
226
227
|
else:
|
|
227
228
|
# JWT service is being provided locally
|
|
229
|
+
reserved_claims["jti"] = str_random(size=16)
|
|
228
230
|
reserved_claims["iat"] = just_now
|
|
229
231
|
reserved_claims["exp"] = just_now + control_data.get("access-max-age")
|
|
230
232
|
claims: dict[str, Any] = item_data.get("public-claims").copy()
|
|
231
|
-
claims.update(reserved_claims)
|
|
232
|
-
claims.update(custom_claims)
|
|
233
|
+
claims.update(m=reserved_claims)
|
|
234
|
+
claims.update(m=custom_claims)
|
|
233
235
|
# may raise an exception
|
|
234
236
|
token: str = jwt.encode(payload=claims,
|
|
235
237
|
key=control_data.get("secret-key") or control_data.get("private-key"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
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.
|
|
15
|
+
Requires-Dist: pypomes-core>=1.7.8
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pypomes_jwt/__init__.py,sha256=m0USOMlGVUfofwukykKf6DAPq7CRn4SiY6CeNOOiqJ8,998
|
|
2
|
+
pypomes_jwt/jwt_data.py,sha256=auVG-sQJjeeQwAzwkaSV149_qHwLIYqoi-Aa0op9eI8,17830
|
|
3
|
+
pypomes_jwt/jwt_pomes.py,sha256=93o0QC7Phsb_29KaLn9mlfE6nUw8HXadqpCZn-Q8gvI,13891
|
|
4
|
+
pypomes_jwt-0.6.2.dist-info/METADATA,sha256=2rj4pjbMCHX_lOmN59UAMGscCesvMvYQgkzvcSCc50s,599
|
|
5
|
+
pypomes_jwt-0.6.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
+
pypomes_jwt-0.6.2.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
7
|
+
pypomes_jwt-0.6.2.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=m0USOMlGVUfofwukykKf6DAPq7CRn4SiY6CeNOOiqJ8,998
|
|
2
|
-
pypomes_jwt/jwt_data.py,sha256=2LnD9_0VMlsUi95jw3biSY5j21boqApSLAyZ_HXMiks,17722
|
|
3
|
-
pypomes_jwt/jwt_pomes.py,sha256=93o0QC7Phsb_29KaLn9mlfE6nUw8HXadqpCZn-Q8gvI,13891
|
|
4
|
-
pypomes_jwt-0.6.1.dist-info/METADATA,sha256=qY2VCQtNpS2WtKUDdMC-Gq5IXyRvFfk8rDhu9MeDyFM,599
|
|
5
|
-
pypomes_jwt-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
-
pypomes_jwt-0.6.1.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
7
|
-
pypomes_jwt-0.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|