This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new f971ba2f2f SECURITY_MANAGER_CLASS should be a referrence to class, not
a string (#33690)
f971ba2f2f is described below
commit f971ba2f2f9703d0e1954e52aaded52a83c2f844
Author: Michalosu <[email protected]>
AuthorDate: Thu Aug 24 17:28:41 2023 +0200
SECURITY_MANAGER_CLASS should be a referrence to class, not a string
(#33690)
---
docs/apache-airflow/security/webserver.rst | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/docs/apache-airflow/security/webserver.rst
b/docs/apache-airflow/security/webserver.rst
index 9e4c947ee7..d990afa4d4 100644
--- a/docs/apache-airflow/security/webserver.rst
+++ b/docs/apache-airflow/security/webserver.rst
@@ -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"],
@@ -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.