Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
kasium committed Sep 23, 2024
1 parent 628e6fa commit a2ca49a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
3 changes: 3 additions & 0 deletions stubs/jwcrypto/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# test code does not need type hints
jwcrypto.tests
jwcrypto.tests-cookbook
1 change: 1 addition & 0 deletions stubs/jwcrypto/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version = "1.5.*"
upstream_repository = "https://github.com/latchset/jwcrypto"
requires = ["cryptography"]
34 changes: 11 additions & 23 deletions stubs/jwcrypto/jwcrypto/jwk.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
from _typeshed import Incomplete
from collections.abc import Iterator, Sequence
from collections.abc import Sequence
from enum import Enum
from typing import Any, NamedTuple

from cryptography.hazmat.primitives.asymmetric.ed448 import Ed448PrivateKey as Ed448PrivateKey, Ed448PublicKey as Ed448PublicKey
from cryptography.hazmat.primitives.asymmetric.ed25519 import (
Ed25519PrivateKey as Ed25519PrivateKey,
Ed25519PublicKey as Ed25519PublicKey,
)
from cryptography.hazmat.primitives.asymmetric.x448 import X448PrivateKey as X448PrivateKey, X448PublicKey as X448PublicKey
from cryptography.hazmat.primitives.asymmetric.x25519 import (
X25519PrivateKey as X25519PrivateKey,
X25519PublicKey as X25519PublicKey,
)
from jwcrypto.common import JWException

class UnimplementedOKPCurveKey:
Expand All @@ -14,15 +24,7 @@ class UnimplementedOKPCurveKey:
def from_private_bytes(cls, *args) -> None: ...

ImplementedOkpCurves: Sequence[str]
Ed25519PublicKey = UnimplementedOKPCurveKey
Ed25519PrivateKey = UnimplementedOKPCurveKey
Ed448PublicKey = UnimplementedOKPCurveKey
Ed448PrivateKey = UnimplementedOKPCurveKey
priv_bytes: Incomplete
X25519PublicKey = UnimplementedOKPCurveKey
X25519PrivateKey = UnimplementedOKPCurveKey
X448PublicKey = UnimplementedOKPCurveKey
X448PrivateKey = UnimplementedOKPCurveKey

JWKTypesRegistry: Incomplete

Expand Down Expand Up @@ -98,24 +100,10 @@ class JWK(dict[str, Any]):
def from_pem(cls, data, password: Incomplete | None = None): ...
def thumbprint(self, hashalg=...): ...
def thumbprint_uri(self, hname: str = "sha-256"): ...
def __setitem__(self, item, value) -> None: ...
def update(self, *args, **kwargs) -> None: ...
def setdefault(self, key, default: Incomplete | None = None): ...
def __delitem__(self, item) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self): ...
def __getattr__(self, item: str): ...
def __setattr__(self, item: str, value) -> None: ...
@classmethod
def from_password(cls, password): ...

class JWKSet(dict[str, Any]):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __iter__(self) -> Iterator[Any]: ...
def __contains__(self, key) -> bool: ...
def __setitem__(self, key: str, val: Any) -> None: ...
def update(self, *args, **kwargs) -> None: ...
def setdefault(self, key: str, default: Incomplete | None = None): ...
def add(self, elem) -> None: ...
def export(self, private_keys: bool = True, as_dict: bool = False): ...
def import_keyset(self, keyset) -> None: ...
Expand Down

0 comments on commit a2ca49a

Please sign in to comment.