Skip to content

Commit b5d393c

Browse files
[v3-0-test] Move access_denied_message webserver config to fab (#50208) (#50544)
* Move access_denied_message webserver config to fab (#50208) * Move access_denied_message webserver config to fab * Fix CI * Update to fab 2.0.3 * Change core to 3.0.2 * fab depends on apache-airflow 3.0.2 * Fix CI (cherry picked from commit a18a1df) * Fix CI * docs: conditionally render section‐move links in sections‐and‐options include (#50582) * Add condition for section move in docs * docs(fab): add Sphinx anchors for access_denied_message and expose_hostname config options (cherry picked from commit 39f215f) --------- Co-authored-by: Ankit Chaurasia <8670962+sunank200@users.noreply.github.com>
1 parent fdc7067 commit b5d393c

File tree

13 files changed

+41
-19
lines changed

13 files changed

+41
-19
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
@@ -1727,13 +1727,6 @@ operators:
17271727
webserver:
17281728
description: ~
17291729
options:
1730-
access_denied_message:
1731-
description: |
1732-
The message displayed when a user attempts to execute actions beyond their authorised privileges.
1733-
version_added: 2.7.0
1734-
type: string
1735-
example: ~
1736-
default: "Access is Denied"
17371730
secret_key:
17381731
description: |
17391732
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
@@ -356,6 +356,7 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
356356
("api", "access_logfile"): ("webserver", "access_logfile", "3.0"),
357357
("triggerer", "capacity"): ("triggerer", "default_capacity", "3.0"),
358358
("api", "expose_config"): ("webserver", "expose_config", "3.0.1"),
359+
("fab", "access_denied_message"): ("webserver", "access_denied_message", "3.0.2"),
359360
}
360361

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

dev/breeze/tests/test_packages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def test_validate_provider_info_with_schema():
265265
"provider_id, min_version",
266266
[
267267
("amazon", "2.9.0"),
268-
("fab", "3.0.0"),
268+
("fab", "3.0.2"),
269269
],
270270
)
271271
def test_get_min_airflow_version(provider_id: str, min_version: str):

devel-common/src/sphinx_exts/includes/sections-and-options.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@
101101
{{ "-" * (deprecated_option_name + " (Deprecated)")|length }}
102102

103103
.. deprecated:: {{ since_version }}
104+
{% if new_section_name in configs %}
104105
The option has been moved to :ref:`{{ new_section_name }}.{{ new_option_name }} <config:{{ new_section_name }}__{{ new_option_name }}>`
106+
{% else %}
107+
The option has been moved to ``{{ new_section_name }}.{{ new_option_name }}``
108+
{% endif %}
105109
{% endfor %}
106110
{% endif %}
107111

providers/fab/docs/configurations-ref.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
under the License.
1717
1818
.. include:: /../../../devel-common/src/sphinx_exts/includes/providers-configurations-ref.rst
19+
20+
.. _config:fab__access_denied_message:
21+
.. _config:fab__expose_hostname:
22+
1923
.. include:: /../../../devel-common/src/sphinx_exts/includes/sections-and-options.rst

providers/fab/provider.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ source-date-epoch: 1741121873
3232

3333
# note that those versions are maintained by release manager - do not update them manually
3434
versions:
35+
- 2.0.3
36+
- 2.0.2
3537
- 2.0.1
3638
- 2.0.0
3739
- 1.5.2
@@ -55,6 +57,13 @@ config:
5557
fab:
5658
description: This section contains configs specific to FAB provider.
5759
options:
60+
access_denied_message:
61+
description: |
62+
The message displayed when a user attempts to execute actions beyond their authorised privileges.
63+
version_added: 2.0.3
64+
type: string
65+
example: ~
66+
default: "Access is Denied"
5867
auth_rate_limited:
5968
description: |
6069
Boolean for enabling rate limiting on authentication endpoints.

providers/fab/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
2525

2626
[project]
2727
name = "apache-airflow-providers-fab"
28-
version = "2.0.1"
28+
version = "2.0.3"
2929
description = "Provider package apache-airflow-providers-fab for Apache Airflow"
3030
readme = "README.rst"
3131
authors = [
@@ -57,7 +57,7 @@ license-files = ["NOTICE", "*/LICENSE*"]
5757
# Make sure to run ``breeze static-checks --type update-providers-dependencies --all-files``
5858
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
5959
dependencies = [
60-
"apache-airflow>=3.0.0",
60+
"apache-airflow>=3.0.2",
6161
"apache-airflow-providers-common-compat>=1.2.1",
6262
# Blinker use for signals in Flask, this is an optional dependency in Flask 2.2 and lower.
6363
# In Flask 2.3 it becomes a mandatory dependency, and flask signals are always available.
@@ -127,8 +127,8 @@ apache-airflow-providers-common-sql = {workspace = true}
127127
apache-airflow-providers-standard = {workspace = true}
128128

129129
[project.urls]
130-
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.1"
131-
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.1/changelog.html"
130+
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3"
131+
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3/changelog.html"
132132
"Bug Tracker" = "https://github.com/apache/airflow/issues"
133133
"Source Code" = "https://github.com/apache/airflow"
134134
"Slack Chat" = "https://s.apache.org/airflow-slack"

providers/fab/src/airflow/providers/fab/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030
__all__ = ["__version__"]
3131

32-
__version__ = "2.0.1"
32+
__version__ = "2.0.3"
3333

3434
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35-
"3.0.0"
35+
"3.0.2"
3636
):
3737
raise RuntimeError(
38-
f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.0+"
38+
f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.2+"
3939
)

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):

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ packages = []
209209
"apache-airflow-providers-exasol>=4.6.1"
210210
]
211211
"fab" = [
212-
"apache-airflow-providers-fab>=2.0.2" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
212+
"apache-airflow-providers-fab>=2.0.3" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
213213
]
214214
"facebook" = [
215215
"apache-airflow-providers-facebook>=3.7.0"
@@ -418,7 +418,7 @@ packages = []
418418
"apache-airflow-providers-edge3>=1.0.0",
419419
"apache-airflow-providers-elasticsearch>=5.5.2",
420420
"apache-airflow-providers-exasol>=4.6.1",
421-
"apache-airflow-providers-fab>=2.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
421+
"apache-airflow-providers-fab>=2.0.3", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
422422
"apache-airflow-providers-facebook>=3.7.0",
423423
"apache-airflow-providers-ftp>=3.12.0",
424424
"apache-airflow-providers-git>=0.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py

scripts/ci/pre_commit/update_airflow_pyproject_toml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# minimum versions for compatibility with Airflow 3
5757
MIN_VERSION_OVERRIDE: dict[str, Version] = {
5858
"amazon": parse_version("2.1.3"),
59-
"fab": parse_version("2.0.2"),
59+
"fab": parse_version("2.0.3"),
6060
"openlineage": parse_version("2.1.3"),
6161
"git": parse_version("0.0.2"),
6262
"common.messaging": parse_version("1.0.1"),

0 commit comments

Comments
 (0)