Skip to content

Commit

Permalink
Add additional logging if JWT is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Oct 1, 2020
1 parent 6daa5c8 commit 4f0538f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bento_service_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion bento_service_registry/package.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = bento_service_registry
version = 0.4.0
version = 0.4.1
authors = David Lougheed
author_emails = [email protected]

0 comments on commit 4f0538f

Please sign in to comment.