Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -1,4 +1,4 @@
from typing import List, Text
from typing import Text
class InvalidToken(Exception): ...
@@ -16,7 +16,7 @@ class Fernet(object):
def generate_key(cls) -> bytes: ...
class MultiFernet(object):
def __init__(self, fernets: List[Fernet]) -> None: ...
def __init__(self, fernets: list[Fernet]) -> None: ...
def decrypt(self, token: bytes, ttl: int | None = ...) -> bytes: ...
# See a note above on the typing of the ttl parameter.
def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List, Tuple
from typing import Any, Tuple
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKeyWithSerialization
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKeyWithSerialization
@@ -8,11 +8,11 @@ from cryptography.x509 import Certificate
def load_key_and_certificates(
data: bytes, password: bytes | None, backend: Any | None = ...
) -> Tuple[Any | None, Certificate | None, List[Certificate]]: ...
) -> Tuple[Any | None, Certificate | None, list[Certificate]]: ...
def serialize_key_and_certificates(
name: bytes,
key: RSAPrivateKeyWithSerialization | EllipticCurvePrivateKeyWithSerialization | DSAPrivateKeyWithSerialization,
cert: Certificate | None,
cas: List[Certificate] | None,
cas: list[Certificate] | None,
enc: KeySerializationEncryption,
) -> bytes: ...

View File

@@ -1,5 +1,5 @@
from enum import Enum
from typing import Any, Iterable, List
from typing import Any, Iterable
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey
@@ -7,8 +7,8 @@ from cryptography.hazmat.primitives.hashes import SHA1, SHA224, SHA256, SHA384,
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.x509 import Certificate
def load_pem_pkcs7_certificates(data: bytes) -> List[Certificate]: ...
def load_der_pkcs7_certificates(data: bytes) -> List[Certificate]: ...
def load_pem_pkcs7_certificates(data: bytes) -> list[Certificate]: ...
def load_der_pkcs7_certificates(data: bytes) -> list[Certificate]: ...
class PKCS7Options(Enum):
Text: str

View File

@@ -2,7 +2,7 @@ import datetime
from abc import ABCMeta, abstractmethod
from enum import Enum
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network
from typing import Any, ClassVar, Generator, Generic, Iterable, List, Sequence, Text, Type, TypeVar
from typing import Any, ClassVar, Generator, Generic, Iterable, Sequence, Text, Type, TypeVar
from cryptography.hazmat.backends.interfaces import X509Backend
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey
@@ -112,17 +112,17 @@ class NameAttribute(object):
def rfc4514_string(self) -> str: ...
class RelativeDistinguishedName(object):
def __init__(self, attributes: List[NameAttribute]) -> None: ...
def __init__(self, attributes: list[NameAttribute]) -> None: ...
def __iter__(self) -> Generator[NameAttribute, None, None]: ...
def get_attributes_for_oid(self, oid: ObjectIdentifier) -> List[NameAttribute]: ...
def get_attributes_for_oid(self, oid: ObjectIdentifier) -> list[NameAttribute]: ...
def rfc4514_string(self) -> str: ...
class Name(object):
rdns: List[RelativeDistinguishedName]
rdns: list[RelativeDistinguishedName]
def __init__(self, attributes: Sequence[NameAttribute | RelativeDistinguishedName]) -> None: ...
def __iter__(self) -> Generator[NameAttribute, None, None]: ...
def __len__(self) -> int: ...
def get_attributes_for_oid(self, oid: ObjectIdentifier) -> List[NameAttribute]: ...
def get_attributes_for_oid(self, oid: ObjectIdentifier) -> list[NameAttribute]: ...
def public_bytes(self, backend: X509Backend | None = ...) -> bytes: ...
def rfc4514_string(self) -> str: ...
@@ -290,7 +290,7 @@ class Extension(Generic[_T]):
value: _T
class Extensions(object):
def __init__(self, general_names: List[Extension[Any]]) -> None: ...
def __init__(self, general_names: list[Extension[Any]]) -> None: ...
def __iter__(self) -> Generator[Extension[Any], None, None]: ...
def get_extension_for_oid(self, oid: ObjectIdentifier) -> Extension[Any]: ...
def get_extension_for_class(self, extclass: Type[_T]) -> Extension[_T]: ...
@@ -304,20 +304,20 @@ class ExtensionNotFound(Exception):
def __init__(self, msg: str, oid: ObjectIdentifier) -> None: ...
class IssuerAlternativeName(ExtensionType):
def __init__(self, general_names: List[GeneralName]) -> None: ...
def __init__(self, general_names: list[GeneralName]) -> None: ...
def __iter__(self) -> Generator[GeneralName, None, None]: ...
def get_values_for_type(self, type: Type[GeneralName]) -> List[Any]: ...
def get_values_for_type(self, type: Type[GeneralName]) -> list[Any]: ...
class SubjectAlternativeName(ExtensionType):
def __init__(self, general_names: List[GeneralName]) -> None: ...
def __init__(self, general_names: list[GeneralName]) -> None: ...
def __iter__(self) -> Generator[GeneralName, None, None]: ...
def get_values_for_type(self, type: Type[GeneralName]) -> List[Any]: ...
def get_values_for_type(self, type: Type[GeneralName]) -> list[Any]: ...
class AuthorityKeyIdentifier(ExtensionType):
@property
def key_identifier(self) -> bytes: ...
@property
def authority_cert_issuer(self) -> List[GeneralName] | None: ...
def authority_cert_issuer(self) -> list[GeneralName] | None: ...
@property
def authority_cert_serial_number(self) -> int | None: ...
def __init__(

View File

@@ -1,5 +1,3 @@
from typing import Dict
from cryptography.hazmat.primitives.hashes import HashAlgorithm
from cryptography.x509 import ObjectIdentifier
@@ -101,6 +99,6 @@ class CertificatePoliciesOID:
CPS_USER_NOTICE: ObjectIdentifier = ...
ANY_POLICY: ObjectIdentifier = ...
_OID_NAMES: Dict[ObjectIdentifier, str] = ...
_OID_NAMES: dict[ObjectIdentifier, str] = ...
_SIG_OIDS_TO_HASH: Dict[ObjectIdentifier, HashAlgorithm | None] = ...
_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, HashAlgorithm | None] = ...