diff --git a/third_party/2/itsdangerous.pyi b/third_party/2/itsdangerous.pyi index 0f656366b..8e4acb520 100644 --- a/third_party/2/itsdangerous.pyi +++ b/third_party/2/itsdangerous.pyi @@ -6,6 +6,7 @@ PY2 = ... # type: bool text_type = unicode int_to_byte = chr number_types = (int, long, float) +_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module) bytes_like = Union[bytearray, str] @@ -16,7 +17,7 @@ class _CompactJSON: compact_json = _CompactJSON EPOCH = ... # type: int -def want_bytes(s: str, encoding='', errors='') -> str: ... +def want_bytes(s: str, encoding: str = ..., errors: str = ...) -> bytes: ... def is_text_serializer(serializer: Any) -> bool: ... def constant_time_compare(val1: bytes_like, val2: bytes_like) -> bool: ... @@ -43,13 +44,13 @@ class BadHeader(BadSignature): class SignatureExpired(BadTimeSignature): ... -def base64_encode(string: bytes_like) -> str: ... -def base64_decode(string: bytes_like) -> str: ... -def int_to_bytes(num: int) -> str: ... -def bytes_to_int(bytestr: bytes_like) -> int: ... +def base64_encode(string: bytes_like) -> bytes: ... +def base64_decode(string: bytes_like) -> bytes: ... +def int_to_bytes(num: int) -> bytes: ... +def bytes_to_int(bytestr: bytes_like) -> bytes: ... class SigningAlgorithm: - def get_signature(self, key: bytes_like, value: bytes_like) -> str: ... + def get_signature(self, key: bytes_like, value: bytes_like) -> bytes: ... def verify_signature(self, key: bytes_like, value: bytes_like, sig: bytes_like) -> bool: ... class NoneAlgorithm(SigningAlgorithm): @@ -59,7 +60,7 @@ class HMACAlgorithm(SigningAlgorithm): default_digest_method = ... # type: Callable digest_method = ... # type: Callable def __init__(self, digest_method: Optional[Callable] = ...) -> None: ... - def get_signature(self, key: bytes_like, value: bytes_like) -> str: ... + def get_signature(self, key: bytes_like, value: bytes_like) -> bytes: ... class Signer: default_digest_method = ... # type: Callable @@ -70,13 +71,13 @@ class Signer: key_derivation = ... # type: str digest_method = ... # type: Callable algorithm = ... # type: SigningAlgorithm - def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., sep: Optional[str]='', + def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., sep: Optional[str] = ..., key_derivation: Optional[str] = ..., digest_method: Optional[Callable] = ..., algorithm: Optional[SigningAlgorithm] = ...) -> None: ... - def derive_key(self) -> str: ... - def get_signature(self, value: bytes_like) -> str: ... - def sign(self, value: bytes_like) -> str: ... + def derive_key(self) -> bytes: ... + def get_signature(self, value: bytes_like) -> bytes: ... + def sign(self, value: bytes_like) -> bytes: ... def verify_signature(self, value: bytes_like, sig: bytes_like) -> bool: ... def unsign(self, signed_value: str) -> str: ... def validate(self, signed_value: str) -> bool: ... @@ -84,21 +85,21 @@ class Signer: class TimestampSigner(Signer): def get_timestamp(self) -> int: ... def timestamp_to_datetime(self, ts: int) -> datetime: ... - def sign(self, value: bytes_like) -> str: ... - def unsign(self, value: str, max_age: Optional[int] = ..., return_timestamp=False) -> Any: ... + def sign(self, value: bytes_like) -> bytes: ... + def unsign(self, value: str, max_age: Optional[int] = ..., return_timestamp: bool = ...) -> Any: ... def validate(self, signed_value: str, max_age: Optional[int] = ...) -> bool: ... class Serializer: - default_serializer = ... # type: Any + default_serializer = ... # type: _serializer default_signer = ... # type: Callable[..., Signer] secret_key = ... # type: Any salt = ... # type: bytes_like - serializer = ... # type: Any + serializer = ... # type: _serializer is_text_serializer = ... # type: bool signer = ... # type: Signer signer_kwargs = ... # type: MutableMapping - def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like]=b'', serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ... - def load_payload(self, payload: Any, serializer=None) -> Any: ... + def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ... + def load_payload(self, payload: Any, serializer: Optional[_serializer] = ...) -> Any: ... def dump_payload(self, *args, **kwargs) -> str: ... def make_signer(self, salt: Optional[bytes_like] = ...) -> Signer: ... def dumps(self, obj: Any, salt: Optional[bytes_like] = ...) -> str: ... @@ -110,7 +111,7 @@ class Serializer: class TimedSerializer(Serializer): default_signer = ... # type: Callable[..., TimestampSigner] - def loads(self, s: str, salt: Optional[bytes_like] = ..., max_age: Optional[int] = ..., return_timestamp=False) -> Any: ... + def loads(self, s: str, salt: Optional[bytes_like] = ..., max_age: Optional[int] = ..., return_timestamp: bool = ...) -> Any: ... def loads_unsafe(self, s: str, salt: Optional[bytes_like] = ..., max_age: Optional[int] = ...) -> Tuple[bool, Any]: ... class JSONWebSignatureSerializer(Serializer): @@ -119,22 +120,22 @@ class JSONWebSignatureSerializer(Serializer): default_serializer = ... # type: Any algorithm_name = ... # type: str algorithm = ... # type: Any - def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ... - def load_payload(self, payload: Any, return_header=False) -> Any: ... - def dump_payload(self, *args, **kwargs) -> str: ... + def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ... + def load_payload(self, payload: Any, serializer: Optional[_serializer] = ..., return_header: bool = ...) -> Any: ... + def dump_payload(self, *args, **kwargs) -> bytes: ... def make_algorithm(self, algorithm_name: str) -> SigningAlgorithm: ... def make_signer(self, salt: Optional[bytes_like] = ..., algorithm_name: Optional[str] = ...) -> Signer: ... - def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ... - def dumps(self, obj: Any, salt: Optional[bytes_like] = ..., header_fields=Optional[MutableMapping]) -> str: ... - def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header=False) -> Any: ... - def loads_unsafe(self, s, salt: Optional[bytes_like] = ..., return_header=False) -> Tuple[bool, Any]: ... + def make_header(self, header_fields: Optional[MutableMapping] = ...) -> MutableMapping: ... + def dumps(self, obj: Any, salt: Optional[bytes_like] = ..., header_fields: Optional[MutableMapping] = ...) -> str: ... + def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header: bool = ...) -> Any: ... + def loads_unsafe(self, s, salt: Optional[bytes_like] = ..., return_header: bool = ...) -> Tuple[bool, Any]: ... class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): DEFAULT_EXPIRES_IN = ... # type: int expires_in = ... # type: int def __init__(self, secret_key: bytes_like, expires_in: Optional[int] = ..., **kwargs) -> None: ... def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ... - def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header=False) -> Any: ... + def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header: bool = ...) -> Any: ... def get_issue_date(self, header: MutableMapping) -> Optional[datetime]: ... def now(self) -> int: ... diff --git a/third_party/3/itsdangerous.pyi b/third_party/3/itsdangerous.pyi index 097f98316..445c998b3 100644 --- a/third_party/3/itsdangerous.pyi +++ b/third_party/3/itsdangerous.pyi @@ -20,7 +20,7 @@ class _CompactJSON: compact_json = _CompactJSON EPOCH = ... # type: int -def want_bytes(s: _can_become_bytes, encoding: str='', errors: str='') -> bytes: ... +def want_bytes(s: _can_become_bytes, encoding: str = ..., errors: str = ...) -> bytes: ... def is_text_serializer(serializer: _serializer) -> bool: ... def constant_time_compare(val1: _comparable_bytes, val2: _comparable_bytes) -> bool: ... @@ -74,7 +74,7 @@ class Signer: key_derivation = ... # type: str digest_method = ... # type: Callable algorithm = ... # type: SigningAlgorithm - def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., sep: Optional[_can_become_bytes]='', + def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., sep: Optional[_can_become_bytes] = ..., key_derivation: Optional[str] = ..., digest_method: Optional[Callable] = ..., algorithm: Optional[SigningAlgorithm] = ...) -> None: ... @@ -101,8 +101,8 @@ class Serializer: is_text_serializer = ... # type: bool signer = ... # type: Signer signer_kwargs = ... # type: MutableMapping - def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=b'', serializer: _serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ... - def load_payload(self, payload: Any, serializer: _serializer=None) -> Any: ... + def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ... + def load_payload(self, payload: Any, serializer: Optional[_serializer] = ...) -> Any: ... def dump_payload(self, *args, **kwargs) -> bytes: ... def make_signer(self, salt: Optional[_can_become_bytes] = ...) -> Signer: ... def dumps(self, obj: Any, salt: Optional[_can_become_bytes] = ...) -> _str_like: ... @@ -123,8 +123,8 @@ class JSONWebSignatureSerializer(Serializer): default_serializer = ... # type: Any algorithm_name = ... # type: str algorithm = ... # type: Any - def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: _serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ... - def load_payload(self, payload: Any, serializer: _serializer = None, return_header: bool = ...) -> Any: ... + def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ... + def load_payload(self, payload: Any, serializer: Optional[_serializer] = ..., return_header: bool = ...) -> Any: ... def dump_payload(self, *args, **kwargs) -> bytes: ... def make_algorithm(self, algorithm_name: str) -> SigningAlgorithm: ... def make_signer(self, salt: Optional[_can_become_bytes] = ..., algorithm_name: Optional[str] = ...) -> Signer: ...