swarmauri_keyprovider_inmemory 0.2.1.dev24__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,49 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_keyprovider_inmemory
3
- Version: 0.2.1.dev24
3
+ Version: 0.11.0.dev1
4
4
  Summary: In-memory key provider for Swarmauri
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,sdk,standards,keyprovider,inmemory,key-management
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: Topic :: Security :: Cryptography
19
15
  Classifier: Intended Audience :: Developers
20
16
  Classifier: Programming Language :: Python
21
17
  Classifier: Programming Language :: Python :: 3
22
18
  Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
23
24
  Requires-Dist: swarmauri_base
24
25
  Requires-Dist: swarmauri_core
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
-
28
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
29
29
 
30
30
  <p align="center">
31
- <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
32
- <img src="https://img.shields.io/pypi/dm/swarmauri_keyprovider_inmemory" alt="PyPI - Downloads"/></a>
31
+ <a href="https://pepy.tech/project/swarmauri_keyprovider_inmemory/">
32
+ <img src="https://static.pepy.tech/badge/swarmauri_keyprovider_inmemory/month" alt="PyPI - Downloads"/></a>
33
33
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_keyprovider_inmemory/">
34
34
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_keyprovider_inmemory.svg"/></a>
35
35
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
36
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_keyprovider_inmemory" alt="PyPI - Python Version"/></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>
37
37
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
38
38
  <img src="https://img.shields.io/pypi/l/swarmauri_keyprovider_inmemory" alt="PyPI - License"/></a>
39
39
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
40
40
  <img src="https://img.shields.io/pypi/v/swarmauri_keyprovider_inmemory?label=swarmauri_keyprovider_inmemory&color=green" alt="PyPI - swarmauri_keyprovider_inmemory"/></a>
41
- </p>
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>
42
43
 
43
- ---
44
+ # Swarmauri In-Memory Key Provider
44
45
 
45
- # Swarmauri In‑Memory Key Provider
46
-
47
- Volatile, in‑memory key provider for Swarmauri. All key material is kept strictly in process memory (no disk writes). Ideal for testing, CI, and ephemeral gateways where persistence is not desired. Not intended for long‑term or production storage of secrets.
46
+ Volatile, in-memory key provider for Swarmauri. All key material is kept strictly in process memory (no disk writes). Ideal for testing, CI, and ephemeral gateways where persistence is not desired. Not intended for long-term or production storage of secrets.
48
47
 
49
48
  ## Installation
50
49
 
@@ -85,7 +84,7 @@ async def main() -> None:
85
84
  # Create a symmetric key kept only in memory
86
85
  spec = KeySpec(
87
86
  klass=KeyClass.symmetric,
88
- alg=KeyAlg.AES256_GCM, # optional hint – not strictly enforced
87
+ alg=KeyAlg.AES256_GCM, # optional hint ? not strictly enforced
89
88
  uses=(KeyUse.ENCRYPT, KeyUse.DECRYPT),
90
89
  export_policy=ExportPolicy.SECRET_WHEN_ALLOWED, # material may be present
91
90
  label="session-key",
@@ -149,3 +148,5 @@ asyncio.run(main())
149
148
  If you want to contribute to swarmauri-sdk, read up on our
150
149
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
151
150
  that will help you get started.
151
+
152
+
@@ -1,24 +1,22 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
2
-
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
3
2
 
4
3
  <p align="center">
5
- <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
6
- <img src="https://img.shields.io/pypi/dm/swarmauri_keyprovider_inmemory" alt="PyPI - Downloads"/></a>
4
+ <a href="https://pepy.tech/project/swarmauri_keyprovider_inmemory/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_keyprovider_inmemory/month" alt="PyPI - Downloads"/></a>
7
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_keyprovider_inmemory/">
8
7
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_keyprovider_inmemory.svg"/></a>
9
8
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
10
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_keyprovider_inmemory" alt="PyPI - Python Version"/></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>
11
10
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
12
11
  <img src="https://img.shields.io/pypi/l/swarmauri_keyprovider_inmemory" alt="PyPI - License"/></a>
13
12
  <a href="https://pypi.org/project/swarmauri_keyprovider_inmemory/">
14
13
  <img src="https://img.shields.io/pypi/v/swarmauri_keyprovider_inmemory?label=swarmauri_keyprovider_inmemory&color=green" alt="PyPI - swarmauri_keyprovider_inmemory"/></a>
15
- </p>
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>
16
16
 
17
- ---
17
+ # Swarmauri In-Memory Key Provider
18
18
 
19
- # Swarmauri In‑Memory Key Provider
20
-
21
- Volatile, in‑memory key provider for Swarmauri. All key material is kept strictly in process memory (no disk writes). Ideal for testing, CI, and ephemeral gateways where persistence is not desired. Not intended for long‑term or production storage of secrets.
19
+ Volatile, in-memory key provider for Swarmauri. All key material is kept strictly in process memory (no disk writes). Ideal for testing, CI, and ephemeral gateways where persistence is not desired. Not intended for long-term or production storage of secrets.
22
20
 
23
21
  ## Installation
24
22
 
@@ -59,7 +57,7 @@ async def main() -> None:
59
57
  # Create a symmetric key kept only in memory
60
58
  spec = KeySpec(
61
59
  klass=KeyClass.symmetric,
62
- alg=KeyAlg.AES256_GCM, # optional hint – not strictly enforced
60
+ alg=KeyAlg.AES256_GCM, # optional hint ? not strictly enforced
63
61
  uses=(KeyUse.ENCRYPT, KeyUse.DECRYPT),
64
62
  export_policy=ExportPolicy.SECRET_WHEN_ALLOWED, # material may be present
65
63
  label="session-key",
@@ -122,4 +120,5 @@ asyncio.run(main())
122
120
 
123
121
  If you want to contribute to swarmauri-sdk, read up on our
124
122
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
125
- that will help you get started.
123
+ that will help you get started.
124
+
@@ -1,24 +1,25 @@
1
1
  [project]
2
2
  name = "swarmauri_keyprovider_inmemory"
3
- version = "0.2.1.dev24"
3
+ version = "0.11.0.dev1"
4
4
  description = "In-memory key provider for Swarmauri"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
7
- requires-python = ">=3.10,<3.13"
7
+ requires-python = ">=3.10,<3.15"
8
8
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
9
9
  classifiers = [
10
10
  "License :: OSI Approved :: Apache Software License",
11
11
  "Natural Language :: English",
12
- "Programming Language :: Python :: 3.10",
13
- "Programming Language :: Python :: 3.11",
14
- "Programming Language :: Python :: 3.12",
15
- "Programming Language :: Python :: 3.13",
16
12
  "Development Status :: 3 - Alpha",
17
13
  "Topic :: Security :: Cryptography",
18
14
  "Intended Audience :: Developers",
19
15
  "Programming Language :: Python",
20
16
  "Programming Language :: Python :: 3",
21
17
  "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
22
23
  ]
23
24
  dependencies = [
24
25
  "swarmauri_core",
@@ -60,7 +60,9 @@ class InMemoryKeyProvider(KeyProviderBase):
60
60
  ),
61
61
  uses=tuple(spec.uses),
62
62
  export_policy=spec.export_policy,
63
- material=(material if spec.export_policy != ExportPolicy.NONE else None),
63
+ material=(
64
+ material if spec.export_policy != ExportPolicy.NONE else None
65
+ ),
64
66
  tags={"label": spec.label or "", **(spec.tags or {})},
65
67
  )
66
68
  self._store.setdefault(kid, {})[version] = ref
@@ -92,7 +94,9 @@ class InMemoryKeyProvider(KeyProviderBase):
92
94
  ),
93
95
  uses=tuple(spec.uses),
94
96
  export_policy=spec.export_policy,
95
- material=(material if spec.export_policy != ExportPolicy.NONE else None),
97
+ material=(
98
+ material if spec.export_policy != ExportPolicy.NONE else None
99
+ ),
96
100
  public=public,
97
101
  tags={"label": spec.label or "", **(spec.tags or {})},
98
102
  )
@@ -122,7 +126,9 @@ class InMemoryKeyProvider(KeyProviderBase):
122
126
  type=base.type,
123
127
  uses=base.uses,
124
128
  export_policy=base.export_policy,
125
- material=(material if base.export_policy != ExportPolicy.NONE else None),
129
+ material=(
130
+ material if base.export_policy != ExportPolicy.NONE else None
131
+ ),
126
132
  public=base.public,
127
133
  tags=base.tags,
128
134
  uri=base.uri,
@@ -130,7 +136,9 @@ class InMemoryKeyProvider(KeyProviderBase):
130
136
  bucket[version] = ref
131
137
  return ref
132
138
 
133
- async def destroy_key(self, kid: str, version: Optional[int] = None) -> bool:
139
+ async def destroy_key(
140
+ self, kid: str, version: Optional[int] = None
141
+ ) -> bool:
134
142
  """Destroy key versions.
135
143
 
136
144
  kid (str): Key identifier.
@@ -178,7 +186,9 @@ class InMemoryKeyProvider(KeyProviderBase):
178
186
  raise KeyError(f"Unknown kid: {kid}")
179
187
  return tuple(sorted(bucket.keys()))
180
188
 
181
- async def get_public_jwk(self, kid: str, version: Optional[int] = None) -> dict:
189
+ async def get_public_jwk(
190
+ self, kid: str, version: Optional[int] = None
191
+ ) -> dict:
182
192
  """Export a public key in JWK format.
183
193
 
184
194
  kid (str): Key identifier.
@@ -203,7 +213,9 @@ class InMemoryKeyProvider(KeyProviderBase):
203
213
  """
204
214
  return secrets.token_bytes(n)
205
215
 
206
- async def hkdf(self, ikm: bytes, *, salt: bytes, info: bytes, length: int) -> bytes:
216
+ async def hkdf(
217
+ self, ikm: bytes, *, salt: bytes, info: bytes, length: int
218
+ ) -> bytes:
207
219
  """Derive key material using HKDF-SHA256.
208
220
 
209
221
  ikm (bytes): Input keying material.
@@ -217,7 +229,9 @@ class InMemoryKeyProvider(KeyProviderBase):
217
229
  okm = b""
218
230
  counter = 1
219
231
  while len(okm) < length:
220
- t = hmac.new(prk, t + info + bytes([counter]), hashlib.sha256).digest()
232
+ t = hmac.new(
233
+ prk, t + info + bytes([counter]), hashlib.sha256
234
+ ).digest()
221
235
  okm += t
222
236
  counter += 1
223
237
  return okm[:length]