MediaSigner 0.6.5.dev19__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.
@@ -2,7 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import AsyncIterable, Iterable, Mapping, MutableMapping, Optional, Sequence
5
+ from typing import (
6
+ AsyncIterable,
7
+ Iterable,
8
+ Mapping,
9
+ MutableMapping,
10
+ Optional,
11
+ Sequence,
12
+ )
6
13
 
7
14
  from swarmauri_base.ComponentBase import ComponentBase, ResourceTypes
8
15
  from swarmauri_base.signing.SigningBase import SigningBase
@@ -39,7 +46,9 @@ except Exception: # pragma: no cover - plugin optional
39
46
 
40
47
 
41
48
  class MediaSigner(ComponentBase):
42
- """High-level async facade that routes signing calls to registered plugins."""
49
+ """
50
+ High-level async facade that routes signing calls to registered plugins.
51
+ """
43
52
 
44
53
  resource: Optional[str] = ResourceTypes.SIGNING.value
45
54
  type: str = "MediaSigner"
@@ -88,7 +97,9 @@ class MediaSigner(ComponentBase):
88
97
  alg: Optional[Alg] = None,
89
98
  opts: Optional[Mapping[str, object]] = None,
90
99
  ) -> Sequence[Signature]:
91
- return await self._resolve(fmt).sign_bytes(key, payload, alg=alg, opts=opts)
100
+ return await self._resolve(fmt).sign_bytes(
101
+ key, payload, alg=alg, opts=opts
102
+ )
92
103
 
93
104
  async def sign_digest(
94
105
  self,
@@ -99,7 +110,9 @@ class MediaSigner(ComponentBase):
99
110
  alg: Optional[Alg] = None,
100
111
  opts: Optional[Mapping[str, object]] = None,
101
112
  ) -> Sequence[Signature]:
102
- return await self._resolve(fmt).sign_digest(key, digest, alg=alg, opts=opts)
113
+ return await self._resolve(fmt).sign_digest(
114
+ key, digest, alg=alg, opts=opts
115
+ )
103
116
 
104
117
  async def verify_bytes(
105
118
  self,
@@ -162,7 +175,9 @@ class MediaSigner(ComponentBase):
162
175
  alg: Optional[Alg] = None,
163
176
  opts: Optional[Mapping[str, object]] = None,
164
177
  ) -> Sequence[Signature]:
165
- return await self._resolve(fmt).sign_stream(key, payload, alg=alg, opts=opts)
178
+ return await self._resolve(fmt).sign_stream(
179
+ key, payload, alg=alg, opts=opts
180
+ )
166
181
 
167
182
  async def verify_envelope(
168
183
  self,
@@ -69,7 +69,9 @@ def _signature_from_json(data: Mapping[str, Any]) -> MutableMapping[str, Any]:
69
69
  and isinstance(value[0], Mapping)
70
70
  and "b64" in value[0]
71
71
  ):
72
- result[key] = tuple(base64.b64decode(str(entry["b64"])) for entry in value)
72
+ result[key] = tuple(
73
+ base64.b64decode(str(entry["b64"])) for entry in value
74
+ )
73
75
  else:
74
76
  result[key] = value
75
77
  return result
@@ -81,13 +83,17 @@ def _build_parser() -> argparse.ArgumentParser:
81
83
  )
82
84
  subparsers = parser.add_subparsers(dest="command", required=True)
83
85
 
84
- list_parser = subparsers.add_parser("list", help="List discovered signing formats")
86
+ list_parser = subparsers.add_parser(
87
+ "list", help="List discovered signing formats"
88
+ )
85
89
  list_parser.set_defaults(func=_cmd_list)
86
90
 
87
91
  supports_parser = subparsers.add_parser(
88
92
  "supports", help="Describe plugin capabilities"
89
93
  )
90
- supports_parser.add_argument("format", help="Format token, e.g. jws or cms")
94
+ supports_parser.add_argument(
95
+ "format", help="Format token, e.g. jws or cms"
96
+ )
91
97
  supports_parser.add_argument(
92
98
  "--key-ref", dest="key_ref", help="Optional key reference string"
93
99
  )
@@ -97,15 +103,23 @@ def _build_parser() -> argparse.ArgumentParser:
97
103
  "sign-bytes", help="Sign raw bytes using a plugin"
98
104
  )
99
105
  sign_parser.add_argument("format", help="Format token")
100
- sign_parser.add_argument("--alg", dest="alg", help="Algorithm hint for the signer")
101
106
  sign_parser.add_argument(
102
- "--key", required=True, help="Path to a JSON file describing the KeyRef"
107
+ "--alg", dest="alg", help="Algorithm hint for the signer"
108
+ )
109
+ sign_parser.add_argument(
110
+ "--key",
111
+ required=True,
112
+ help="Path to a JSON file describing the KeyRef",
113
+ )
114
+ sign_parser.add_argument(
115
+ "--input", required=True, help="Payload file to sign"
103
116
  )
104
- sign_parser.add_argument("--input", required=True, help="Payload file to sign")
105
117
  sign_parser.add_argument(
106
118
  "--output", help="Write signatures to this file (defaults to stdout)"
107
119
  )
108
- sign_parser.add_argument("--opts", help="Path to JSON options passed to the signer")
120
+ sign_parser.add_argument(
121
+ "--opts", help="Path to JSON options passed to the signer"
122
+ )
109
123
  sign_parser.set_defaults(func=_cmd_sign_bytes)
110
124
 
111
125
  verify_parser = subparsers.add_parser(
@@ -163,7 +177,9 @@ async def _cmd_verify_bytes(args: argparse.Namespace) -> int:
163
177
  if not isinstance(sig_payload, list):
164
178
  raise SystemExit("--sigs must point to a JSON array")
165
179
  signature_payloads = [_signature_from_json(entry) for entry in sig_payload]
166
- signature_entries = [Signature(**dict(entry)) for entry in signature_payloads]
180
+ signature_entries = [
181
+ Signature(**dict(entry)) for entry in signature_payloads
182
+ ]
167
183
  opts = _load_json_file(args.opts)
168
184
  require = _load_json_file(args.require)
169
185
  ok = await signer.verify_bytes(
@@ -1,22 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MediaSigner
3
- Version: 0.6.5.dev19
3
+ Version: 0.11.0.dev1
4
4
  Summary: Swarmauri signing facade plugin that aggregates registered SigningBase providers.
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,digital-signatures,media,cryptography,plugin,orchestration,asyncio,signature-aggregation,workflow-automation,key-management,verification,digital-asset-security,media-compliance,cms,pkcs7,cades,jws,openpgp,pdf-signatures,xmldsig
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: Development Status :: 1 - Planning
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3
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
14
  Classifier: Intended Audience :: Developers
21
15
  Classifier: Framework :: AsyncIO
22
16
  Classifier: Topic :: Security :: Cryptography
@@ -24,6 +18,14 @@ Classifier: Operating System :: OS Independent
24
18
  Classifier: Topic :: Multimedia :: Graphics
25
19
  Classifier: Topic :: Multimedia :: Video
26
20
  Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Programming Language :: Python :: 3 :: Only
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Programming Language :: Python :: 3.14
27
29
  Provides-Extra: plugins
28
30
  Requires-Dist: cryptography (>=42.0.0)
29
31
  Requires-Dist: swarmauri_base
@@ -47,21 +49,21 @@ Project-URL: Issues, https://github.com/swarmauri/swarmauri-sdk/issues
47
49
  Project-URL: Source, https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer
48
50
  Description-Content-Type: text/markdown
49
51
 
50
- <p align="center">
51
- <img src="../../../assets/swarmauri.brand.theme.svg" alt="Swarmauri logotype" width="420" />
52
- </p>
53
-
54
- <h1 align="center">MediaSigner</h1>
52
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
55
53
 
56
54
  <p align="center">
57
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/dm/MediaSigner?style=for-the-badge" alt="PyPI - Downloads" /></a>
58
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer/"><img src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer.svg?style=for-the-badge" alt="Repository views" /></a>
59
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/pyversions/MediaSigner?style=for-the-badge" alt="Supported Python versions" /></a>
60
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/l/MediaSigner?style=for-the-badge" alt="License" /></a>
61
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/v/MediaSigner?style=for-the-badge&label=MediaSigner" alt="Latest release" /></a>
62
- </p>
63
-
64
- ---
55
+ <a href="https://pepy.tech/project/MediaSigner/">
56
+ <img src="https://static.pepy.tech/badge/MediaSigner/month" alt="PyPI - Downloads"/></a>
57
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer/">
58
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer.svg"/></a>
59
+ <a href="https://pypi.org/project/MediaSigner/">
60
+ <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>
61
+ <a href="https://pypi.org/project/MediaSigner/">
62
+ <img src="https://img.shields.io/pypi/l/MediaSigner" alt="PyPI - License"/></a>
63
+ <a href="https://pypi.org/project/MediaSigner/">
64
+ <img src="https://img.shields.io/pypi/v/MediaSigner?label=MediaSigner&color=green" alt="PyPI - MediaSigner"/></a>
65
+ <a href="https://discord.gg/N4UpBuQv8T">
66
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
65
67
 
66
68
  MediaSigner packages the asynchronous `Signer` facade that orchestrates registered
67
69
  `SigningBase` providers. Moving the facade into a standalone plugin keeps the
@@ -70,15 +72,15 @@ specialised signers such as CMS, JWS, OpenPGP, PDF, and XMLDSig providers.
70
72
 
71
73
  ## Features
72
74
 
73
- - **Unified signing façade** talk to every installed `SigningBase` through a
75
+ - **Unified signing façade** ? talk to every installed `SigningBase` through a
74
76
  single async API that automatically discovers entry-point contributions.
75
- - **Format-aware routing** delegates signing and verification to the provider
77
+ - **Format-aware routing** ? delegates signing and verification to the provider
76
78
  registered for a format token such as `jws`, `pdf`, or `xmld`.
77
- - **Optional plugin bundles** install curated extras (e.g. `[plugins]`) to
79
+ - **Optional plugin bundles** ? install curated extras (e.g. `[plugins]`) to
78
80
  bring in all available signer backends in one step.
79
- - **Key-provider integration** share Swarmauri key providers with the facade
81
+ - **Key-provider integration** ? share Swarmauri key providers with the facade
80
82
  so opaque key references resolve before signature creation.
81
- - **Production-ready CLI** inspect capabilities, sign payloads, and verify
83
+ - **Production-ready CLI** ? inspect capabilities, sign payloads, and verify
82
84
  results directly from the command line for fast automation.
83
85
 
84
86
  ## Installation
@@ -167,11 +169,11 @@ for format_name in signer.supported_formats():
167
169
 
168
170
  ### Why this structure?
169
171
 
170
- * **Separation of concerns** standards remain focused on common abstractions
172
+ * **Separation of concerns** ? standards remain focused on common abstractions
171
173
  while the plugin encapsulates optional dependencies.
172
- * **Explicit opt-in** downstream projects can install only the signing stacks
174
+ * **Explicit opt-in** ? downstream projects can install only the signing stacks
173
175
  they need via the curated extras.
174
- * **Consistent ergonomics** usage matches the historical
176
+ * **Consistent ergonomics** ? usage matches the historical
175
177
  `swarmauri_standard.signing.Signer` import, preserving existing tutorials and
176
178
  code samples.
177
179
 
@@ -199,9 +201,11 @@ materials matching the selected plugin.
199
201
 
200
202
  ## Project Resources
201
203
 
202
- - Source: <https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer>
203
- - Documentation: <https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer#readme>
204
+ - Source: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer>
205
+ - Documentation: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer#readme>
204
206
  - Issues: <https://github.com/swarmauri/swarmauri-sdk/issues>
205
207
  - Releases: <https://github.com/swarmauri/swarmauri-sdk/releases>
206
208
  - Discussions: <https://github.com/orgs/swarmauri/discussions>
207
209
 
210
+
211
+
@@ -1,18 +1,18 @@
1
- <p align="center">
2
- <img src="../../../assets/swarmauri.brand.theme.svg" alt="Swarmauri logotype" width="420" />
3
- </p>
4
-
5
- <h1 align="center">MediaSigner</h1>
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
6
2
 
7
3
  <p align="center">
8
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/dm/MediaSigner?style=for-the-badge" alt="PyPI - Downloads" /></a>
9
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer/"><img src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer.svg?style=for-the-badge" alt="Repository views" /></a>
10
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/pyversions/MediaSigner?style=for-the-badge" alt="Supported Python versions" /></a>
11
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/l/MediaSigner?style=for-the-badge" alt="License" /></a>
12
- <a href="https://pypi.org/project/MediaSigner/"><img src="https://img.shields.io/pypi/v/MediaSigner?style=for-the-badge&label=MediaSigner" alt="Latest release" /></a>
13
- </p>
14
-
15
- ---
4
+ <a href="https://pepy.tech/project/MediaSigner/">
5
+ <img src="https://static.pepy.tech/badge/MediaSigner/month" alt="PyPI - Downloads"/></a>
6
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer/">
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer.svg"/></a>
8
+ <a href="https://pypi.org/project/MediaSigner/">
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>
10
+ <a href="https://pypi.org/project/MediaSigner/">
11
+ <img src="https://img.shields.io/pypi/l/MediaSigner" alt="PyPI - License"/></a>
12
+ <a href="https://pypi.org/project/MediaSigner/">
13
+ <img src="https://img.shields.io/pypi/v/MediaSigner?label=MediaSigner&color=green" alt="PyPI - MediaSigner"/></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>
16
16
 
17
17
  MediaSigner packages the asynchronous `Signer` facade that orchestrates registered
18
18
  `SigningBase` providers. Moving the facade into a standalone plugin keeps the
@@ -21,15 +21,15 @@ specialised signers such as CMS, JWS, OpenPGP, PDF, and XMLDSig providers.
21
21
 
22
22
  ## Features
23
23
 
24
- - **Unified signing façade** talk to every installed `SigningBase` through a
24
+ - **Unified signing façade** ? talk to every installed `SigningBase` through a
25
25
  single async API that automatically discovers entry-point contributions.
26
- - **Format-aware routing** delegates signing and verification to the provider
26
+ - **Format-aware routing** ? delegates signing and verification to the provider
27
27
  registered for a format token such as `jws`, `pdf`, or `xmld`.
28
- - **Optional plugin bundles** install curated extras (e.g. `[plugins]`) to
28
+ - **Optional plugin bundles** ? install curated extras (e.g. `[plugins]`) to
29
29
  bring in all available signer backends in one step.
30
- - **Key-provider integration** share Swarmauri key providers with the facade
30
+ - **Key-provider integration** ? share Swarmauri key providers with the facade
31
31
  so opaque key references resolve before signature creation.
32
- - **Production-ready CLI** inspect capabilities, sign payloads, and verify
32
+ - **Production-ready CLI** ? inspect capabilities, sign payloads, and verify
33
33
  results directly from the command line for fast automation.
34
34
 
35
35
  ## Installation
@@ -118,11 +118,11 @@ for format_name in signer.supported_formats():
118
118
 
119
119
  ### Why this structure?
120
120
 
121
- * **Separation of concerns** standards remain focused on common abstractions
121
+ * **Separation of concerns** ? standards remain focused on common abstractions
122
122
  while the plugin encapsulates optional dependencies.
123
- * **Explicit opt-in** downstream projects can install only the signing stacks
123
+ * **Explicit opt-in** ? downstream projects can install only the signing stacks
124
124
  they need via the curated extras.
125
- * **Consistent ergonomics** usage matches the historical
125
+ * **Consistent ergonomics** ? usage matches the historical
126
126
  `swarmauri_standard.signing.Signer` import, preserving existing tutorials and
127
127
  code samples.
128
128
 
@@ -150,8 +150,10 @@ materials matching the selected plugin.
150
150
 
151
151
  ## Project Resources
152
152
 
153
- - Source: <https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer>
154
- - Documentation: <https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/media_signer#readme>
153
+ - Source: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer>
154
+ - Documentation: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/media_signer#readme>
155
155
  - Issues: <https://github.com/swarmauri/swarmauri-sdk/issues>
156
156
  - Releases: <https://github.com/swarmauri/swarmauri-sdk/releases>
157
157
  - Discussions: <https://github.com/orgs/swarmauri/discussions>
158
+
159
+
@@ -1,21 +1,15 @@
1
1
  [project]
2
2
  name = "MediaSigner"
3
- version = "0.6.5.dev19"
3
+ version = "0.11.0.dev1"
4
4
  description = "Swarmauri signing facade plugin that aggregates registered SigningBase providers."
5
5
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
6
6
  license = "Apache-2.0"
7
7
  readme = { file = "README.md", content-type = "text/markdown" }
8
- requires-python = ">=3.10,<3.13"
8
+ requires-python = ">=3.10,<3.15"
9
9
  classifiers = [
10
10
  "Development Status :: 1 - Planning",
11
11
  "License :: OSI Approved :: Apache Software License",
12
12
  "Natural Language :: English",
13
- "Programming Language :: Python",
14
- "Programming Language :: Python :: 3",
15
- "Programming Language :: Python :: 3 :: Only",
16
- "Programming Language :: Python :: 3.10",
17
- "Programming Language :: Python :: 3.11",
18
- "Programming Language :: Python :: 3.12",
19
13
  "Intended Audience :: Developers",
20
14
  "Framework :: AsyncIO",
21
15
  "Topic :: Security :: Cryptography",
@@ -23,6 +17,14 @@ classifiers = [
23
17
  "Topic :: Multimedia :: Graphics",
24
18
  "Topic :: Multimedia :: Video",
25
19
  "Topic :: Software Development :: Libraries",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
26
28
  ]
27
29
  dependencies = [
28
30
  "swarmauri_core",
@@ -110,7 +112,7 @@ log_cli_level = "INFO"
110
112
  log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
111
113
  log_cli_date_format = "%Y-%m-%d %H:%M:%S"
112
114
  asyncio_default_fixture_loop_scope = "function"
113
- addopts = "--pylicense-package=MediaSigner --pylicense-mode=parameterized --pylicense-accept-deps=cffi,pycparser"
115
+ addopts = "--pylicense-package=MediaSigner --pylicense-mode=parameterized --pylicense-accept-deps=cffi,standard-imghdr"
114
116
 
115
117
  [build-system]
116
118
  requires = ["poetry-core>=1.0.0"]