Skip to content

Commit

Permalink
fix inheritance checking of security manager in FabAuthManager (#36343)
Browse files Browse the repository at this point in the history
* fix inheritance check of security manager in FabAuthManager
  • Loading branch information
kn3609571 committed Dec 21, 2023
1 parent 0b32613 commit 2be7149
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions airflow/providers/fab/auth_manager/fab_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,13 @@ def security_manager(self) -> FabAirflowSecurityManagerOverride:
from airflow.providers.fab.auth_manager.security_manager.override import (
FabAirflowSecurityManagerOverride,
)
from airflow.www.security import AirflowSecurityManager
from airflow.www.security_manager import AirflowSecurityManagerV2

sm_from_config = self.appbuilder.get_app.config.get("SECURITY_MANAGER_CLASS")
if sm_from_config:
if not issubclass(sm_from_config, AirflowSecurityManager):
if not issubclass(sm_from_config, AirflowSecurityManagerV2):
raise Exception(
"""Your CUSTOM_SECURITY_MANAGER must extend FabAirflowSecurityManagerOverride,
"""Your CUSTOM_SECURITY_MANAGER must extend AirflowSecurityManagerV2,
not FAB's own security manager."""
)
if not issubclass(sm_from_config, FabAirflowSecurityManagerOverride):
Expand Down

0 comments on commit 2be7149

Please sign in to comment.