This is an automated email from the ASF dual-hosted git repository.
jasonliu 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 82cc5c18914 [v3-0-test] Add guards for registering middlewares from
plugins (#55399) (#55425)
82cc5c18914 is described below
commit 82cc5c1891432ae797948f31f2450fe3f80033d2
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Sep 9 14:11:08 2025 -0500
[v3-0-test] Add guards for registering middlewares from plugins (#55399)
(#55425)
(cherry picked from commit 05860a3f628fa8f8b0734942bf5aa568fa9b5332)
Co-authored-by: Pierre Jeambrun <[email protected]>
---
airflow-core/src/airflow/api_fastapi/app.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/airflow-core/src/airflow/api_fastapi/app.py
b/airflow-core/src/airflow/api_fastapi/app.py
index 884ca51e044..99db8aa9db8 100644
--- a/airflow-core/src/airflow/api_fastapi/app.py
+++ b/airflow-core/src/airflow/api_fastapi/app.py
@@ -196,5 +196,9 @@ def init_plugins(app: FastAPI) -> None:
log.error("'middleware' key is missing for the fastapi middleware:
%s", name)
continue
+ if not callable(middleware):
+ log.error("'middleware' value for %s is should be callable: %s",
name, middleware)
+ continue
+
log.debug("Adding root middleware %s", name)
app.add_middleware(middleware, *args, **kwargs)