Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove is_in_fab in FAB auth manager #47465

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ class FabAuthManager(BaseAuthManager[User]):

appbuilder: AirflowAppBuilder | None = None

is_in_fab: bool = False
"""
Whether the instance is run in FAB or Fastapi.
Can be deleted once the Airflow 2 legacy UI is removed.
"""

def init(self) -> None:
"""Run operations when Airflow is initializing."""
if self.appbuilder:
Expand Down Expand Up @@ -420,15 +414,7 @@ def security_manager(self) -> FabAirflowSecurityManagerOverride:

def get_url_login(self, **kwargs) -> str:
"""Return the login page url."""
if self.is_in_fab:
if not self.security_manager.auth_view:
raise AirflowException("`auth_view` not defined in the security manager.")
if next_url := kwargs.get("next_url"):
return url_for(f"{self.security_manager.auth_view.endpoint}.login", next=next_url)
else:
return url_for(f"{self.security_manager.auth_view.endpoint}.login")
else:
return f"{self.apiserver_endpoint}/auth/login"
return f"{self.apiserver_endpoint}/auth/login"

def get_url_logout(self):
"""Return the logout page url."""
Expand Down