Bump python-jose to 3.5.* (#14193)

This commit is contained in:
Semyon Moroz
2025-05-30 15:00:10 +00:00
committed by GitHub
parent 9c0218ee04
commit ee696d5303
6 changed files with 9 additions and 13 deletions
@@ -4,6 +4,3 @@ jose.backends.CryptographyECKey
jose.backends.CryptographyHMACKey
jose.backends.CryptographyRSAKey
jose.backends.ECDSAECKey
# See https://github.com/mpdavis/python-jose/pull/372
jose.jwt.utc_now
+1 -1
View File
@@ -1,3 +1,3 @@
version = "3.4.*"
version = "3.5.*"
upstream_repository = "https://github.com/mpdavis/python-jose"
requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available
+1 -4
View File
@@ -1,5 +1,3 @@
from collections.abc import Callable
from .base import DIRKey as DIRKey
from .cryptography_backend import (
CryptographyAESKey as CryptographyAESKey,
@@ -8,7 +6,7 @@ from .cryptography_backend import (
CryptographyRSAKey as CryptographyRSAKey,
)
from .ecdsa_backend import ECDSAECKey as ECDSAECKey
from .native import HMACKey as NativeHMACKey
from .native import HMACKey as NativeHMACKey, get_random_bytes as get_random_bytes
from .rsa_backend import RSAKey as BackendRSAKey
# python-jose relies on importing from cryptography_backend
@@ -18,4 +16,3 @@ AESKey: type[CryptographyAESKey] | None
HMACKey: type[CryptographyHMACKey | NativeHMACKey]
RSAKey: type[CryptographyRSAKey | BackendRSAKey] | None
ECKey: type[CryptographyECKey | ECDSAECKey]
get_random_bytes: Callable[[int], bytes]
@@ -1,9 +1,8 @@
from typing import Any, ClassVar
from . import get_random_bytes as get_random_bytes
from .base import Key
def get_random_bytes(num_bytes: int) -> bytes: ...
# Enable when we can use stubs from installed dependencies:
# from cryptography.hazmat import backends
class CryptographyECKey(Key):
+2 -2
View File
@@ -1,4 +1,4 @@
from collections.abc import Container, Mapping
from collections.abc import Container, Iterable, Mapping
from typing import Any
from .backends.base import Key
@@ -13,7 +13,7 @@ def sign(
) -> str: ...
def verify(
token: str | bytes,
key: str | bytes | Mapping[str, Any] | Key,
key: str | bytes | Mapping[str, Any] | Key | Iterable[str],
# Callers of this function, like jwt.decode(), and functions called internally,
# like jws._verify_signature(), use and accept algorithms=None
algorithms: str | Container[str] | None,
+4 -1
View File
@@ -1,8 +1,11 @@
from collections.abc import Container, Iterable, Mapping, MutableMapping
from datetime import timezone
from typing import Any
from .backends.base import Key
UTC: timezone
def encode(
claims: MutableMapping[str, Any],
# Internally it calls jws.sign() that expects a key dict instance instead of Mapping
@@ -13,7 +16,7 @@ def encode(
) -> str: ...
def decode(
token: str | bytes,
key: str | bytes | Mapping[str, Any] | Key,
key: str | bytes | Mapping[str, Any] | Key | Iterable[str],
algorithms: str | Container[str] | None = None,
options: Mapping[str, Any] | None = None,
audience: str | None = None,