dataflow-core 2.1.14__py3-none-any.whl → 2.1.14rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- authenticator/dataflowairflowauthenticator.py +9 -3
- {dataflow_core-2.1.14.dist-info → dataflow_core-2.1.14rc1.dist-info}/METADATA +1 -1
- {dataflow_core-2.1.14.dist-info → dataflow_core-2.1.14rc1.dist-info}/RECORD +6 -6
- {dataflow_core-2.1.14.dist-info → dataflow_core-2.1.14rc1.dist-info}/WHEEL +0 -0
- {dataflow_core-2.1.14.dist-info → dataflow_core-2.1.14rc1.dist-info}/entry_points.txt +0 -0
- {dataflow_core-2.1.14.dist-info → dataflow_core-2.1.14rc1.dist-info}/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ from flask_appbuilder.security.views import expose
|
|
|
4
4
|
from flask_login import login_user
|
|
5
5
|
from airflow.www.security import FabAirflowSecurityManagerOverride
|
|
6
6
|
from dataflow.dataflow import Dataflow
|
|
7
|
-
import logging
|
|
7
|
+
import logging, os
|
|
8
8
|
|
|
9
9
|
logging.basicConfig(
|
|
10
10
|
level=logging.INFO,
|
|
@@ -29,9 +29,15 @@ class DataflowAuthDBView(AuthDBView):
|
|
|
29
29
|
|
|
30
30
|
user_details = dataflow.auth(session_id)
|
|
31
31
|
logger.info(f"User details retrieved for: {user_details['user_name']}")
|
|
32
|
+
if os.getenv("RUNTIME"):
|
|
33
|
+
role = self.appbuilder.sm.find_role(user_details.get("base_role", "user").title())
|
|
34
|
+
else:
|
|
35
|
+
role = self.appbuilder.sm.find_role("Admin")
|
|
32
36
|
user = self.appbuilder.sm.find_user(username=user_details['user_name'])
|
|
33
37
|
if user:
|
|
34
|
-
|
|
38
|
+
# Update user role
|
|
39
|
+
user.role = role
|
|
40
|
+
self.appbuilder.sm.update_user(user=user)
|
|
35
41
|
login_user(user, remember=False)
|
|
36
42
|
else:
|
|
37
43
|
user = self.appbuilder.sm.add_user(
|
|
@@ -39,7 +45,7 @@ class DataflowAuthDBView(AuthDBView):
|
|
|
39
45
|
first_name=user_details.get("first_name", ""),
|
|
40
46
|
last_name=user_details.get("last_name", ""),
|
|
41
47
|
email=user_details.get("email", ""),
|
|
42
|
-
role=
|
|
48
|
+
role=role,
|
|
43
49
|
)
|
|
44
50
|
logger.info(f"New user created: {user}")
|
|
45
51
|
if user:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
authenticator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
authenticator/dataflowairflowauthenticator.py,sha256=
|
|
2
|
+
authenticator/dataflowairflowauthenticator.py,sha256=Gp-QR83Dh3-z4kQ3EVBr6bY6FP88ICkok7QOO60pOPg,2467
|
|
3
3
|
authenticator/dataflowhubauthenticator.py,sha256=wI9S-1pcav_WHUL4ibEn-HLhjOtZebQbqXTkcrXXFAA,13463
|
|
4
4
|
authenticator/dataflowsupersetauthenticator.py,sha256=NkAmDaIc-ui-qEolu4xz_UY7P_2g8111hwNjPvAOW1Q,2839
|
|
5
5
|
dataflow/__init__.py,sha256=WTRg8HMpMWSgxYJ9ZGVldx4k07fAbta3mBmZ1hG9mWE,30
|
|
@@ -50,8 +50,8 @@ dataflow/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
50
50
|
dataflow/utils/exceptions.py,sha256=8GRFoYZ5dPGQckVm2znaHpPi0ZAs69fK-RGKukEsapk,4432
|
|
51
51
|
dataflow/utils/get_current_user.py,sha256=4nSO3SPVMZhW-MsIgxR3f9ZzrFaIZIuyrM6hvfyE7PQ,1202
|
|
52
52
|
dataflow/utils/logger.py,sha256=7BFrOq5Oiqn8P4XZbgJzMP5O07d2fpdECbbfsjrUuHw,1213
|
|
53
|
-
dataflow_core-2.1.
|
|
54
|
-
dataflow_core-2.1.
|
|
55
|
-
dataflow_core-2.1.
|
|
56
|
-
dataflow_core-2.1.
|
|
57
|
-
dataflow_core-2.1.
|
|
53
|
+
dataflow_core-2.1.14rc1.dist-info/METADATA,sha256=akGTrwmInmlMGEyHbPlFx7lpwLE8l03du5zHb9UxEOc,373
|
|
54
|
+
dataflow_core-2.1.14rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
dataflow_core-2.1.14rc1.dist-info/entry_points.txt,sha256=ppj_EIbYrJJwCPg1kfdsZk5q1N-Ejfis1neYrnjhO8o,117
|
|
56
|
+
dataflow_core-2.1.14rc1.dist-info/top_level.txt,sha256=SZsUOpSCK9ntUy-3Tusxzf5A2e8ebwD8vouPb1dPt_8,23
|
|
57
|
+
dataflow_core-2.1.14rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|