Add __all__ part 2 (#13719)

---------

Co-authored-by: Avasam <samuel.06@hotmail.com>
This commit is contained in:
Semyon Moroz
2025-03-31 18:27:19 -04:00
committed by GitHub
co-authored by Avasam
parent 0104531422
commit a3c8fce58d
132 changed files with 1057 additions and 171 deletions
+1 -35
View File
@@ -1,38 +1,3 @@
# TODO: missing from stub
passlib.hosts.__all__
passlib.crypto._blowfish.__all__
passlib.crypto._blowfish.base.__all__
passlib.crypto._blowfish.unrolled.__all__
passlib.crypto._md4.__all__
passlib.crypto.digest.__all__
passlib.crypto.scrypt.__all__
passlib.crypto.scrypt._builtin.__all__
passlib.handlers.argon2.__all__
passlib.handlers.bcrypt.__all__
passlib.handlers.cisco.__all__
passlib.handlers.des_crypt.__all__
passlib.handlers.digests.__all__
passlib.handlers.django.__all__
passlib.handlers.fshp.__all__
passlib.handlers.md5_crypt.__all__
passlib.handlers.misc.__all__
passlib.handlers.mssql.__all__
passlib.handlers.pbkdf2.__all__
passlib.handlers.phpass.__all__
passlib.handlers.postgres.__all__
passlib.handlers.roundup.__all__
passlib.handlers.scram.__all__
passlib.handlers.scrypt.__all__
passlib.handlers.sha1_crypt.__all__
passlib.handlers.sha2_crypt.__all__
passlib.handlers.sun_md5_crypt.__all__
passlib.handlers.windows.__all__
passlib.utils.binary.__all__
passlib.utils.decor.__all__
passlib.utils.handlers.__all__
passlib.utils.md4.__all__
passlib.utils.pbkdf2.__all__
# proxy module that uses some import magic incompatible with stubtest
passlib.hash
@@ -87,6 +52,7 @@ passlib.tests.*
# This is only available when the crypt module is available. This module
# was dropped from the standard library of Python 3.13, but is still available
# in some environments.
passlib.hosts.__all__
(passlib.hosts.host_context)?
# Fields differs at runtime:
@@ -1,3 +1,5 @@
from passlib.crypto._blowfish.unrolled import BlowfishEngine as BlowfishEngine
def raw_bcrypt(password, ident, salt, log_rounds): ...
__all__ = ["BlowfishEngine", "raw_bcrypt"]
@@ -11,3 +11,5 @@ class BlowfishEngine:
def eks_salted_expand(self, key_words, salt_words) -> None: ...
def eks_repeated_expand(self, key_words, salt_words, rounds) -> None: ...
def repeat_encipher(self, l, r, count): ...
__all__ = ["BlowfishEngine"]
@@ -3,3 +3,5 @@ from passlib.crypto._blowfish.base import BlowfishEngine as _BlowfishEngine
class BlowfishEngine(_BlowfishEngine):
def encipher(self, l, r): ...
def expand(self, key_words) -> None: ...
__all__ = ["BlowfishEngine"]
+2
View File
@@ -10,3 +10,5 @@ class md4:
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
__all__ = ["md4"]
+12
View File
@@ -26,3 +26,15 @@ class HashInfo(SequenceMixin):
def compile_hmac(digest, key, multipart: bool = False): ...
def pbkdf1(digest, secret, salt, rounds, keylen: Incomplete | None = None): ...
def pbkdf2_hmac(digest, secret, salt, rounds, keylen: Incomplete | None = None): ...
__all__ = [
# hash utils
"lookup_hash",
"HashInfo",
"norm_hash_name",
# hmac utils
"compile_hmac",
# kdfs
"pbkdf1",
"pbkdf2_hmac",
]
@@ -1,2 +1,4 @@
def validate(n, r, p): ...
def scrypt(secret, salt, n, r, p: int = 1, keylen: int = 32): ...
__all__ = ["validate", "scrypt"]
@@ -17,3 +17,5 @@ class ScryptEngine:
def run(self, secret, salt, keylen): ...
def smix(self, input) -> Generator[None, None, Any]: ...
def bmix(self, source, target) -> None: ...
__all__ = ["ScryptEngine"]
@@ -83,3 +83,5 @@ class _PureBackend(_Argon2Common): ...
class argon2(_NoBackend, _Argon2Common): # type: ignore[misc]
backends: ClassVar[tuple[str, ...]]
__all__ = ["argon2"]
@@ -53,3 +53,5 @@ class bcrypt_sha256(_wrapped_bcrypt):
@classmethod
def from_string(cls, hash): ...
def __init__(self, version: Incomplete | None = None, **kwds) -> None: ...
__all__ = ["bcrypt"]
+2
View File
@@ -25,3 +25,5 @@ class cisco_type7(uh.GenericHandler):
def __init__(self, salt: int | None = None, **kwds) -> None: ...
@classmethod
def decode(cls, hash, encoding: str = "utf-8"): ...
__all__ = ["cisco_pix", "cisco_asa", "cisco_type7"]
@@ -50,3 +50,5 @@ class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[
truncate_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
__all__ = ["des_crypt", "bsdi_crypt", "bigcrypt", "crypt16"]
@@ -30,3 +30,5 @@ class htdigest(uh.MinimalHandler):
def genconfig(cls): ...
@classmethod
def genhash(cls, secret, config, user, realm, encoding: Incomplete | None = None): ... # type: ignore[override]
__all__ = ["create_hex_hash", "hex_md4", "hex_md5", "hex_sha1", "hex_sha256", "hex_sha512"]
+11
View File
@@ -79,3 +79,14 @@ class django_disabled(DisabledHash, uh.StaticHandler):
def identify(cls, hash: str | bytes) -> bool: ...
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
__all__ = [
"django_salted_sha1",
"django_salted_md5",
"django_bcrypt",
"django_pbkdf2_sha1",
"django_pbkdf2_sha256",
"django_argon2",
"django_des_crypt",
"django_disabled",
]
+2
View File
@@ -24,3 +24,5 @@ class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
def checksum_size(self): ...
@classmethod
def from_string(cls, hash): ...
__all__ = ["fshp"]
@@ -18,3 +18,5 @@ class md5_crypt(uh.HasManyBackends, _MD5_Common):
class apr_md5_crypt(_MD5_Common):
name: ClassVar[str]
ident: ClassVar[str]
__all__ = ["md5_crypt", "apr_md5_crypt"]
+2
View File
@@ -48,3 +48,5 @@ class plaintext(uh.MinimalHandler):
def genconfig(cls): ...
@classmethod
def genhash(cls, secret, config, encoding: str | None = None): ... # type: ignore[override]
__all__ = ["unix_disabled", "unix_fallback", "plaintext"]
+2
View File
@@ -19,3 +19,5 @@ class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
__all__ = ["mssql2000", "mssql2005"]
@@ -87,3 +87,5 @@ class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gene
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
__all__ = ["pbkdf2_sha1", "pbkdf2_sha256", "pbkdf2_sha512", "cta_pbkdf2_sha1", "dlitz_pbkdf2_sha1", "grub_pbkdf2_sha512"]
@@ -18,3 +18,5 @@ class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): #
ident_aliases: ClassVar[dict[str, str]]
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
__all__ = ["phpass"]
@@ -6,3 +6,5 @@ class postgres_md5(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
__all__ = ["postgres_md5"]
@@ -3,3 +3,5 @@ from typing import Any
roundup_plaintext: Any
ldap_hex_md5: Any
ldap_hex_sha1: Any
__all__ = ["roundup_plaintext", "ldap_hex_md5", "ldap_hex_sha1"]
+2
View File
@@ -27,3 +27,5 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
def __init__(self, algs: Incomplete | None = None, **kwds) -> None: ...
@classmethod
def verify(cls, secret, hash, full: bool = False): ... # type: ignore[override]
__all__ = ["scram"]
@@ -31,3 +31,5 @@ class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum
def has_backend(cls, name: str = "any"): ...
@classmethod
def set_backend(cls, name: str = "any", dryrun: bool = False) -> None: ...
__all__ = ["scrypt"]
@@ -21,3 +21,5 @@ class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
def to_string(self, config: bool = False) -> str: ...
backends: ClassVar[tuple[str, ...]]
__all__: list[str] = []
@@ -27,3 +27,5 @@ class sha512_crypt(_SHA2_Common):
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_rounds: ClassVar[int]
__all__ = ["sha512_crypt", "sha256_crypt"]
@@ -22,3 +22,5 @@ class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignor
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
def to_string(self, _withchk: bool = True) -> str: ...
__all__ = ["sun_md5_crypt"]
@@ -42,3 +42,5 @@ class msdcc2(uh.HasUserContext, uh.StaticHandler):
checksum_size: ClassVar[int]
@classmethod
def raw(cls, secret, user): ...
__all__ = ["lmhash", "nthash", "bsd_nthash", "msdcc", "msdcc2"]
+29
View File
@@ -49,3 +49,32 @@ class LazyBase64Engine(Base64Engine):
h64: Any
h64big: Any
bcrypt64: Any
__all__ = [
# constants
"BASE64_CHARS",
"PADDED_BASE64_CHARS",
"AB64_CHARS",
"HASH64_CHARS",
"BCRYPT_CHARS",
"HEX_CHARS",
"LOWER_HEX_CHARS",
"UPPER_HEX_CHARS",
"ALL_BYTE_VALUES",
# misc
"compile_byte_translation",
# base64
"ab64_encode",
"ab64_decode",
"b64s_encode",
"b64s_decode",
# base32
"b32encode",
"b32decode",
# custom encodings
"Base64Engine",
"LazyBase64Engine",
"h64",
"h64big",
"bcrypt64",
]
+9
View File
@@ -40,3 +40,12 @@ def deprecated_method(
updoc: bool = True,
replacement: Incomplete | None = None,
): ...
__all__ = [
"classproperty",
"hybrid_method",
"memoize_single_value",
"memoized_property",
"deprecated_function",
"deprecated_method",
]
+20
View File
@@ -183,3 +183,23 @@ class PrefixWrapper:
def encrypt(self, secret, **kwds): ...
def hash(self, secret, **kwds): ...
def verify(self, secret, hash, **kwds): ...
__all__ = [
# helpers for implementing MCF handlers
"parse_mc2",
"parse_mc3",
"render_mc2",
"render_mc3",
# framework for implementing handlers
"GenericHandler",
"StaticHandler",
"HasUserContext",
"HasRawChecksum",
"HasManyIdents",
"HasSalt",
"HasRawSalt",
"HasRounds",
"HasManyBackends",
# other helpers
"PrefixWrapper",
]
+2
View File
@@ -1,3 +1,5 @@
from typing import Any
md4: Any
__all__ = ["md4"]
+10
View File
@@ -5,3 +5,13 @@ from passlib.crypto.digest import norm_hash_name as norm_hash_name
def get_prf(name): ...
def pbkdf1(secret, salt, rounds, keylen: Incomplete | None = None, hash: str = "sha1"): ...
def pbkdf2(secret, salt, rounds, keylen: Incomplete | None = None, prf: str = "hmac-sha1"): ...
__all__ = [
# hash utils
"norm_hash_name",
# prf utils
"get_prf",
# kdfs
"pbkdf1",
"pbkdf2",
]