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

vincbeck 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 8c25304f04 Add back FAB backends used in webserver config (#35302)
8c25304f04 is described below

commit 8c25304f047dd77dde6802155a894ce9a15481a8
Author: Jed Cunningham <[email protected]>
AuthorDate: Wed Nov 1 06:14:47 2023 -0600

    Add back FAB backends used in webserver config (#35302)
---
 airflow/www/fab_security/manager.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/airflow/www/fab_security/manager.py 
b/airflow/www/fab_security/manager.py
index c4eba0d019..1405425a41 100644
--- a/airflow/www/fab_security/manager.py
+++ b/airflow/www/fab_security/manager.py
@@ -63,6 +63,26 @@ if TYPE_CHECKING:
 # Copyright 2013, Daniel Vaz Gaspar
 log = logging.getLogger(__name__)
 
+__lazy_imports = {
+    "AUTH_DB": "flask_appbuilder.const",
+    "AUTH_LDAP": "flask_appbuilder.const",
+    "LOGMSG_WAR_SEC_LOGIN_FAILED": "flask_appbuilder.const",
+}
+
+
+def __getattr__(name: str):
+    # PEP-562: Lazy loaded attributes on python modules
+    path = __lazy_imports.get(name)
+    if not path:
+        raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
+
+    from airflow.utils.module_loading import import_string
+
+    val = import_string(f"{path}.{name}")
+    # Store for next time
+    globals()[name] = val
+    return val
+
 
 def _oauth_tokengetter(token=None):
     """Return the current user oauth token from session cookie."""

Reply via email to