From ef3d2051f7b5ecb46306386f88cc462a93704d1b Mon Sep 17 00:00:00 2001 From: Jed Cunningham Date: Mon, 15 Apr 2024 10:33:56 -0600 Subject: [PATCH] Hostname was "redacted", not "redact"; remove it when there is no context --- airflow/www/auth.py | 6 ++---- airflow/www/views.py | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/airflow/www/auth.py b/airflow/www/auth.py index 1b3753f87d9e..f3f36e05e346 100644 --- a/airflow/www/auth.py +++ b/airflow/www/auth.py @@ -167,7 +167,7 @@ def _has_access(*, is_authorized: bool, func: Callable, args, kwargs): return ( render_template( "airflow/no_roles_permissions.html", - hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "redact", + hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "", logout_url=get_auth_manager().get_url_logout(), ), 403, @@ -234,9 +234,7 @@ def decorated(*args, **kwargs): return ( render_template( "airflow/no_roles_permissions.html", - hostname=get_hostname() - if conf.getboolean("webserver", "EXPOSE_HOSTNAME") - else "redact", + hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "", logout_url=get_auth_manager().get_url_logout(), ), 403, diff --git a/airflow/www/views.py b/airflow/www/views.py index ce0727ab4d4b..5bdebe5d9163 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -632,7 +632,7 @@ def not_found(error): return ( render_template( "airflow/error.html", - hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "redact", + hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "", status_code=404, error_message="Page cannot be found.", ), @@ -645,7 +645,7 @@ def method_not_allowed(error): return ( render_template( "airflow/error.html", - hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "redact", + hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "", status_code=405, error_message="Received an invalid request.", ), @@ -659,11 +659,11 @@ def show_traceback(error): return ( render_template( "airflow/traceback.html", - python_version=sys.version.split(" ")[0] if is_logged_in else "redact", - airflow_version=version if is_logged_in else "redact", + python_version=sys.version.split(" ")[0] if is_logged_in else "redacted", + airflow_version=version if is_logged_in else "redacted", hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") and is_logged_in - else "redact", + else "redacted", info=traceback.format_exc() if conf.getboolean("webserver", "EXPOSE_STACKTRACE") and is_logged_in else "Error! Please contact server admin.",