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

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new a18a1df03ee Move access_denied_message webserver config to fab (#50208)
a18a1df03ee is described below

commit a18a1df03eeb773f5b87dc54663e1f58733f1a63
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Tue May 13 16:40:40 2025 +0200

    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
---
 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 +-
 providers/fab/provider.yaml                                  | 8 ++++++++
 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 +-
 11 files changed, 32 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 5cb51a56ebd..d2bd4aa605d 100644
--- a/airflow-core/src/airflow/config_templates/config.yml
+++ b/airflow-core/src/airflow/config_templates/config.yml
@@ -1693,13 +1693,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 3a054b41b6a..fcf0c56920f 100644
--- a/dev/breeze/tests/test_packages.py
+++ b/dev/breeze/tests/test_packages.py
@@ -250,7 +250,7 @@ def test_validate_provider_info_with_schema():
     "provider_id, min_version",
     [
         ("amazon", "2.10.0"),
-        ("fab", "3.0.0"),
+        ("fab", "3.0.2"),
     ],
 )
 def test_get_min_airflow_version(provider_id: str, min_version: str):
diff --git a/providers/fab/provider.yaml b/providers/fab/provider.yaml
index 200b3eeb4aa..3647b871446 100644
--- a/providers/fab/provider.yaml
+++ b/providers/fab/provider.yaml
@@ -35,6 +35,7 @@ source-date-epoch: 1745478857
 # In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider 
have
 # to be done in the same PR
 versions:
+  - 2.0.3
   - 2.0.2
   - 2.0.1
   - 2.0.0
@@ -59,6 +60,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.2
+        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 c0d10c9069d..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.2"
+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.2";
-"Changelog" = 
"https://airflow.apache.org/docs/apache-airflow-providers-fab/2.0.2/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 1d874a87f0c..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.2"
+__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 6558807420a..acbcd35d210 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.2",
+                        "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 ec15287b06e..de40fd1322b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -212,7 +212,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"
@@ -422,7 +422,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 7c6e6dbe7c2..ff0f0b58e82 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.3.0"),
     "git": parse_version("0.0.2"),
     "common.messaging": parse_version("1.0.1"),

Reply via email to