dataflow-core 2.0.0__tar.gz → 2.0.2__tar.gz

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.

Files changed (31) hide show
  1. dataflow-core-2.0.2/PKG-INFO +10 -0
  2. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/README.md +0 -0
  3. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/__init__.py +0 -0
  4. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/dataflowairflowauthenticator.py +0 -0
  5. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/dataflowhubauthenticator.py +21 -14
  6. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/dataflowsupersetauthenticator.py +0 -0
  7. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/__init__.py +0 -0
  8. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/configuration.py +0 -0
  9. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/models/__init__.py +0 -0
  10. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/models/database.py +0 -0
  11. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/models/session.py +0 -0
  12. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/authenticator/package/models/user.py +0 -0
  13. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/__init__.py +0 -0
  14. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/configuration.py +0 -0
  15. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/dataflow.py +0 -0
  16. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/models/__init__.py +0 -0
  17. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/models/database.py +0 -0
  18. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/models/session.py +0 -0
  19. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/models/user.py +0 -0
  20. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/utils/__init__.py +0 -0
  21. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow/utils/aws_secrets_manager.py +0 -0
  22. dataflow-core-2.0.2/dataflow_core.egg-info/PKG-INFO +10 -0
  23. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow_core.egg-info/SOURCES.txt +0 -0
  24. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow_core.egg-info/dependency_links.txt +0 -0
  25. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow_core.egg-info/entry_points.txt +1 -0
  26. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow_core.egg-info/requires.txt +0 -0
  27. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/dataflow_core.egg-info/top_level.txt +0 -0
  28. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/setup.cfg +0 -0
  29. {dataflow_core-2.0.0 → dataflow-core-2.0.2}/setup.py +2 -2
  30. dataflow_core-2.0.0/PKG-INFO +0 -10
  31. dataflow_core-2.0.0/dataflow_core.egg-info/PKG-INFO +0 -10
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 1.0
2
+ Name: dataflow-core
3
+ Version: 2.0.2
4
+ Summary: Dataflow core package
5
+ Home-page: UNKNOWN
6
+ Author: Dataflow
7
+ Author-email: UNKNOWN
8
+ License: UNKNOWN
9
+ Description: UNKNOWN
10
+ Platform: UNKNOWN
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
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 1.0
2
+ Name: dataflow-core
3
+ Version: 2.0.2
4
+ Summary: Dataflow core package
5
+ Home-page: UNKNOWN
6
+ Author: Dataflow
7
+ Author-email: UNKNOWN
8
+ License: UNKNOWN
9
+ Description: UNKNOWN
10
+ Platform: UNKNOWN
@@ -1,2 +1,3 @@
1
1
  [jupyterhub.authenticators]
2
2
  dataflow_authenticator = authenticator.dataflowhubauthenticator:DataflowHubAuthenticator
3
+
File without changes
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="dataflow-core",
5
- version="2.0.0",
5
+ version="2.0.2",
6
6
  packages=find_packages(exclude=["tests", "tests.*"]),
7
7
  include_package_data=True,
8
8
  package_data={},
@@ -20,4 +20,4 @@ setup(
20
20
  'dataflow_authenticator = authenticator.dataflowhubauthenticator:DataflowHubAuthenticator',
21
21
  ],
22
22
  },
23
- )
23
+ )
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: dataflow-core
3
- Version: 2.0.0
4
- Summary: Dataflow core package
5
- Author: Dataflow
6
- Author-email:
7
- Requires-Dist: sqlalchemy
8
- Requires-Dist: boto3
9
- Requires-Dist: psycopg2-binary
10
- Requires-Dist: pymysql
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: dataflow-core
3
- Version: 2.0.0
4
- Summary: Dataflow core package
5
- Author: Dataflow
6
- Author-email:
7
- Requires-Dist: sqlalchemy
8
- Requires-Dist: boto3
9
- Requires-Dist: psycopg2-binary
10
- Requires-Dist: pymysql