Skip to content

Commit

Permalink
SECURITY_MANAGER_CLASS should be a referrence to class, not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
Michalosu committed Aug 24, 2023
1 parent ec776de commit 59f92eb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/apache-airflow/security/webserver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ Here is an example of what you might have in your webserver_config.py:

.. code-block:: python
from airflow.www.security import AirflowSecurityManager
from flask_appbuilder.security.manager import AUTH_OAUTH
import os
AUTH_TYPE = AUTH_OAUTH
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
SECURITY_MANAGER_CLASS = "your_module.your_security_manager_class"
AUTH_ROLES_MAPPING = {
"Viewer": ["Viewer"],
"Admin": ["Admin"],
Expand All @@ -199,6 +199,14 @@ Here is an example of what you might have in your webserver_config.py:
},
]
class CustomSecurityManager(AirflowSecurityManager):
pass
# Make sure to replace this with your own implementation of AirflowSecurityManager class
SECURITY_MANAGER_CLASS = CustomSecurityManager
Here is an example of defining a custom security manager.
This class must be available in Python's path, and could be defined in
webserver_config.py itself if you wish.
Expand Down

0 comments on commit 59f92eb

Please sign in to comment.