dataflow-core 2.0.1__py3-none-any.whl → 2.0.2__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.

Potentially problematic release.


This version of dataflow-core might be problematic. Click here for more details.

authenticator/__init__.py CHANGED
@@ -0,0 +1,3 @@
1
+ from .dataflowhubauthenticator import DataflowHubAuthenticator
2
+ from .dataflowairflowauthenticator import DataflowAirflowAuthenticator
3
+ from .dataflowsupersetauthenticator import DataflowSupersetAuthenticator
File without changes
@@ -4,7 +4,7 @@ from .package.models import (
4
4
  user as m_user,
5
5
  session as m_session
6
6
  )
7
-
7
+ from datetime import datetime, timedelta, timezone
8
8
  import uuid
9
9
  from jupyterhub.auth import Authenticator
10
10
 
@@ -34,17 +34,26 @@ class DataflowHubAuthenticator(Authenticator):
34
34
  query = self.db.query(m_user.User)
35
35
  user = query.filter(m_user.User.user_name == username).first()
36
36
 
37
- if user is not None:
38
- # check if password is correct
39
- if user.password != password:
40
- return None
41
-
42
- # generate session_id
37
+ if user is None or user.password != password:
38
+ return None
39
+
40
+ # Check if the user already has an existing session
41
+ existing_session = (
42
+ self.db.query(m_session.Session_table)
43
+ .filter(m_session.Session_table.user_id == str(user.user_id))
44
+ .first()
45
+ )
46
+
47
+ if existing_session:
48
+ # Reuse the existing session_id
49
+ session_id = existing_session.session_id
50
+ else:
51
+ # Generate a new session_id
43
52
  session_id = self.generate_session_id()
44
53
  query = self.db.query(m_session.Session_table)
45
54
  isSession = query.filter(m_session.Session_table.session_id == session_id).first()
46
55
 
47
- # if session_id is already exists in the database, generate a new one
56
+ # If session_id(uuid string) already exists in the database, generate a new one
48
57
  while isSession is not None:
49
58
  session_id = self.generate_session_id()
50
59
  isSession = query.filter(m_session.Session_table.session_id == session_id).first()
@@ -55,12 +64,10 @@ class DataflowHubAuthenticator(Authenticator):
55
64
  self.db.commit()
56
65
  self.db.refresh(db_item)
57
66
 
58
- # return user dictionary and set cookie
59
- handler.set_cookie("dataflow_session", session_id)
60
- user_dict = {"name": username, "session_id": session_id}
61
- return user_dict
62
- else:
63
- return None
67
+ expires = datetime.now(timezone.utc) + timedelta(days=365)
68
+ handler.set_cookie("dataflow_session", session_id, expires=expires)
69
+ user_dict = {"name": username, "session_id": session_id}
70
+ return user_dict
64
71
 
65
72
  except Exception as e:
66
73
  return None
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
dataflow/__init__.py CHANGED
@@ -0,0 +1 @@
1
+ from .dataflow import Dataflow
dataflow/configuration.py CHANGED
File without changes
dataflow/dataflow.py CHANGED
File without changes
File without changes
File without changes
File without changes
dataflow/models/user.py CHANGED
File without changes
File without changes
File without changes
@@ -1,11 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dataflow-core
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Dataflow core package
5
+ Home-page: UNKNOWN
5
6
  Author: Dataflow
6
- Author-email:
7
+ Author-email: UNKNOWN
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
7
10
  Requires-Dist: sqlalchemy
8
11
  Requires-Dist: boto3
9
12
  Requires-Dist: psycopg2-binary
10
13
  Requires-Dist: pymysql
11
14
 
15
+ UNKNOWN
16
+
17
+
@@ -1,6 +1,6 @@
1
- authenticator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1
+ authenticator/__init__.py,sha256=A7EfIoO2e0vyt9TXGHPOeS-THDC0KEiaQHdkdzXUVH8,206
2
2
  authenticator/dataflowairflowauthenticator.py,sha256=wzd807UAb5ojIVMO8FVHQnNi3Tc78NjkhbDSfzgo2Qg,4790
3
- authenticator/dataflowhubauthenticator.py,sha256=jsxpB_NZz3n_FGFJzW0yfXR3i-KK1dsVVIQVIN84Pfc,2540
3
+ authenticator/dataflowhubauthenticator.py,sha256=UgjZiXSP-hlbciyJVb-QIgUjS3_EgX0WIvbhD563rVw,2918
4
4
  authenticator/dataflowsupersetauthenticator.py,sha256=UNgem68eg8G-1uAok2yVc6NvUeXaJ-9MPmdpfSyr9Jg,2759
5
5
  authenticator/package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  authenticator/package/configuration.py,sha256=7To6XwH1eESiYp39eqPcswXWwrdBUdPF6xN6WnazOF0,663
@@ -8,7 +8,7 @@ authenticator/package/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
8
8
  authenticator/package/models/database.py,sha256=y09pqnglsBBtDZlyhvqDAlpUSFovwAzBAi6jOYl_XNk,896
9
9
  authenticator/package/models/session.py,sha256=j6PhbrTMJxEkeDT4Vf5SqGtM_LI_vZy9O4vxn6LtIbc,495
10
10
  authenticator/package/models/user.py,sha256=IYogp_vt0yDBG5i936uNPjgTis77VYPzITn9XpQUIyw,788
11
- dataflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ dataflow/__init__.py,sha256=WTRg8HMpMWSgxYJ9ZGVldx4k07fAbta3mBmZ1hG9mWE,30
12
12
  dataflow/configuration.py,sha256=7To6XwH1eESiYp39eqPcswXWwrdBUdPF6xN6WnazOF0,663
13
13
  dataflow/dataflow.py,sha256=CAn47BkdUwmTWe-kTSFKfRZYnjx29MG0SrYsXpvSkuo,3726
14
14
  dataflow/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -17,8 +17,8 @@ dataflow/models/session.py,sha256=C9crPh6ZDFuL27hZ_zhUXDZZ0ZiIDE8ZD19O_4WPw-I,48
17
17
  dataflow/models/user.py,sha256=IYogp_vt0yDBG5i936uNPjgTis77VYPzITn9XpQUIyw,788
18
18
  dataflow/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  dataflow/utils/aws_secrets_manager.py,sha256=FqHm3YRynv580FpFsS0RfI1MSGY5aq-V7t4blpiYsS4,2588
20
- dataflow_core-2.0.1.dist-info/METADATA,sha256=a-wXk53ZIMavCWlfKh6S1G_t6yq3qHpyW7eFe9ix_K8,222
21
- dataflow_core-2.0.1.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
22
- dataflow_core-2.0.1.dist-info/entry_points.txt,sha256=ppj_EIbYrJJwCPg1kfdsZk5q1N-Ejfis1neYrnjhO8o,117
23
- dataflow_core-2.0.1.dist-info/top_level.txt,sha256=SZsUOpSCK9ntUy-3Tusxzf5A2e8ebwD8vouPb1dPt_8,23
24
- dataflow_core-2.0.1.dist-info/RECORD,,
20
+ dataflow_core-2.0.2.dist-info/METADATA,sha256=AoFhbUSzibF-_tP491Gr_baKMXM2tChz1o2QUF0RbvE,293
21
+ dataflow_core-2.0.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
22
+ dataflow_core-2.0.2.dist-info/entry_points.txt,sha256=lDLG2MMWlKfkqsVWFghF7sx-yEvM2xqMmHE7rMTysE4,118
23
+ dataflow_core-2.0.2.dist-info/top_level.txt,sha256=SZsUOpSCK9ntUy-3Tusxzf5A2e8ebwD8vouPb1dPt_8,23
24
+ dataflow_core-2.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.1.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,2 +1,3 @@
1
1
  [jupyterhub.authenticators]
2
2
  dataflow_authenticator = authenticator.dataflowhubauthenticator:DataflowHubAuthenticator
3
+