pypomes-jwt 0.7.4__py3-none-any.whl → 0.7.6__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 +17 -5
- {pypomes_jwt-0.7.4.dist-info → pypomes_jwt-0.7.6.dist-info}/METADATA +1 -1
- pypomes_jwt-0.7.6.dist-info/RECORD +8 -0
- pypomes_jwt-0.7.4.dist-info/RECORD +0 -8
- {pypomes_jwt-0.7.4.dist-info → pypomes_jwt-0.7.6.dist-info}/WHEEL +0 -0
- {pypomes_jwt-0.7.4.dist-info → pypomes_jwt-0.7.6.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_pomes.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Any, Literal
|
|
|
6
6
|
from .jwt_constants import (
|
|
7
7
|
JWT_ACCESS_MAX_AGE, JWT_REFRESH_MAX_AGE,
|
|
8
8
|
JWT_DEFAULT_ALGORITHM, JWT_DECODING_KEY,
|
|
9
|
-
JWT_DB_ENGINE, JWT_DB_TABLE, JWT_DB_COL_ACCOUNT
|
|
9
|
+
JWT_DB_ENGINE, JWT_DB_TABLE, JWT_DB_COL_ACCOUNT, JWT_DB_COL_TOKEN
|
|
10
10
|
)
|
|
11
11
|
from .jwt_data import JwtData
|
|
12
12
|
|
|
@@ -227,10 +227,22 @@ def jwt_get_tokens(errors: list[str] | None,
|
|
|
227
227
|
logger.debug(msg=f"Retrieve JWT token data for '{account_id}'")
|
|
228
228
|
op_errors: list[str] = []
|
|
229
229
|
if refresh_token:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
op_errors
|
|
230
|
+
# verify whether this refresh token is legitimate
|
|
231
|
+
if JWT_DB_ENGINE:
|
|
232
|
+
from pypomes_db import db_select
|
|
233
|
+
recs: list[tuple[str]] = db_select(errors=op_errors,
|
|
234
|
+
sel_stmt=f"SELECT {JWT_DB_COL_TOKEN} "
|
|
235
|
+
f"FROM {JWT_DB_TABLE}",
|
|
236
|
+
where_data={JWT_DB_COL_ACCOUNT: f"'{account_id}'"},
|
|
237
|
+
logger=logger)
|
|
238
|
+
if not op_errors and \
|
|
239
|
+
(len(recs) == 0 or recs[0][0] != refresh_token):
|
|
240
|
+
op_errors.append("Invalid refresh token")
|
|
241
|
+
if not op_errors:
|
|
242
|
+
account_claims = jwt_get_claims(errors=op_errors,
|
|
243
|
+
token=refresh_token)
|
|
244
|
+
if not op_errors and account_claims.get("nat") != "R":
|
|
245
|
+
op_errors.append("Invalid parameters")
|
|
234
246
|
|
|
235
247
|
if not op_errors:
|
|
236
248
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.6
|
|
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
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pypomes_jwt/__init__.py,sha256=dkWeYPNwypjwFuTjx4YtC8QV9ihykF4xcJJ7x86Wc5g,1130
|
|
2
|
+
pypomes_jwt/jwt_constants.py,sha256=xUX2raEaDUPJsjAm78lQ0APs4KSs5GYBxSPC5QKrrFE,4327
|
|
3
|
+
pypomes_jwt/jwt_data.py,sha256=YH3v8zvOURkB_o0XLMu2y2sFkKCxZBmbyWU5rC2gre4,16419
|
|
4
|
+
pypomes_jwt/jwt_pomes.py,sha256=eRQSLA8DVzr9MfVOh5bl6Zz3iOQtRIAQjzIfoz6Fj9o,12915
|
|
5
|
+
pypomes_jwt-0.7.6.dist-info/METADATA,sha256=5N0G1VHBXKHiH-QAnUBC9UgeqpjOh9-4-BYMtAl680U,599
|
|
6
|
+
pypomes_jwt-0.7.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
pypomes_jwt-0.7.6.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
+
pypomes_jwt-0.7.6.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=dkWeYPNwypjwFuTjx4YtC8QV9ihykF4xcJJ7x86Wc5g,1130
|
|
2
|
-
pypomes_jwt/jwt_constants.py,sha256=xUX2raEaDUPJsjAm78lQ0APs4KSs5GYBxSPC5QKrrFE,4327
|
|
3
|
-
pypomes_jwt/jwt_data.py,sha256=YH3v8zvOURkB_o0XLMu2y2sFkKCxZBmbyWU5rC2gre4,16419
|
|
4
|
-
pypomes_jwt/jwt_pomes.py,sha256=zFU1TyeR3BhK9ToC1Vs1wh67uE2DGvzH9FltiQxI0EM,12160
|
|
5
|
-
pypomes_jwt-0.7.4.dist-info/METADATA,sha256=DwlCneMVk9Qv4RovwWslSRK_zb2DF5lgnJd4nRVeeWE,599
|
|
6
|
-
pypomes_jwt-0.7.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
pypomes_jwt-0.7.4.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
-
pypomes_jwt-0.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|