Skip to content

Commit

Permalink
Security: fix secret leakage in errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaul Kremer authored and roekatz committed Oct 2, 2023
1 parent 3afcd1a commit 062dbee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/opal-common/opal_common/authentication/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def verify_logged_in(verifier: JWTVerifier, token: Optional[str]) -> JWTClaims:
logger.debug("JWT verification disabled, cannot verify requests!")
return {}
if token is None:
raise Unauthorized(token=token, description="access token was not provided")
raise Unauthorized(description="access token was not provided")
claims: JWTClaims = verifier.verify(token)
subject = claims.get("sub", "")

invalid = Unauthorized(token=token, description="invalid sub claim")
invalid = Unauthorized(description="invalid sub claim")
if not subject:
raise invalid
try:
Expand Down

0 comments on commit 062dbee

Please sign in to comment.