forked from qzmanalytics/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuperset_config.py
50 lines (43 loc) · 1.47 KB
/
superset_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
from flask_appbuilder.security.manager import AUTH_OAUTH
SECRET_KEY = os.getenv("SUPERSET_SECRET_KEY")
SQLALCHEMY_DATABASE_URI = os.getenv("SUPERSET_CONNECTION_STRING")
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Gamma"
AUTH_ROLES_SYNC_AT_LOGIN = True
# A mapping from LDAP/OAUTH group names to FAB roles
AUTH_ROLES_MAPPING = {
"an-brk": ["brk"],
"an-admin": ["Admin"],
"an-brk-hr": ["brk-hr"],
"an-akv": ["akv"],
"an-flk": ["flk"],
"an-akv-hr": ["akv-hr"],
"an-flk-hr": ["flk-hr"],
}
OAUTH_PROVIDERS = [
{
"name": "azure",
"icon": "fa-windows",
"token_key": "access_token",
"remote_app": {
"client_id": os.getenv("AZURE_ID"),
"client_secret": os.getenv("AZURE_SECRET"),
"api_base_url": "https://login.microsoftonline.com/"
+ os.getenv("TENANT_ID")
+ "/oauth2",
"client_kwargs": {
"scope": "User.read name preferred_username email profile upn groups",
"resource": os.getenv("AZURE_ID"),
},
"request_token_url": None,
"access_token_url": "https://login.microsoftonline.com/"
+ os.getenv("TENANT_ID")
+ "/oauth2/token",
"authorize_url": "https://login.microsoftonline.com/"
+ os.getenv("TENANT_ID")
+ "/oauth2/authorize",
},
}
]