From a9a3d4611a1e57ea5e4ad0a8f1f613dbb005125c Mon Sep 17 00:00:00 2001 From: Niko Lindroos Date: Wed, 28 Aug 2024 14:49:57 +0300 Subject: [PATCH] fix: oidc debug extra usage KK-1168 fix: oidc logging KK-1168 --- kukkuu/oidc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kukkuu/oidc.py b/kukkuu/oidc.py index 00f02ebb..c95b7699 100644 --- a/kukkuu/oidc.py +++ b/kukkuu/oidc.py @@ -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() @@ -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)