swarmauri_middleware_session 0.8.0.dev47__tar.gz → 0.11.0.dev1__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.
@@ -1,50 +1,45 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_middleware_session
3
- Version: 0.8.0.dev47
3
+ Version: 0.11.0.dev1
4
4
  Summary: Session middleware for maintaining session state across requests.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,sdk,standards,middleware,session
8
8
  Author: Jacob Stewart
9
9
  Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
10
+ Requires-Python: >=3.10,<3.15
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Natural Language :: English
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
13
  Classifier: Development Status :: 3 - Alpha
18
14
  Classifier: Programming Language :: Python
19
15
  Classifier: Programming Language :: Python :: 3
20
16
  Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
21
22
  Requires-Dist: fastapi
22
23
  Requires-Dist: swarmauri_base
23
24
  Requires-Dist: swarmauri_core
24
25
  Requires-Dist: swarmauri_standard
25
26
  Description-Content-Type: text/markdown
26
27
 
27
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
28
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
28
29
 
29
30
  <p align="center">
30
- <a href="https://pypi.org/project/swarmauri_middleware_session/">
31
- <img src="https://img.shields.io/pypi/dm/swarmauri_middleware_session" alt="PyPI - Downloads"/>
32
- </a>
31
+ <a href="https://pepy.tech/project/swarmauri_middleware_session/">
32
+ <img src="https://static.pepy.tech/badge/swarmauri_middleware_session/month" alt="PyPI - Downloads"/></a>
33
33
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session/">
34
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session.svg"/>
35
- </a>
34
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session.svg"/></a>
36
35
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
37
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_middleware_session" alt="PyPI - Python Version"/>
38
- </a>
36
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
39
37
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
40
- <img src="https://img.shields.io/pypi/l/swarmauri_middleware_session" alt="PyPI - License"/>
41
- </a>
38
+ <img src="https://img.shields.io/pypi/l/swarmauri_middleware_session" alt="PyPI - License"/></a>
42
39
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
43
- <img src="https://img.shields.io/pypi/v/swarmauri_middleware_session?label=swarmauri_middleware_session&color=green" alt="PyPI - swarmauri_middleware_session"/>
44
- </a>
45
- </p>
46
-
47
- ---
40
+ <img src="https://img.shields.io/pypi/v/swarmauri_middleware_session?label=swarmauri_middleware_session&color=green" alt="PyPI - swarmauri_middleware_session"/></a>
41
+ <a href="https://discord.gg/N4UpBuQv8T">
42
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
48
43
 
49
44
  # Swarmauri Middleware Session
50
45
 
@@ -137,3 +132,5 @@ of state across requests.
137
132
 
138
133
  If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
139
134
 
135
+
136
+
@@ -1,24 +1,18 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
2
2
 
3
3
  <p align="center">
4
- <a href="https://pypi.org/project/swarmauri_middleware_session/">
5
- <img src="https://img.shields.io/pypi/dm/swarmauri_middleware_session" alt="PyPI - Downloads"/>
6
- </a>
4
+ <a href="https://pepy.tech/project/swarmauri_middleware_session/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_middleware_session/month" alt="PyPI - Downloads"/></a>
7
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session/">
8
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session.svg"/>
9
- </a>
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_middleware_session.svg"/></a>
10
8
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
11
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_middleware_session" alt="PyPI - Python Version"/>
12
- </a>
9
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
13
10
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
14
- <img src="https://img.shields.io/pypi/l/swarmauri_middleware_session" alt="PyPI - License"/>
15
- </a>
11
+ <img src="https://img.shields.io/pypi/l/swarmauri_middleware_session" alt="PyPI - License"/></a>
16
12
  <a href="https://pypi.org/project/swarmauri_middleware_session/">
17
- <img src="https://img.shields.io/pypi/v/swarmauri_middleware_session?label=swarmauri_middleware_session&color=green" alt="PyPI - swarmauri_middleware_session"/>
18
- </a>
19
- </p>
20
-
21
- ---
13
+ <img src="https://img.shields.io/pypi/v/swarmauri_middleware_session?label=swarmauri_middleware_session&color=green" alt="PyPI - swarmauri_middleware_session"/></a>
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
22
16
 
23
17
  # Swarmauri Middleware Session
24
18
 
@@ -110,3 +104,5 @@ of state across requests.
110
104
  ## Want to help?
111
105
 
112
106
  If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
107
+
108
+
@@ -1,22 +1,23 @@
1
1
  [project]
2
2
  name = "swarmauri_middleware_session"
3
- version = "0.8.0.dev47"
3
+ version = "0.11.0.dev1"
4
4
  description = "Session middleware for maintaining session state across requests."
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
7
7
  repository = "http://github.com/swarmauri/swarmauri-sdk/pkgs/pkgs/swarmauri_middleware_session/"
8
- requires-python = ">=3.10,<3.13"
8
+ requires-python = ">=3.10,<3.15"
9
9
  classifiers = [
10
10
  "License :: OSI Approved :: Apache Software License",
11
11
  "Natural Language :: English",
12
+ "Development Status :: 3 - Alpha",
13
+ "Programming Language :: Python",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3 :: Only",
12
16
  "Programming Language :: Python :: 3.10",
13
17
  "Programming Language :: Python :: 3.11",
14
18
  "Programming Language :: Python :: 3.12",
15
19
  "Programming Language :: Python :: 3.13",
16
- "Development Status :: 3 - Alpha",
17
- "Programming Language :: Python",
18
- "Programming Language :: Python :: 3",
19
- "Programming Language :: Python :: 3 :: Only"
20
+ "Programming Language :: Python :: 3.14",
20
21
  ]
21
22
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
22
23
  dependencies = [
@@ -70,7 +71,7 @@ dev = [
70
71
  "pytest-xdist>=3.6.1",
71
72
  "pytest-json-report>=1.5.0",
72
73
  "python-dotenv",
73
- "requests>=2.32.3",
74
+ "httpx>=0.27",
74
75
  "flake8>=7.0",
75
76
  "pytest-timeout>=2.3.1",
76
77
  "ruff>=0.9.9",
@@ -20,7 +20,8 @@ class SessionMiddleware(MiddlewareBase, ComponentBase):
20
20
  session_storage: Dict[str, Dict] = {} # Storage for session data
21
21
  session_header: str = "X-Session-ID" # Header name for session ID
22
22
  session_cookie: str = "session_id" # Cookie name for session ID
23
- max_age: int = 3600 # Default session expiration in seconds
23
+ max_age: int = 3600 # Default session expiration in
24
+ seconds
24
25
 
25
26
  Methods:
26
27
  dispatch: Implements the core middleware dispatch logic
@@ -40,7 +41,9 @@ class SessionMiddleware(MiddlewareBase, ComponentBase):
40
41
  **kwargs: Any,
41
42
  ) -> None:
42
43
  super().__init__(**kwargs)
43
- self.session_storage = session_storage if session_storage is not None else {}
44
+ self.session_storage = (
45
+ session_storage if session_storage is not None else {}
46
+ )
44
47
  self.session_header = session_header or "X-Session-ID"
45
48
  self.session_cookie = session_cookie or "session_id"
46
49
  self.max_age = max_age
@@ -48,10 +51,14 @@ class SessionMiddleware(MiddlewareBase, ComponentBase):
48
51
  async def dispatch(
49
52
  self, request: Request, call_next: Callable[[Request], Any]
50
53
  ) -> Any:
51
- """Dispatches the request to the next middleware in the chain while maintaining session state.
54
+ """
55
+ Dispatches the request to the next middleware in the chain while
56
+ maintaining session state.
52
57
 
53
- This method processes the request to check for an existing session or create a new one.
54
- It ensures that session state is maintained across requests by setting appropriate
58
+ This method processes the request to check for an existing session or
59
+ create a new one.
60
+ It ensures that session state is maintained across requests by setting
61
+ appropriate
55
62
  headers or cookies.
56
63
 
57
64
  Args:
@@ -71,7 +78,10 @@ class SessionMiddleware(MiddlewareBase, ComponentBase):
71
78
  # Session exists - update session storage
72
79
  if session_id not in self.session_storage:
73
80
  logger.warning(
74
- f"Session ID {session_id} exists in header but not in storage"
81
+ (
82
+ f"Session ID {session_id} exists in header but not in "
83
+ f"storage"
84
+ )
75
85
  )
76
86
  # Create new session data
77
87
  self.session_storage[session_id] = {}
@@ -105,7 +115,8 @@ class SessionMiddleware(MiddlewareBase, ComponentBase):
105
115
  """Generates a unique session ID.
106
116
 
107
117
  This method creates a new unique identifier for the session. You
108
- can override this method to implement custom session ID generation logic.
118
+ can override this method to implement custom session ID generation
119
+ logic.
109
120
 
110
121
  Returns:
111
122
  A unique session ID as a string