From 4f0538f6f4309fac75ec2bbad1eee24635046cdd Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 1 Oct 2020 12:26:37 -0400 Subject: [PATCH] Add additional logging if JWT is invalid --- bento_service_registry/app.py | 7 +++++++ bento_service_registry/package.cfg | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bento_service_registry/app.py b/bento_service_registry/app.py index b5c510e..957d71a 100644 --- a/bento_service_registry/app.py +++ b/bento_service_registry/app.py @@ -87,6 +87,13 @@ def get_service(service_artifact): if r.status_code != 200: print(f"[{SERVICE_NAME}] Non-200 status code on {service_artifact}: {r.status_code}\n" f" Content: {r.text}", file=sys.stderr, flush=True) + + # If we have the special case where we got a JWT error from the proxy script, we can safely print out + # headers for debugging, since the JWT leaked isn't valid anyway. + if "invalid jwt" in r.text: + print(f" Encountered auth error, tried to use header: {auth_header}", + file=sys.stderr, flush=True) + return None except requests.exceptions.Timeout: diff --git a/bento_service_registry/package.cfg b/bento_service_registry/package.cfg index 2e4ed75..f8a0d02 100644 --- a/bento_service_registry/package.cfg +++ b/bento_service_registry/package.cfg @@ -1,5 +1,5 @@ [package] name = bento_service_registry -version = 0.4.0 +version = 0.4.1 authors = David Lougheed author_emails = david.lougheed@mail.mcgill.ca