Skip to content

Commit

Permalink
fix: oidc debug extra usage
Browse files Browse the repository at this point in the history
KK-1168

fix: oidc logging

KK-1168
  • Loading branch information
nikomakela committed Aug 28, 2024
1 parent f1265a1 commit a9a3d46
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kukkuu/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def _validate_symmetrically_signed_jwt(self, jwt: JWT):
keys from a server (from a path "/.well-known/openid-configuration").
"""
logger.debug(
"Validating a symmetrically signed test JWT", extra={"jwt_str": str(jwt)}
"Validating a symmetrically signed test JWT",
extra={"jwt_claims": jwt.claims if jwt else None},
)
try:
jwt.validate_issuer()
Expand Down Expand Up @@ -121,13 +122,14 @@ def authenticate_test_user(self, jwt: JWT):
logger.info("Authenticating with a test JWT!")
self._validate_symmetrically_signed_jwt(jwt)
logger.debug(
"The symmetrically signed JWT was valid.", extra={"jwt_str": str(jwt)}
"The symmetrically signed JWT was valid.",
extra={"jwt_claims": jwt.claims if jwt else None},
)
user = get_or_create_user(jwt.claims, oidc=True)
logger.debug(
"The user %s returned from get_or_create_user",
user,
extra={"user_dict": user.__dict__ if user else None},
extra={"user": getattr(user, "__dict__", str(user))},
)
return UserAuthorization(user, jwt.claims)

Expand Down

0 comments on commit a9a3d46

Please sign in to comment.