Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions airflow-core/src/airflow/cli/commands/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ def message(self) -> str | None:
config=ConfigParameter("webserver", "access_denied_message"),
renamed_to=ConfigParameter("fab", "access_denied_message"),
),
ConfigChange(
config=ConfigParameter("webserver", "expose_hostname"),
renamed_to=ConfigParameter("fab", "expose_hostname"),
),
ConfigChange(
config=ConfigParameter("webserver", "base_url"),
renamed_to=ConfigParameter("api", "base_url"),
Expand Down
7 changes: 0 additions & 7 deletions airflow-core/src/airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1741,13 +1741,6 @@ webserver:
sensitive: true
example: ~
default: "{SECRET_KEY}"
expose_hostname:
description: |
Expose hostname in the web server
version_added: 1.10.8
type: string
example: ~
default: "False"
grid_view_sorting_order:
description: |
Sorting order in grid view. Valid values are: ``topological``, ``hierarchical_alphabetical``
Expand Down
1 change: 1 addition & 0 deletions airflow-core/src/airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
("triggerer", "capacity"): ("triggerer", "default_capacity", "3.0"),
("api", "expose_config"): ("webserver", "expose_config", "3.0.1"),
("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.2"),
("fab", "expose_hostname"): ("webserver", "expose_hostname", "3.0.2"),
}

# A mapping of new section -> (old section, since_version).
Expand Down
7 changes: 7 additions & 0 deletions providers/fab/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ config:
type: string
example: ~
default: "Access is Denied"
expose_hostname:
description: |
Expose hostname in the web server
version_added: 2.0.3
type: string
example: ~
default: "False"
auth_rate_limited:
description: |
Boolean for enabling rate limiting on authentication endpoints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ def get_provider_info():
"example": None,
"default": "Access is Denied",
},
"expose_hostname": {
"description": "Expose hostname in the web server\n",
"version_added": "2.0.3",
"type": "string",
"example": None,
"default": "False",
},
"auth_rate_limited": {
"description": "Boolean for enabling rate limiting on authentication endpoints.\n",
"version_added": "1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions providers/fab/src/airflow/providers/fab/www/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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 "",
hostname=get_hostname() if conf.getboolean("fab", "EXPOSE_HOSTNAME") else "",
logout_url=get_fab_auth_manager().get_url_logout(),
),
403,
Expand Down Expand Up @@ -217,7 +217,7 @@ def decorated(*args, **kwargs):
return (
render_template(
"airflow/no_roles_permissions.html",
hostname=get_hostname() if conf.getboolean("webserver", "EXPOSE_HOSTNAME") else "",
hostname=get_hostname() if conf.getboolean("fab", "EXPOSE_HOSTNAME") else "",
logout_url=get_auth_manager().get_url_logout(),
),
403,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def init_jinja_globals(app, enable_plugins: bool):
elif server_timezone == "utc":
server_timezone = "UTC"

expose_hostname = conf.getboolean("webserver", "EXPOSE_HOSTNAME")
expose_hostname = conf.getboolean("fab", "EXPOSE_HOSTNAME")
hostname = get_hostname() if expose_hostname else "redact"

try:
Expand Down