Skip to content

Commit ee696d5

Browse files
authored
Bump python-jose to 3.5.* (python#14193)
1 parent 9c0218e commit ee696d5

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

stubs/python-jose/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ jose.backends.CryptographyECKey
44
jose.backends.CryptographyHMACKey
55
jose.backends.CryptographyRSAKey
66
jose.backends.ECDSAECKey
7-
8-
# See https://github.com/mpdavis/python-jose/pull/372
9-
jose.jwt.utc_now

stubs/python-jose/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version = "3.4.*"
1+
version = "3.5.*"
22
upstream_repository = "https://github.com/mpdavis/python-jose"
33
requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from collections.abc import Callable
2-
31
from .base import DIRKey as DIRKey
42
from .cryptography_backend import (
53
CryptographyAESKey as CryptographyAESKey,
@@ -8,7 +6,7 @@ from .cryptography_backend import (
86
CryptographyRSAKey as CryptographyRSAKey,
97
)
108
from .ecdsa_backend import ECDSAECKey as ECDSAECKey
11-
from .native import HMACKey as NativeHMACKey
9+
from .native import HMACKey as NativeHMACKey, get_random_bytes as get_random_bytes
1210
from .rsa_backend import RSAKey as BackendRSAKey
1311

1412
# python-jose relies on importing from cryptography_backend
@@ -18,4 +16,3 @@ AESKey: type[CryptographyAESKey] | None
1816
HMACKey: type[CryptographyHMACKey | NativeHMACKey]
1917
RSAKey: type[CryptographyRSAKey | BackendRSAKey] | None
2018
ECKey: type[CryptographyECKey | ECDSAECKey]
21-
get_random_bytes: Callable[[int], bytes]

stubs/python-jose/jose/backends/cryptography_backend.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from typing import Any, ClassVar
22

3+
from . import get_random_bytes as get_random_bytes
34
from .base import Key
45

5-
def get_random_bytes(num_bytes: int) -> bytes: ...
6-
76
# Enable when we can use stubs from installed dependencies:
87
# from cryptography.hazmat import backends
98
class CryptographyECKey(Key):

stubs/python-jose/jose/jws.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from collections.abc import Container, Mapping
1+
from collections.abc import Container, Iterable, Mapping
22
from typing import Any
33

44
from .backends.base import Key
@@ -13,7 +13,7 @@ def sign(
1313
) -> str: ...
1414
def verify(
1515
token: str | bytes,
16-
key: str | bytes | Mapping[str, Any] | Key,
16+
key: str | bytes | Mapping[str, Any] | Key | Iterable[str],
1717
# Callers of this function, like jwt.decode(), and functions called internally,
1818
# like jws._verify_signature(), use and accept algorithms=None
1919
algorithms: str | Container[str] | None,

stubs/python-jose/jose/jwt.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from collections.abc import Container, Iterable, Mapping, MutableMapping
2+
from datetime import timezone
23
from typing import Any
34

45
from .backends.base import Key
56

7+
UTC: timezone
8+
69
def encode(
710
claims: MutableMapping[str, Any],
811
# Internally it calls jws.sign() that expects a key dict instance instead of Mapping
@@ -13,7 +16,7 @@ def encode(
1316
) -> str: ...
1417
def decode(
1518
token: str | bytes,
16-
key: str | bytes | Mapping[str, Any] | Key,
19+
key: str | bytes | Mapping[str, Any] | Key | Iterable[str],
1720
algorithms: str | Container[str] | None = None,
1821
options: Mapping[str, Any] | None = None,
1922
audience: str | None = None,

0 commit comments

Comments
 (0)