better stubs

This commit is contained in:
Maxim Kurnikov
2018-08-05 03:13:19 +03:00
parent 4013fe4d03
commit fa718b8e55
380 changed files with 11805 additions and 8503 deletions

View File

@@ -1,28 +1,20 @@
# Stubs for django.contrib.auth.hashers (Python 3.6)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from collections import OrderedDict
from typing import Callable, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Optional
UNUSABLE_PASSWORD_PREFIX: str
UNUSABLE_PASSWORD_SUFFIX_LENGTH: int
def is_password_usable(encoded: Optional[str]) -> bool: ...
def check_password(
password: str, encoded: str, setter: Optional[Callable] = ..., preferred: str = ...
password: Optional[str],
encoded: str,
setter: Optional[Callable] = ...,
preferred: str = ...,
) -> bool: ...
def make_password(
password: Optional[str], salt: Optional[str] = ..., hasher: str = ...
) -> str: ...
def get_hashers() -> Union[
List[UnsaltedMD5PasswordHasher],
List[MD5PasswordHasher],
List[BasePasswordHasher],
List[PBKDF2PasswordHasher],
]: ...
def get_hashers() -> List[BasePasswordHasher]: ...
def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ...
def reset_hashers(**kwargs: Any) -> None: ...
def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ...
@@ -32,11 +24,10 @@ def mask_hash(hash: str, show: int = ..., char: str = ...) -> str: ...
class BasePasswordHasher:
algorithm: Any = ...
library: Any = ...
def _load_library(self): ...
def salt(self) -> str: ...
def verify(self, password: Any, encoded: Any) -> None: ...
def encode(self, password: Any, salt: Any) -> None: ...
def safe_summary(self, encoded: str) -> None: ...
def verify(self, password: str, encoded: str) -> Any: ...
def encode(self, password: str, salt: str) -> Any: ...
def safe_summary(self, encoded: str) -> Any: ...
def must_update(self, encoded: str) -> bool: ...
def harden_runtime(self, password: str, encoded: str) -> None: ...
@@ -44,11 +35,13 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
algorithm: str = ...
iterations: int = ...
digest: Any = ...
def encode(self, password: str, salt: str, iterations: Optional[int] = ...) -> str: ...
def encode(
self, password: str, salt: str, iterations: Optional[int] = ...
) -> str: ...
def verify(self, password: str, encoded: str) -> bool: ...
def safe_summary(self, encoded: Any): ...
def safe_summary(self, encoded: str) -> OrderedDict: ...
def must_update(self, encoded: str) -> bool: ...
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
def harden_runtime(self, password: str, encoded: str) -> None: ...
class PBKDF2SHA1PasswordHasher(PBKDF2PasswordHasher):
algorithm: str = ...
@@ -65,7 +58,6 @@ class Argon2PasswordHasher(BasePasswordHasher):
def safe_summary(self, encoded: Any): ...
def must_update(self, encoded: Any): ...
def harden_runtime(self, password: Any, encoded: Any) -> None: ...
def _decode(self, encoded: Any): ...
class BCryptSHA256PasswordHasher(BasePasswordHasher):
algorithm: str = ...
@@ -107,7 +99,7 @@ class UnsaltedSHA1PasswordHasher(BasePasswordHasher):
class UnsaltedMD5PasswordHasher(BasePasswordHasher):
algorithm: str = ...
def salt(self): ...
def salt(self) -> str: ...
def encode(self, password: str, salt: str) -> str: ...
def verify(self, password: str, encoded: str) -> bool: ...
def safe_summary(self, encoded: Any): ...