pypomes-jwt 1.0.4__py3-none-any.whl → 1.0.5__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_registry.py +12 -1
- {pypomes_jwt-1.0.4.dist-info → pypomes_jwt-1.0.5.dist-info}/METADATA +1 -1
- pypomes_jwt-1.0.5.dist-info/RECORD +8 -0
- pypomes_jwt-1.0.4.dist-info/RECORD +0 -8
- {pypomes_jwt-1.0.4.dist-info → pypomes_jwt-1.0.5.dist-info}/WHEEL +0 -0
- {pypomes_jwt-1.0.4.dist-info → pypomes_jwt-1.0.5.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_registry.py
CHANGED
|
@@ -399,6 +399,7 @@ def _jwt_persist_token(account_id: str,
|
|
|
399
399
|
just_now: int = int(datetime.now(tz=timezone.utc).timestamp())
|
|
400
400
|
oldest_ts: int = sys.maxsize
|
|
401
401
|
oldest_id: int | None = None
|
|
402
|
+
existing_ids: list[int] = []
|
|
402
403
|
expired: list[int] = []
|
|
403
404
|
for rec in recs:
|
|
404
405
|
token: str = rec[1]
|
|
@@ -420,6 +421,9 @@ def _jwt_persist_token(account_id: str,
|
|
|
420
421
|
oldest_ts = iat
|
|
421
422
|
oldest_id = token_id
|
|
422
423
|
|
|
424
|
+
# save token id
|
|
425
|
+
existing_ids.append(token_id)
|
|
426
|
+
|
|
423
427
|
# remove expired tokens from persistence
|
|
424
428
|
if expired:
|
|
425
429
|
db_delete(errors=errors,
|
|
@@ -461,10 +465,17 @@ def _jwt_persist_token(account_id: str,
|
|
|
461
465
|
raise RuntimeError("; ".join(errors))
|
|
462
466
|
|
|
463
467
|
# obtain the token's storage id
|
|
468
|
+
# HAZARD: JWT_DB_COL_TOKEN's type might prevent it for being used in a WHERE clause
|
|
469
|
+
where_clause: str | None = None
|
|
470
|
+
if existing_ids:
|
|
471
|
+
where_clause = f"{JWT_DB_COL_KID} NOT IN ({existing_ids})"
|
|
472
|
+
where_clause = where_clause.replace("[", "").replace("]", "")
|
|
464
473
|
reply: list[tuple[int]] = db_select(errors=errors,
|
|
465
474
|
sel_stmt=f"SELECT {JWT_DB_COL_KID} "
|
|
466
475
|
f"FROM {JWT_DB_TABLE}",
|
|
467
|
-
|
|
476
|
+
where_clause=where_clause,
|
|
477
|
+
where_data={JWT_DB_COL_ACCOUNT: account_id},
|
|
478
|
+
require_count=1,
|
|
468
479
|
connection=db_conn,
|
|
469
480
|
committable=False,
|
|
470
481
|
logger=logger)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
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=fLr_M8yXlcmSTNPMdJOJQlMmtaiK5YKh0vKjOp3z2E4,1446
|
|
2
|
+
pypomes_jwt/jwt_constants.py,sha256=IQV39AiZKGuU8XxZBgJ-KJZQZ_mmnxyOnRZeuxlqDRk,4045
|
|
3
|
+
pypomes_jwt/jwt_pomes.py,sha256=2LyjMMVkdPXeC7hMD52637e-LJoGbhKTb0Wqj6QXbTg,23049
|
|
4
|
+
pypomes_jwt/jwt_registry.py,sha256=OgL4qH2WJdg0awtTRTk3jLP4oXB21PbEfDRzADTEhYI,22979
|
|
5
|
+
pypomes_jwt-1.0.5.dist-info/METADATA,sha256=yRdOfyKQEeiDHaHjLmtpwiInVnl30f8228Gj2RoSP_0,632
|
|
6
|
+
pypomes_jwt-1.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
pypomes_jwt-1.0.5.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
+
pypomes_jwt-1.0.5.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=fLr_M8yXlcmSTNPMdJOJQlMmtaiK5YKh0vKjOp3z2E4,1446
|
|
2
|
-
pypomes_jwt/jwt_constants.py,sha256=IQV39AiZKGuU8XxZBgJ-KJZQZ_mmnxyOnRZeuxlqDRk,4045
|
|
3
|
-
pypomes_jwt/jwt_pomes.py,sha256=2LyjMMVkdPXeC7hMD52637e-LJoGbhKTb0Wqj6QXbTg,23049
|
|
4
|
-
pypomes_jwt/jwt_registry.py,sha256=xe8ApMSJ_I1gJeGPIMOqj1bgv6G0IDlqMX0M5zKiaYI,22463
|
|
5
|
-
pypomes_jwt-1.0.4.dist-info/METADATA,sha256=8Vef22_ykt_DQ0wkarlpV2YoXyV2TOdXJ2nOxIeBm30,632
|
|
6
|
-
pypomes_jwt-1.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
pypomes_jwt-1.0.4.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
-
pypomes_jwt-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|