From 346a060934efe54dd31c885441186e93f1dbf398 Mon Sep 17 00:00:00 2001 From: David Butenhof Date: Fri, 26 May 2023 09:36:27 -0400 Subject: [PATCH] Don't report API Keys as errors PBENCH-1168 Our API Key structure causes the primary OIDC key validation to fail with a `ValueError` exception. This isn't caught by the handler, and propagates to the caller's `except Exception` where it's reported as an error with traceback, which we don't want for a routine key validation. This just adds `ValueError` to the catch to avoid the annoying log message. --- lib/pbench/server/auth/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pbench/server/auth/__init__.py b/lib/pbench/server/auth/__init__.py index d52568dfb1..8f9037c53b 100644 --- a/lib/pbench/server/auth/__init__.py +++ b/lib/pbench/server/auth/__init__.py @@ -376,5 +376,6 @@ def token_introspect(self, token: str) -> JSON: jwt.InvalidSignatureError, jwt.InvalidAudienceError, jwt.InvalidAlgorithmError, + ValueError, ) as exc: raise OpenIDTokenInvalid() from exc