From d86ad844f5cba32815f70c09276683aa4f8ce10d Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sun, 23 Feb 2025 16:25:36 +0300 Subject: [PATCH] Bump python-jose to 3.4.* (#13522) --- stubs/python-jose/@tests/stubtest_allowlist.txt | 3 +++ stubs/python-jose/METADATA.toml | 2 +- stubs/python-jose/jose/backends/cryptography_backend.pyi | 3 ++- stubs/python-jose/jose/constants.pyi | 3 +++ stubs/python-jose/jose/utils.pyi | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/stubs/python-jose/@tests/stubtest_allowlist.txt b/stubs/python-jose/@tests/stubtest_allowlist.txt index efd6e0e11b8d..35fe14b402be 100644 --- a/stubs/python-jose/@tests/stubtest_allowlist.txt +++ b/stubs/python-jose/@tests/stubtest_allowlist.txt @@ -4,3 +4,6 @@ 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 diff --git a/stubs/python-jose/METADATA.toml b/stubs/python-jose/METADATA.toml index 5b4b5fa79b98..42901e47e759 100644 --- a/stubs/python-jose/METADATA.toml +++ b/stubs/python-jose/METADATA.toml @@ -1,3 +1,3 @@ -version = "3.3.*" +version = "3.4.*" upstream_repository = "https://github.com/mpdavis/python-jose" requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available diff --git a/stubs/python-jose/jose/backends/cryptography_backend.pyi b/stubs/python-jose/jose/backends/cryptography_backend.pyi index 133ce8ec2e39..3e7e6a9ffc2b 100644 --- a/stubs/python-jose/jose/backends/cryptography_backend.pyi +++ b/stubs/python-jose/jose/backends/cryptography_backend.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from typing import Any +from typing import Any, ClassVar from .base import Key @@ -51,6 +51,7 @@ class CryptographyAESKey(Key): KEY_512: Any AES_KW_ALGS: Any MODES: Any + IV_BYTE_LENGTH_MODE_MAP: ClassVar[dict[str, int]] def __init__(self, key, algorithm) -> None: ... def to_dict(self): ... def encrypt(self, plain_text, aad: Incomplete | None = None): ... diff --git a/stubs/python-jose/jose/constants.pyi b/stubs/python-jose/jose/constants.pyi index 209a9056b815..a8df8f155333 100644 --- a/stubs/python-jose/jose/constants.pyi +++ b/stubs/python-jose/jose/constants.pyi @@ -1,5 +1,6 @@ from collections.abc import Callable, Mapping from hashlib import _Hash +from typing import Final from .backends.base import Key @@ -70,3 +71,5 @@ class Zips: SUPPORTED: set[str | None] ZIPS: Zips + +JWE_SIZE_LIMIT: Final[int] diff --git a/stubs/python-jose/jose/utils.pyi b/stubs/python-jose/jose/utils.pyi index 13adfb02f3aa..52db52b82809 100644 --- a/stubs/python-jose/jose/utils.pyi +++ b/stubs/python-jose/jose/utils.pyi @@ -12,3 +12,5 @@ def base64url_decode(input: bytes) -> bytes: ... def base64url_encode(input: bytes) -> bytes: ... def timedelta_total_seconds(delta: timedelta) -> int: ... def ensure_binary(s: str | bytes) -> bytes: ... +def is_pem_format(key: bytes) -> bool: ... +def is_ssh_key(key: bytes) -> bool: ...