Skip to content

Commit f22ed32

Browse files
update docs
1 parent 421a99d commit f22ed32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/planet_auth/oidc/token_validator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import jwt
1616
import time
17-
from typing import Dict, List
17+
from typing import Any, Dict, List, Tuple
1818

1919
import planet_auth.logging.auth_logger
2020
from planet_auth.auth_exception import AuthException, InvalidTokenException
@@ -258,13 +258,16 @@ def validate_token(
258258

259259
@staticmethod
260260
@InvalidArgumentException.recast(jwt.exceptions.DecodeError)
261-
def hazmat_unverified_decode(token_str):
261+
def hazmat_unverified_decode(token_str) -> Tuple[Dict, Dict, Any]:
262262
"""
263263
Decide a JWT without verifying the signature or any claims.
264264
265265
!!! Warning
266266
Treat unverified token claims with extreme caution.
267267
Nothing can be trusted until the token is verified.
268+
269+
Returns:
270+
Returns the decoded JWT header, payload, and signature
268271
"""
269272
unverified_complete = jwt.decode_complete(token_str, options={"verify_signature": False}) # nosemgrep
270273
return unverified_complete["header"], unverified_complete["payload"], unverified_complete["signature"]

0 commit comments

Comments
 (0)