Skip to content

Commit

Permalink
Merge pull request #13 from uwcirg/feature/debugging-epic-auth
Browse files Browse the repository at this point in the history
integration debugging log expansion
  • Loading branch information
pbugni authored Apr 4, 2024
2 parents c8d9468 + e6e046f commit 0b32c89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions confidential_backend/api/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ def route_fhir(relative_path, session_id):
if header_name in request.headers:
upstream_headers[header_name] = request.headers[header_name]

if current_app.config['DEBUG_FHIR_REQUESTS']:
current_app.logger.debug(
f'request headers (incoming to /fhir-router): {request.headers}')
current_app.logger.debug(
f'upstream headers (outgoing to {upstream_fhir_url}): '
f'{upstream_headers} ;;; params: {request.args} ;;; json: {request.json}')

upstream_response = requests.request(
url=upstream_fhir_url,
method=request.method,
Expand Down
1 change: 1 addition & 0 deletions confidential_backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import redis

AUTH_TOKEN_LOG_FILTER = os.getenv("AUTH_TOKEN_LOG_FILTER").split(",") if "AUTH_TOKEN_LOG_FILTER" in os.environ else None
DEBUG_FHIR_REQUESTS = os.getenv("DEBUG_FHIR_REQUESTS", "false").lower() == "true"
DEBUG_OUTPUT_DIR = os.getenv("DEBUG_OUTPUT_DIR", '/tmp')
SERVER_NAME = os.getenv("SERVER_NAME")
SECRET_KEY = os.getenv("SECRET_KEY")
Expand Down

0 comments on commit 0b32c89

Please sign in to comment.