swarmauri_signing_ssh 0.3.0.dev50__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,24 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_signing_ssh
3
- Version: 0.3.0.dev50
3
+ Version: 0.11.0.dev1
4
4
  Summary: OpenSSH-based signer for Swarmauri
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,signing,ssh,public-key,secure-shell,sdk,standards,cryptography,openssh,authorized-keys,ssh-certificates,digital-signature,signature-format
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: Topic :: Security :: Cryptography
15
+ Classifier: Intended Audience :: Developers
14
16
  Classifier: Programming Language :: Python
15
17
  Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
16
19
  Classifier: Programming Language :: Python :: 3.10
17
20
  Classifier: Programming Language :: Python :: 3.11
18
21
  Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Topic :: Security :: Cryptography
20
- Classifier: Intended Audience :: Developers
21
- Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Provides-Extra: cbor
23
25
  Requires-Dist: cbor2 ; extra == "cbor"
24
26
  Requires-Dist: swarmauri_base
@@ -28,23 +30,21 @@ Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
28
30
  Project-URL: Source, https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/standards/swarmauri_signing_ssh
29
31
  Description-Content-Type: text/markdown
30
32
 
31
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
33
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
32
34
 
33
35
  <p align="center">
34
- <a href="https://pypi.org/project/swarmauri_signing_ssh/">
35
- <img src="https://img.shields.io/pypi/dm/swarmauri_signing_ssh" alt="PyPI - Downloads"/></a>
36
+ <a href="https://pepy.tech/project/swarmauri_signing_ssh/">
37
+ <img src="https://static.pepy.tech/badge/swarmauri_signing_ssh/month" alt="PyPI - Downloads"/></a>
36
38
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ssh/">
37
39
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ssh.svg"/></a>
38
40
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
39
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_signing_ssh" alt="PyPI - Python Version"/></a>
41
+ <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>
40
42
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
41
43
  <img src="https://img.shields.io/pypi/l/swarmauri_signing_ssh" alt="PyPI - License"/></a>
42
44
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
43
45
  <img src="https://img.shields.io/pypi/v/swarmauri_signing_ssh?label=swarmauri_signing_ssh&color=green" alt="PyPI - swarmauri_signing_ssh"/></a>
44
-
45
- </p>
46
-
47
- ---
46
+ <a href="https://discord.gg/N4UpBuQv8T">
47
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
48
48
 
49
49
  # swarmauri_signing_ssh
50
50
 
@@ -189,3 +189,5 @@ The signer registers under the `swarmauri.signings` entry point as
189
189
  If you want to contribute to swarmauri-sdk, read up on our
190
190
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
191
191
  that will help you get started.
192
+
193
+
@@ -1,20 +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_signing_ssh/">
5
- <img src="https://img.shields.io/pypi/dm/swarmauri_signing_ssh" alt="PyPI - Downloads"/></a>
4
+ <a href="https://pepy.tech/project/swarmauri_signing_ssh/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_signing_ssh/month" alt="PyPI - Downloads"/></a>
6
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ssh/">
7
7
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_signing_ssh.svg"/></a>
8
8
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
9
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_signing_ssh" 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>
10
10
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
11
11
  <img src="https://img.shields.io/pypi/l/swarmauri_signing_ssh" alt="PyPI - License"/></a>
12
12
  <a href="https://pypi.org/project/swarmauri_signing_ssh/">
13
13
  <img src="https://img.shields.io/pypi/v/swarmauri_signing_ssh?label=swarmauri_signing_ssh&color=green" alt="PyPI - swarmauri_signing_ssh"/></a>
14
-
15
- </p>
16
-
17
- ---
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>
18
16
 
19
17
  # swarmauri_signing_ssh
20
18
 
@@ -158,4 +156,5 @@ The signer registers under the `swarmauri.signings` entry point as
158
156
 
159
157
  If you want to contribute to swarmauri-sdk, read up on our
160
158
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
161
- that will help you get started.
159
+ that will help you get started.
160
+
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "swarmauri_signing_ssh"
3
- version = "0.3.0.dev50"
3
+ version = "0.11.0.dev1"
4
4
  description = "OpenSSH-based signer 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
  keywords = [
10
10
  "swarmauri",
@@ -25,14 +25,16 @@ classifiers = [
25
25
  "Development Status :: 1 - Planning",
26
26
  "License :: OSI Approved :: Apache Software License",
27
27
  "Natural Language :: English",
28
+ "Topic :: Security :: Cryptography",
29
+ "Intended Audience :: Developers",
28
30
  "Programming Language :: Python",
29
31
  "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3 :: Only",
30
33
  "Programming Language :: Python :: 3.10",
31
34
  "Programming Language :: Python :: 3.11",
32
35
  "Programming Language :: Python :: 3.12",
33
- "Topic :: Security :: Cryptography",
34
- "Intended Audience :: Developers",
35
- "Programming Language :: Python :: 3 :: Only",
36
+ "Programming Language :: Python :: 3.13",
37
+ "Programming Language :: Python :: 3.14",
36
38
  ]
37
39
  dependencies = [
38
40
  "swarmauri_core",
@@ -35,7 +35,10 @@ except Exception: # pragma: no cover - runtime check
35
35
  def _require_ssh_keygen() -> None:
36
36
  if shutil.which("ssh-keygen") is None:
37
37
  raise RuntimeError(
38
- "SshEnvelopeSigner requires OpenSSH 'ssh-keygen' on PATH (v8.2+ with -Y support)."
38
+ (
39
+ "SshEnvelopeSigner requires OpenSSH 'ssh-keygen' on PATH "
40
+ "(v8.2+ with -Y support)."
41
+ )
39
42
  )
40
43
 
41
44
 
@@ -48,7 +51,10 @@ def _canon_json(obj: Any) -> bytes:
48
51
  def _canon_cbor(obj: Any) -> bytes:
49
52
  if not _CBOR_OK:
50
53
  raise RuntimeError(
51
- "CBOR canonicalization requires 'cbor2'. Install with: pip install cbor2"
54
+ (
55
+ "CBOR canonicalization requires 'cbor2'. Install with: pip "
56
+ "install cbor2"
57
+ )
52
58
  )
53
59
  return cbor2.dumps(obj)
54
60
 
@@ -156,7 +162,8 @@ def _extract_pub_from_priv(priv_path: str) -> str:
156
162
  return _pub_from_priv_path(priv_path)
157
163
 
158
164
 
159
- # ───────────────────────────── Signature container ─────────────────────────────
165
+ # ───────────────────────────── Signature container
166
+ # ─────────────────────────────
160
167
 
161
168
 
162
169
  @dataclass(frozen=True)
@@ -296,16 +303,20 @@ class SshEnvelopeSigner(SigningBase):
296
303
  payload (bytes): Original message that was signed.
297
304
  signatures (Sequence[Signature]): Signatures to verify.
298
305
  require (Optional[Mapping[str, object]]): Verification constraints
299
- such as ``min_signers``, ``algs`` or ``kids``. Defaults to ``None``.
300
- opts (Optional[Mapping[str, object]]): Options including ``pubkeys``
301
- with a list of SSH public key lines and optional ``namespace`` or
306
+ such as ``min_signers``, ``algs`` or ``kids``. Defaults to
307
+ ``None``.
308
+ opts (Optional[Mapping[str, object]]): Options including
309
+ ``pubkeys``
310
+ with a list of SSH public key lines and optional ``namespace``
311
+ or
302
312
  ``identity``. Defaults to ``None``.
303
313
 
304
314
  Returns:
305
315
  bool: ``True`` if verification succeeds, otherwise ``False``.
306
316
 
307
317
  Raises:
308
- RuntimeError: If required options are missing or verification fails.
318
+ RuntimeError: If required options are missing or verification
319
+ fails.
309
320
  TypeError: If provided public keys or signatures are malformed.
310
321
  """
311
322
 
@@ -321,14 +332,20 @@ class SshEnvelopeSigner(SigningBase):
321
332
  pubkeys = (opts or {}).get("pubkeys") or []
322
333
  if not isinstance(pubkeys, (list, tuple)) or not pubkeys:
323
334
  raise RuntimeError(
324
- "SshEnvelopeSigner.verify_bytes requires opts['pubkeys'] with one or more SSH public keys."
335
+ (
336
+ "SshEnvelopeSigner.verify_bytes requires opts['pubkeys'] with " # noqa: E501
337
+ "one or more SSH public keys."
338
+ )
325
339
  )
326
340
 
327
341
  allowed_lines = []
328
342
  for idx, key_entry in enumerate(pubkeys):
329
343
  if not isinstance(key_entry, str):
330
344
  raise TypeError(
331
- "opts['pubkeys'] entries must be OpenSSH public key lines (str)."
345
+ (
346
+ "opts['pubkeys'] entries must be OpenSSH public key lines " # noqa: E501
347
+ "(str)."
348
+ )
332
349
  )
333
350
  identity = str(identity_hint or f"signer{idx}")
334
351
  allowed_lines.append(_allowed_signers_content(identity, key_entry))
@@ -343,7 +360,8 @@ class SshEnvelopeSigner(SigningBase):
343
360
  continue
344
361
  keytype = str(sig.get("keytype") or "")
345
362
  if allowed_algs and (
346
- sig.get("alg") not in allowed_algs and keytype not in allowed_algs
363
+ sig.get("alg") not in allowed_algs
364
+ and keytype not in allowed_algs
347
365
  ):
348
366
  continue
349
367
  if required_kids:
@@ -351,7 +369,9 @@ class SshEnvelopeSigner(SigningBase):
351
369
  if not isinstance(kid, str) or kid not in required_kids:
352
370
  continue
353
371
 
354
- sig_path = _write_temp("ssh_sig_", bytes(sig_bytes), mode=0o600)
372
+ sig_path = _write_temp(
373
+ "ssh_sig_", bytes(sig_bytes), mode=0o600
374
+ )
355
375
  try:
356
376
  cmd = [
357
377
  "ssh-keygen",
@@ -395,7 +415,9 @@ class SshEnvelopeSigner(SigningBase):
395
415
  require: Optional[Mapping[str, object]] = None,
396
416
  opts: Optional[Mapping[str, object]] = None,
397
417
  ) -> bool:
398
- return await self.verify_bytes(digest, signatures, require=require, opts=opts)
418
+ return await self.verify_bytes(
419
+ digest, signatures, require=require, opts=opts
420
+ )
399
421
 
400
422
  async def canonicalize_envelope(
401
423
  self,
@@ -418,7 +440,8 @@ class SshEnvelopeSigner(SigningBase):
418
440
  bytes: Canonicalized envelope bytes.
419
441
 
420
442
  Raises:
421
- ValueError: If the requested canonicalization format is unsupported.
443
+ ValueError: If the requested canonicalization format is
444
+ unsupported.
422
445
  """
423
446
 
424
447
  if canon in (None, "json"):
@@ -472,7 +495,8 @@ class SshEnvelopeSigner(SigningBase):
472
495
  signatures (Sequence[Signature]): Signatures to validate.
473
496
  canon (Optional[Canon]): Canonicalization format. Defaults to
474
497
  ``"json"``.
475
- require (Optional[Mapping[str, object]]): Verification constraints as
498
+ require (Optional[Mapping[str, object]]): Verification constraints
499
+ as
476
500
  described in :meth:`verify_bytes`. Defaults to ``None``.
477
501
  opts (Optional[Mapping[str, object]]): Extra options forwarded to
478
502
  :meth:`verify_bytes`. Defaults to ``None``.
@@ -482,4 +506,6 @@ class SshEnvelopeSigner(SigningBase):
482
506
  """
483
507
 
484
508
  payload = await self.canonicalize_envelope(env, canon=canon, opts=opts)
485
- return await self.verify_bytes(payload, signatures, require=require, opts=opts)
509
+ return await self.verify_bytes(
510
+ payload, signatures, require=require, opts=opts
511
+ )