You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by pi...@apache.org on 2025/05/14 13:49:55 UTC

(airflow) branch v3-0-test updated: [v3-0-test] Move access_denied_message webserver config to fab (#50208) (#50544)

This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new b5d393ca429 [v3-0-test] Move access_denied_message webserver config to fab (#50208) (#50544)
b5d393ca429 is described below

commit b5d393ca429f6d30667c62ba724944755ba8984e
Author: Pierre Jeambrun <pi...@gmail.com>
AuthorDate: Wed May 14 15:49:49 2025 +0200

    [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 a18a1df03eeb773f5b87dc54663e1f58733f1a63)
    
    * 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 39f215f88edbdf00ce7589732d02a7215671c621)
    
    ---------
    
    Co-authored-by: Ankit Chaurasia <86...@users.noreply.github.com>
---
 airflow-core/src/airflow/cli/commands/config_command.py        | 4 ++++
 airflow-core/src/airflow/config_templates/config.yml           | 7 -------
 airflow-core/src/airflow/configuration.py                      | 1 +
 dev/breeze/tests/test_packages.py                              | 2 +-
 devel-common/src/sphinx_exts/includes/sections-and-options.rst | 4 ++++
 providers/fab/docs/configurations-ref.rst                      | 4 ++++
 providers/fab/provider.yaml                                    | 9 +++++++++
 providers/fab/pyproject.toml                                   | 8 ++++----
 providers/fab/src/airflow/providers/fab/__init__.py            | 6 +++---
 providers/fab/src/airflow/providers/fab/get_provider_info.py   | 7 +++++++
 providers/fab/src/airflow/providers/fab/www/auth.py            | 2 +-
 pyproject.toml                                                 | 4 ++--
 scripts/ci/pre_commit/update_airflow_pyproject_toml.py         | 2 +-
 13 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py
index 0f5c5df5ba1..843adcd87db 100644
--- a/airflow-core/src/airflow/cli/commands/config_command.py
+++ b/airflow-core/src/airflow/cli/commands/config_command.py
@@ -379,6 +379,10 @@ CONFIGS_CHANGES = [
         config=ConfigParameter("webserver", "session_lifetime_minutes"),
         renamed_to=ConfigParameter("fab", "session_lifetime_minutes"),
     ),
+    ConfigChange(
+        config=ConfigParameter("webserver", "access_denied_message"),
+        renamed_to=ConfigParameter("fab", "access_denied_message"),
+    ),
     ConfigChange(
         config=ConfigParameter("webserver", "base_url"),
         renamed_to=ConfigParameter("api", "base_url"),
diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml
index 50a849a099d..f88d0f02e5f 100644
--- a/airflow-core/src/airflow/config_templates/config.yml
+++ b/airflow-core/src/airflow/config_templates/config.yml
@@ -1727,13 +1727,6 @@ operators:
 webserver:
   description: ~
   options:
-    access_denied_message:
-      description: |
-        The message displayed when a user attempts to execute actions beyond their authorised privileges.
-      version_added: 2.7.0
-      type: string
-      example: ~
-      default: "Access is Denied"
     secret_key:
       description: |
         Secret key used to run your api server. It should be as random as possible. However, when running
diff --git a/airflow-core/src/airflow/configuration.py b/airflow-core/src/airflow/configuration.py
index ff214b3138a..385b87e5f92 100644
--- a/airflow-core/src/airflow/configuration.py
+++ b/airflow-core/src/airflow/configuration.py
@@ -356,6 +356,7 @@ class AirflowConfigParser(ConfigParser):
         ("api", "access_logfile"): ("webserver", "access_logfile", "3.0"),
         ("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"),
     }
 
     # A mapping of new section -> (old section, since_version).
diff --git a/dev/breeze/tests/test_packages.py b/dev/breeze/tests/test_packages.py
index e3a963b6eec..3d85c6b80df 100644
--- a/dev/breeze/tests/test_packages.py
+++ b/dev/breeze/tests/test_packages.py
@@ -265,7 +265,7 @@ def test_validate_provider_info_with_schema():
     "provider_id, min_version",
     [
         ("amazon", "2.9.0"),
-        ("fab", "3.0.0"),
+        ("fab", "3.0.2"),
     ],
 )
 def test_get_min_airflow_version(provider_id: str, min_version: str):
diff --git a/devel-common/src/sphinx_exts/includes/sections-and-options.rst b/devel-common/src/sphinx_exts/includes/sections-and-options.rst
index f9bbf5c83d5..e04383c8c55 100644
--- a/devel-common/src/sphinx_exts/includes/sections-and-options.rst
+++ b/devel-common/src/sphinx_exts/includes/sections-and-options.rst
@@ -101,7 +101,11 @@
     {{ "-" * (deprecated_option_name + " (Deprecated)")|length }}
 
     .. deprecated:: {{ since_version }}
+    {% if new_section_name in configs %}
      The option has been moved to :ref:`{{ new_section_name }}.{{ new_option_name }} <config:{{ new_section_name }}__{{ new_option_name }}>`
+    {% else %}
+     The option has been moved to ``{{ new_section_name }}.{{ new_option_name }}``
+    {% endif %}
     {% endfor %}
     {% endif %}
 
diff --git a/providers/fab/docs/configurations-ref.rst b/providers/fab/docs/configurations-ref.rst
index a52b21b2e56..c75f9b18b44 100644
--- a/providers/fab/docs/configurations-ref.rst
+++ b/providers/fab/docs/configurations-ref.rst
@@ -16,4 +16,8 @@
     under the License.
 
 .. include:: /../../../devel-common/src/sphinx_exts/includes/providers-configurations-ref.rst
+
+.. _config:fab__access_denied_message:
+.. _config:fab__expose_hostname:
+
 .. include:: /../../../devel-common/src/sphinx_exts/includes/sections-and-options.rst
diff --git a/providers/fab/provider.yaml b/providers/fab/provider.yaml
index b3d4ca30173..b34d7264ac7 100644
--- a/providers/fab/provider.yaml
+++ b/providers/fab/provider.yaml
@@ -32,6 +32,8 @@ source-date-epoch: 1741121873
 
 # note that those versions are maintained by release manager - do not update them manually
 versions:
+  - 2.0.3
+  - 2.0.2
   - 2.0.1
   - 2.0.0
   - 1.5.2
@@ -55,6 +57,13 @@ config:
   fab:
     description: This section contains configs specific to FAB provider.
     options:
+      access_denied_message:
+        description: |
+          The message displayed when a user attempts to execute actions beyond their authorised privileges.
+        version_added: 2.0.3
+        type: string
+        example: ~
+        default: "Access is Denied"
       auth_rate_limited:
         description: |
           Boolean for enabling rate limiting on authentication endpoints.
diff --git a/providers/fab/pyproject.toml b/providers/fab/pyproject.toml
index 66d7541f0c1..e75eaa30eaa 100644
--- a/providers/fab/pyproject.toml
+++ b/providers/fab/pyproject.toml
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
 
 [project]
 name = "apache-airflow-providers-fab"
-version = "2.0.1"
+version = "2.0.3"
 description = "Provider package apache-airflow-providers-fab for Apache Airflow"
 readme = "README.rst"
 authors = [
@@ -57,7 +57,7 @@ license-files = ["NOTICE", "*/LICENSE*"]
 # Make sure to run ``breeze static-checks --type update-providers-dependencies --all-files``
 # After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
 dependencies = [
-    "apache-airflow>=3.0.0",
+    "apache-airflow>=3.0.2",
     "apache-airflow-providers-common-compat>=1.2.1",
     # Blinker use for signals in Flask, this is an optional dependency in Flask 2.2 and lower.
     # 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}
 apache-airflow-providers-standard = {workspace = true}
 
 [project.urls]
-"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.1"
-"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.1/changelog.html"
+"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3"
+"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.3/changelog.html"
 "Bug Tracker" = "https://github.com/apache/airflow/issues"
 "Source Code" = "https://github.com/apache/airflow"
 "Slack Chat" = "https://s.apache.org/airflow-slack"
diff --git a/providers/fab/src/airflow/providers/fab/__init__.py b/providers/fab/src/airflow/providers/fab/__init__.py
index 419b410f680..daa81fc76b6 100644
--- a/providers/fab/src/airflow/providers/fab/__init__.py
+++ b/providers/fab/src/airflow/providers/fab/__init__.py
@@ -29,11 +29,11 @@ from airflow import __version__ as airflow_version
 
 __all__ = ["__version__"]
 
-__version__ = "2.0.1"
+__version__ = "2.0.3"
 
 if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
-    "3.0.0"
+    "3.0.2"
 ):
     raise RuntimeError(
-        f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.0+"
+        f"The package `apache-airflow-providers-fab:{__version__}` needs Apache Airflow 3.0.2+"
     )
diff --git a/providers/fab/src/airflow/providers/fab/get_provider_info.py b/providers/fab/src/airflow/providers/fab/get_provider_info.py
index 924dfca466a..4baf5b88011 100644
--- a/providers/fab/src/airflow/providers/fab/get_provider_info.py
+++ b/providers/fab/src/airflow/providers/fab/get_provider_info.py
@@ -30,6 +30,13 @@ def get_provider_info():
             "fab": {
                 "description": "This section contains configs specific to FAB provider.",
                 "options": {
+                    "access_denied_message": {
+                        "description": "The message displayed when a user attempts to execute actions beyond their authorised privileges.\n",
+                        "version_added": "2.0.3",
+                        "type": "string",
+                        "example": None,
+                        "default": "Access is Denied",
+                    },
                     "auth_rate_limited": {
                         "description": "Boolean for enabling rate limiting on authentication endpoints.\n",
                         "version_added": "1.0.2",
diff --git a/providers/fab/src/airflow/providers/fab/www/auth.py b/providers/fab/src/airflow/providers/fab/www/auth.py
index 0ac83def619..204bab48040 100644
--- a/providers/fab/src/airflow/providers/fab/www/auth.py
+++ b/providers/fab/src/airflow/providers/fab/www/auth.py
@@ -61,7 +61,7 @@ log = logging.getLogger(__name__)
 
 
 def get_access_denied_message():
-    return conf.get("webserver", "access_denied_message")
+    return conf.get("fab", "access_denied_message")
 
 
 def has_access_with_pk(f):
diff --git a/pyproject.toml b/pyproject.toml
index 924ec0ddb13..682021ace0b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -209,7 +209,7 @@ packages = []
     "apache-airflow-providers-exasol>=4.6.1"
 ]
 "fab" = [
-    "apache-airflow-providers-fab>=2.0.2" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-fab>=2.0.3" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
 ]
 "facebook" = [
     "apache-airflow-providers-facebook>=3.7.0"
@@ -418,7 +418,7 @@ packages = []
     "apache-airflow-providers-edge3>=1.0.0",
     "apache-airflow-providers-elasticsearch>=5.5.2",
     "apache-airflow-providers-exasol>=4.6.1",
-    "apache-airflow-providers-fab>=2.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-fab>=2.0.3", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
     "apache-airflow-providers-facebook>=3.7.0",
     "apache-airflow-providers-ftp>=3.12.0",
     "apache-airflow-providers-git>=0.0.2", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
diff --git a/scripts/ci/pre_commit/update_airflow_pyproject_toml.py b/scripts/ci/pre_commit/update_airflow_pyproject_toml.py
index 8bf1fb2ca2f..9f77d05deb1 100755
--- a/scripts/ci/pre_commit/update_airflow_pyproject_toml.py
+++ b/scripts/ci/pre_commit/update_airflow_pyproject_toml.py
@@ -56,7 +56,7 @@ CUT_OFF_TIMEDELTA = timedelta(days=6 * 30)
 # minimum versions for compatibility with Airflow 3
 MIN_VERSION_OVERRIDE: dict[str, Version] = {
     "amazon": parse_version("2.1.3"),
-    "fab": parse_version("2.0.2"),
+    "fab": parse_version("2.0.3"),
     "openlineage": parse_version("2.1.3"),
     "git": parse_version("0.0.2"),
     "common.messaging": parse_version("1.0.1"),