Skip to content

Commit

Permalink
Hostname was "redacted", not "redact"; remove it when there is no con…
Browse files Browse the repository at this point in the history
…text (apache#39037)
  • Loading branch information
jedcunningham authored and utkarsharma2 committed Apr 22, 2024
1 parent a4cb8c2 commit 9ab0419
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions airflow/www/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
),
Expand All @@ -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.",
),
Expand All @@ -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.",
Expand Down

0 comments on commit 9ab0419

Please sign in to comment.