We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09330c8 commit 6f6b4adCopy full SHA for 6f6b4ad
1 file changed
cloudsmith_cli/core/credentials/oidc/cache.py
@@ -7,7 +7,6 @@
7
8
from __future__ import annotations
9
10
-import base64
11
import hashlib
12
import json
13
import logging
@@ -48,13 +47,10 @@ def _decode_jwt_exp(token: str) -> float | None:
48
47
make an authorization decision, so the signature is deliberately not
49
verified (the API rejects tampered tokens regardless).
50
"""
51
- parts = token.split(".", 2)
52
- if len(parts) != 3:
53
- return None
54
try:
55
- payload_segment = parts[1]
56
- padded = payload_segment + "=" * (-len(payload_segment) % 4)
57
- payload = json.loads(base64.urlsafe_b64decode(padded))
+ import jwt
+
+ payload = jwt.decode(token, options={"verify_signature": False})
58
exp = payload.get("exp")
59
if exp is not None:
60
return float(exp)
0 commit comments