Skip to content

Commit e5e91ac

Browse files
Move access_denied_message webserver config to fab
1 parent e9c49d6 commit e5e91ac

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

airflow-core/src/airflow/cli/commands/config_command.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ def message(self) -> str | None:
379379
config=ConfigParameter("webserver", "session_lifetime_minutes"),
380380
renamed_to=ConfigParameter("fab", "session_lifetime_minutes"),
381381
),
382+
ConfigChange(
383+
config=ConfigParameter("webserver", "access_denied_message"),
384+
renamed_to=ConfigParameter("fab", "access_denied_message"),
385+
),
382386
ConfigChange(
383387
config=ConfigParameter("webserver", "base_url"),
384388
renamed_to=ConfigParameter("api", "base_url"),

airflow-core/src/airflow/config_templates/config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,13 +1684,6 @@ operators:
16841684
webserver:
16851685
description: ~
16861686
options:
1687-
access_denied_message:
1688-
description: |
1689-
The message displayed when a user attempts to execute actions beyond their authorised privileges.
1690-
version_added: 2.7.0
1691-
type: string
1692-
example: ~
1693-
default: "Access is Denied"
16941687
secret_key:
16951688
description: |
16961689
Secret key used to run your api server. It should be as random as possible. However, when running

airflow-core/src/airflow/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
355355
("api", "ssl_key"): ("webserver", "web_server_ssl_key", "3.0"),
356356
("api", "access_logfile"): ("webserver", "access_logfile", "3.0"),
357357
("triggerer", "capacity"): ("triggerer", "default_capacity", "3.0"),
358+
("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.1"),
358359
}
359360

360361
# A mapping of new section -> (old section, since_version).

providers/fab/provider.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ config:
5656
fab:
5757
description: This section contains configs specific to FAB provider.
5858
options:
59+
access_denied_message:
60+
description: |
61+
The message displayed when a user attempts to execute actions beyond their authorised privileges.
62+
version_added: 2.0.3
63+
type: string
64+
example: ~
65+
default: "Access is Denied"
5966
auth_rate_limited:
6067
description: |
6168
Boolean for enabling rate limiting on authentication endpoints.

providers/fab/src/airflow/providers/fab/get_provider_info.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ def get_provider_info():
3030
"fab": {
3131
"description": "This section contains configs specific to FAB provider.",
3232
"options": {
33+
"access_denied_message": {
34+
"description": "The message displayed when a user attempts to execute actions beyond their authorised privileges.\n",
35+
"version_added": "2.0.3",
36+
"type": "string",
37+
"example": None,
38+
"default": "Access is Denied",
39+
},
3340
"auth_rate_limited": {
3441
"description": "Boolean for enabling rate limiting on authentication endpoints.\n",
3542
"version_added": "1.0.2",

providers/fab/src/airflow/providers/fab/www/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262

6363
def get_access_denied_message():
64-
return conf.get("webserver", "access_denied_message")
64+
return conf.get("fab", "access_denied_message")
6565

6666

6767
def has_access_with_pk(f):

0 commit comments

Comments
 (0)