From 835219d4409a87740ec2c6d77cec41d19afde6e9 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Wed, 23 Oct 2024 15:12:35 +0200 Subject: [PATCH] Upgrade FAB to 4.5.1 (#43251) FAB 4.5.1 has been released in September with a few small fixes. This change updates fab to 4.5.1 including changing the rate limiter creation that is vendored in. It has been changed in https://github.com/dpgaspar/Flask-AppBuilder/pull/2254 and relased in 4.5.1. That's the only dfference in security manager between 4.5.0 and 4.5.1. --- airflow/www/security_manager.py | 5 +++-- dev/breeze/tests/test_packages.py | 6 +++--- generated/provider_dependencies.json | 2 +- providers/src/airflow/providers/fab/provider.yaml | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/airflow/www/security_manager.py b/airflow/www/security_manager.py index 77fd653b5f416..cd2f9563fe219 100644 --- a/airflow/www/security_manager.py +++ b/airflow/www/security_manager.py @@ -108,8 +108,9 @@ def before_request(): g.user = get_auth_manager().get_user() def create_limiter(self) -> Limiter: - limiter = Limiter(key_func=get_remote_address) - limiter.init_app(self.appbuilder.get_app) + app = self.appbuilder.get_app + limiter = Limiter(key_func=app.config.get("RATELIMIT_KEY_FUNC", get_remote_address)) + limiter.init_app(app) return limiter def register_views(self): diff --git a/dev/breeze/tests/test_packages.py b/dev/breeze/tests/test_packages.py index e315a40ed1c22..6cac54a14c31a 100644 --- a/dev/breeze/tests/test_packages.py +++ b/dev/breeze/tests/test_packages.py @@ -169,7 +169,7 @@ def test_get_documentation_package_path(): """ "apache-airflow-providers-common-compat>=1.2.1", "apache-airflow>=2.9.0", - "flask-appbuilder==4.5.0", + "flask-appbuilder==4.5.1", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", @@ -183,7 +183,7 @@ def test_get_documentation_package_path(): """ "apache-airflow-providers-common-compat>=1.2.1.dev0", "apache-airflow>=2.9.0.dev0", - "flask-appbuilder==4.5.0", + "flask-appbuilder==4.5.1", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", @@ -197,7 +197,7 @@ def test_get_documentation_package_path(): """ "apache-airflow-providers-common-compat>=1.2.1b0", "apache-airflow>=2.9.0b0", - "flask-appbuilder==4.5.0", + "flask-appbuilder==4.5.1", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index d2c69029cc08b..a5c97c51237a0 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -571,7 +571,7 @@ "deps": [ "apache-airflow-providers-common-compat>=1.2.1", "apache-airflow>=2.9.0", - "flask-appbuilder==4.5.0", + "flask-appbuilder==4.5.1", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", diff --git a/providers/src/airflow/providers/fab/provider.yaml b/providers/src/airflow/providers/fab/provider.yaml index 4b72c0ab9a5ee..86b0598df4533 100644 --- a/providers/src/airflow/providers/fab/provider.yaml +++ b/providers/src/airflow/providers/fab/provider.yaml @@ -55,7 +55,7 @@ dependencies: # Every time we update FAB version here, please make sure that you review the classes and models in # `airflow/providers/fab/auth_manager/security_manager/override.py` with their upstream counterparts. # In particular, make sure any breaking changes, for example any new methods, are accounted for. - - flask-appbuilder==4.5.0 + - flask-appbuilder==4.5.1 - flask-login>=0.6.2 - google-re2>=1.0 - jmespath>=0.7.0