Skip to content

Commit

Permalink
Add back get_url_for_login in security manager (#33660)
Browse files Browse the repository at this point in the history
* Add back `get_url_for_login` in security manager

* Rename FAB_SECURITY_MANAGER_CLASS to SECURITY_MANAGER_CLASS

(cherry picked from commit b1cdab3)
  • Loading branch information
vincbeck authored and ephraimbuddy committed Aug 28, 2023
1 parent 4befd33 commit 37ac1e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions airflow/www/extensions/init_appbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ def security_converge(self, dry=False) -> dict:
def get_url_for_login_with(self, next_url: str | None = None) -> str:
return get_auth_manager().get_url_login(next_url=next_url)

@property
def get_url_for_login(self):
return get_auth_manager().get_url_login()

@property
def get_url_for_index(self):
return url_for(f"{self.indexview.endpoint}.{self.indexview.default_view}")
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/security/webserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Here is an example of what you might have in your webserver_config.py:
AUTH_ROLES_SYNC_AT_LOGIN = True # Checks roles on every login
AUTH_USER_REGISTRATION = True # allow users who are not already in the FAB DB to register
# Make sure to replace this with the path to your security manager class
FAB_SECURITY_MANAGER_CLASS = "your_module.your_security_manager_class"
SECURITY_MANAGER_CLASS = "your_module.your_security_manager_class"
AUTH_ROLES_MAPPING = {
"Viewer": ["Viewer"],
"Admin": ["Admin"],
Expand Down

0 comments on commit 37ac1e8

Please sign in to comment.