pysigned 0.2.2__tar.gz → 0.2.3__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.
- {pysigned-0.2.2 → pysigned-0.2.3}/PKG-INFO +1 -1
- {pysigned-0.2.2 → pysigned-0.2.3}/pyproject.toml +1 -1
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/backends.py +1 -1
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/keys.py +5 -5
- {pysigned-0.2.2 → pysigned-0.2.3}/LICENSE +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/README.md +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/THIRD-PARTY-LICENSES +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/__init__.py +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/extensions/__init__.py +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/extensions/fastapi.py +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/py.typed +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/signature.py +0 -0
- {pysigned-0.2.2 → pysigned-0.2.3}/src/pysigned/utils.py +0 -0
|
@@ -37,7 +37,7 @@ class Backend:
|
|
|
37
37
|
def __init__(self, digest: str = DIGEST):
|
|
38
38
|
self.digest = digest
|
|
39
39
|
|
|
40
|
-
def parse_key(self, value: KeyValue) ->
|
|
40
|
+
def parse_key(self, value: KeyValue) -> Key | Ed25519KeyPair:
|
|
41
41
|
"""Wrap a user-supplied key value as a :class:`~pysigned.keys.KeyLike`.
|
|
42
42
|
|
|
43
43
|
Already-wrapped keys pass through; raw ``bytes`` or a ``(bytes, id)``
|
|
@@ -5,7 +5,7 @@ from base64 import urlsafe_b64decode
|
|
|
5
5
|
from collections.abc import Iterable, Mapping
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from types import MappingProxyType
|
|
8
|
-
from typing import TYPE_CHECKING, Any, Self, cast
|
|
8
|
+
from typing import TYPE_CHECKING, Any, Self, cast, Iterator
|
|
9
9
|
from cryptography.hazmat.primitives.asymmetric import ed25519
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
@@ -157,7 +157,7 @@ class KeySet:
|
|
|
157
157
|
key dispatches on its type via the backend.
|
|
158
158
|
"""
|
|
159
159
|
|
|
160
|
-
def __init__(self, keys: Iterable, backend: "Backend | None" = None):
|
|
160
|
+
def __init__(self, keys: Iterable[Key], backend: "Backend | None" = None):
|
|
161
161
|
if backend is None:
|
|
162
162
|
# Deferred to break the keys <-> backends import cycle: backends
|
|
163
163
|
# imports the key types from this module, so Backend can't be
|
|
@@ -166,14 +166,14 @@ class KeySet:
|
|
|
166
166
|
|
|
167
167
|
backend = Backend()
|
|
168
168
|
self.backend = backend
|
|
169
|
-
self._keys: Mapping[str, Key |
|
|
169
|
+
self._keys: Mapping[str, Key | Ed25519KeyPair] = MappingProxyType(
|
|
170
170
|
{k.id: k for k in map(backend.parse_key, keys)}
|
|
171
171
|
)
|
|
172
172
|
|
|
173
|
-
def __getitem__(self, key: str):
|
|
173
|
+
def __getitem__(self, key: str) -> KeyLike:
|
|
174
174
|
return self._keys[key]
|
|
175
175
|
|
|
176
|
-
def __iter__(self):
|
|
176
|
+
def __iter__(self) -> Iterator[Key | Ed25519KeyPair]:
|
|
177
177
|
return iter(self._keys.values())
|
|
178
178
|
|
|
179
179
|
def __reversed__(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|