pypomes-jwt 1.3.0__py3-none-any.whl → 1.3.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_config.py +1 -1
- pypomes_jwt/jwt_registry.py +18 -14
- {pypomes_jwt-1.3.0.dist-info → pypomes_jwt-1.3.2.dist-info}/METADATA +3 -3
- pypomes_jwt-1.3.2.dist-info/RECORD +9 -0
- pypomes_jwt-1.3.0.dist-info/RECORD +0 -9
- {pypomes_jwt-1.3.0.dist-info → pypomes_jwt-1.3.2.dist-info}/WHEEL +0 -0
- {pypomes_jwt-1.3.0.dist-info → pypomes_jwt-1.3.2.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_config.py
CHANGED
|
@@ -52,7 +52,7 @@ class JwtConfig(Enum):
|
|
|
52
52
|
def_value=300)
|
|
53
53
|
ACCOUNT_LIMIT: int = env_get_int(key=f"{APP_PREFIX}_JWT_ACCOUNT_LIMIT",
|
|
54
54
|
def_value=5)
|
|
55
|
-
DEFAULT_ALGORITHM: _default_algorithm
|
|
55
|
+
DEFAULT_ALGORITHM: JwtAlgorithm = _default_algorithm
|
|
56
56
|
ENCODING_KEY: bytes = _encoding_key
|
|
57
57
|
DECODING_KEY: bytes = _decoding_key
|
|
58
58
|
# recommended: at least 2 hours (set to 24 hours)
|
pypomes_jwt/jwt_registry.py
CHANGED
|
@@ -371,7 +371,6 @@ class JwtRegistry:
|
|
|
371
371
|
errors=errors,
|
|
372
372
|
logger=logger)
|
|
373
373
|
if not errors:
|
|
374
|
-
|
|
375
374
|
# retrieve the account's tokens
|
|
376
375
|
# noinspection PyTypeChecker
|
|
377
376
|
recs: list[tuple[int, str, str, str]] = \
|
|
@@ -385,7 +384,7 @@ class JwtRegistry:
|
|
|
385
384
|
if not errors:
|
|
386
385
|
if logger:
|
|
387
386
|
logger.debug(msg=f"Retrieved {len(recs)} tokens from storage for account '{account_id}'")
|
|
388
|
-
#
|
|
387
|
+
# process expired tokens
|
|
389
388
|
just_now: int = int(datetime.now(tz=UTC).timestamp())
|
|
390
389
|
oldest_ts: int = sys.maxsize
|
|
391
390
|
oldest_id: int | None = None
|
|
@@ -434,18 +433,23 @@ class JwtRegistry:
|
|
|
434
433
|
f"'{account_id}' removed from storage")
|
|
435
434
|
# persist token
|
|
436
435
|
if not errors:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
436
|
+
reply: tuple[int] = db_insert(insert_stmt=f"INSERT INTO {JwtDbConfig.TABLE}",
|
|
437
|
+
insert_data={
|
|
438
|
+
JwtDbConfig.COL_ACCOUNT: account_id,
|
|
439
|
+
JwtDbConfig.COL_TOKEN: jwt_token,
|
|
440
|
+
JwtDbConfig.COL_ALGORITHM:
|
|
441
|
+
JwtConfig.DEFAULT_ALGORITHM.value,
|
|
442
|
+
JwtDbConfig.COL_DECODER:
|
|
443
|
+
b64encode(s=JwtConfig.DECODING_KEY.value).decode()
|
|
444
|
+
},
|
|
445
|
+
return_cols={JwtDbConfig.COL_KID: int},
|
|
446
|
+
engine=DbEngine(JwtDbConfig.ENGINE),
|
|
447
|
+
connection=curr_conn,
|
|
448
|
+
errors=errors,
|
|
449
|
+
logger=logger)
|
|
450
|
+
if not errors:
|
|
451
|
+
result = reply[0]
|
|
452
|
+
|
|
449
453
|
# finish the operation
|
|
450
454
|
if not db_conn:
|
|
451
455
|
if errors:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.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
|
|
@@ -10,8 +10,8 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
|
-
Requires-Dist: cryptography>=45.0.
|
|
13
|
+
Requires-Dist: cryptography>=45.0.7
|
|
14
14
|
Requires-Dist: flask>=3.1.2
|
|
15
15
|
Requires-Dist: pyjwt>=2.10.1
|
|
16
16
|
Requires-Dist: pypomes-core>=2.7.0
|
|
17
|
-
Requires-Dist: pypomes-db>=2.5
|
|
17
|
+
Requires-Dist: pypomes-db>=2.7.5
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pypomes_jwt/__init__.py,sha256=vXAeaEnuUqpvGtV465TsW2Lf3ihijrMP2Hm4My79y88,968
|
|
2
|
+
pypomes_jwt/jwt_config.py,sha256=YV393iI3AMIUL-zqJJMQtuLlPtWdPjQvPG_6viM3wck,3413
|
|
3
|
+
pypomes_jwt/jwt_pomes.py,sha256=WWmZYVpG6wqlIjcJU3jNyBquCgfB-OcgCJBmm6imL4Q,23524
|
|
4
|
+
pypomes_jwt/jwt_providers.py,sha256=LL2OxdyGH3_O-qEOVjg_GsPQVRtaSi37AE-BOZ6tiqs,5928
|
|
5
|
+
pypomes_jwt/jwt_registry.py,sha256=ypBEoL0I2F08sR2G2VO9wXxVeE252lNzjIAC3FGORhA,22631
|
|
6
|
+
pypomes_jwt-1.3.2.dist-info/METADATA,sha256=1HM6Bm2AjGV0ihywL8q2Yb53lMwmsDqhwDP9o2b49XQ,660
|
|
7
|
+
pypomes_jwt-1.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
pypomes_jwt-1.3.2.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
9
|
+
pypomes_jwt-1.3.2.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=vXAeaEnuUqpvGtV465TsW2Lf3ihijrMP2Hm4My79y88,968
|
|
2
|
-
pypomes_jwt/jwt_config.py,sha256=E8fGof_krCx2gZ_QCo87tF46J_2OLZk1m9erf3oX4O4,3398
|
|
3
|
-
pypomes_jwt/jwt_pomes.py,sha256=WWmZYVpG6wqlIjcJU3jNyBquCgfB-OcgCJBmm6imL4Q,23524
|
|
4
|
-
pypomes_jwt/jwt_providers.py,sha256=LL2OxdyGH3_O-qEOVjg_GsPQVRtaSi37AE-BOZ6tiqs,5928
|
|
5
|
-
pypomes_jwt/jwt_registry.py,sha256=SDP2pFPsbjJ9w3r9c_DPJuN86rdwhHkg3lyX3gTBuNY,22305
|
|
6
|
-
pypomes_jwt-1.3.0.dist-info/METADATA,sha256=rEi7d8D9IFLGNgrJph6Dy360rcJG-YQqfH5daeAGei0,660
|
|
7
|
-
pypomes_jwt-1.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
pypomes_jwt-1.3.0.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
9
|
-
pypomes_jwt-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|