vincbeck commented on code in PR #33901:
URL: https://github.com/apache/airflow/pull/33901#discussion_r1312153721
##########
airflow/www/extensions/init_appbuilder.py:
##########
@@ -660,15 +661,24 @@ def _process_inner_views(self):
def init_appbuilder(app) -> AirflowAppBuilder:
"""Init `Flask App Builder
<https://flask-appbuilder.readthedocs.io/en/latest/>`__."""
+ from airflow.auth.managers.fab.security_manager.override import
FabAirflowSecurityManagerOverride
from airflow.www.security import AirflowSecurityManager
- security_manager_class = app.config.get("SECURITY_MANAGER_CLASS") or
AirflowSecurityManager
+ sm_from_config = app.config.get("SECURITY_MANAGER_CLASS")
+ if sm_from_config:
+ if not issubclass(sm_from_config, AirflowSecurityManager):
+ raise Exception(
+ """Your CUSTOM_SECURITY_MANAGER must extend
FabAirflowSecurityManagerOverride,
+ not FAB's own security manager."""
+ )
+ if not issubclass(sm_from_config, FabAirflowSecurityManagerOverride):
+ warnings.warn(
+ "Please make your custom security manager inherit from "
+ "FabAirflowSecurityManagerOverride instead of
AirflowSecurityManager.",
+ DeprecationWarning,
+ )
Review Comment:
True, I have always wondered if it was needed to provide the app as argument
of the auth manager constructor. Maybe this one tells us, it is indeed needed
:).
If we want to do that, we need to change a bit how we instantiate the auth
manager but I think it should be okay
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]