From 83f531e680e1eb94b653c933460547fd801b7722 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 8 Dec 2024 10:45:18 +0100 Subject: [PATCH] Be more verbose --- docker/deployer_docker/webhook/gitea-webhook-handler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/deployer_docker/webhook/gitea-webhook-handler.py b/docker/deployer_docker/webhook/gitea-webhook-handler.py index b9f94ba..9a9ea47 100644 --- a/docker/deployer_docker/webhook/gitea-webhook-handler.py +++ b/docker/deployer_docker/webhook/gitea-webhook-handler.py @@ -165,6 +165,7 @@ def require_basic_auth(f): try: auth_type, auth_string = auth_header.split(' ', 1) if auth_type.lower() != 'basic': + logger.info("Invalid authentication header '{auth_type}'") return authenticate() # Decode base64 credentials @@ -172,9 +173,11 @@ def require_basic_auth(f): username, password = credentials.split(':', 1) if not (username == API_USERNAME and password == API_PASSWORD): + logger.info(f"Invalid authentication with username='{username}' and password='{password}'") return authenticate() except (ValueError, base64.binascii.Error): + logger.info("Invalid authentication encoding") return authenticate() return f(*args, **kwargs)