Remove passlib (#15415)

This commit is contained in:
Sebastian Rittau
2026-02-10 16:58:37 +01:00
committed by GitHub
parent bbb00d9883
commit c492f449fc
66 changed files with 0 additions and 2381 deletions
-1
View File
@@ -67,7 +67,6 @@
"stubs/opentracing/opentracing/span.pyi",
"stubs/paramiko/paramiko/_winapi.pyi",
"stubs/parsimonious/parsimonious/nodes.pyi",
"stubs/passlib",
"stubs/peewee",
"stubs/pexpect",
"stubs/pika",
@@ -1,57 +0,0 @@
# proxy module that uses some import magic incompatible with stubtest
passlib.hash
# django unsupported in stubs
passlib.ext.django.models
# uses @memoized_property at runtime, but @property in the stubs
passlib.crypto.digest.HashInfo.supported
passlib.crypto.digest.HashInfo.supported_by_fastpbkdf2
passlib.crypto.digest.HashInfo.supported_by_hashlib_pbkdf2
passlib.pwd.PhraseGenerator.symbol_count
passlib.pwd.SequenceGenerator.entropy
passlib.pwd.SequenceGenerator.entropy_per_symbol
passlib.pwd.SequenceGenerator.symbol_count
passlib.pwd.WordGenerator.symbol_count
passlib.totp.TotpMatch.cache_seconds
passlib.totp.TotpMatch.cache_time
passlib.totp.TotpMatch.expected_counter
passlib.totp.TotpMatch.expire_time
passlib.totp.TotpMatch.skipped
passlib.totp.TotpToken.expire_time
passlib.totp.TotpToken.start_time
# "hybrid" method that can be called on an instance or class
passlib.totp.TOTP.normalize_token
# import problem
passlib.utils.compat._ordered_dict
# initialized to None, but set by concrete sub-classes
passlib.handlers.pbkdf2.Pbkdf2DigestHandler.default_rounds
passlib.utils.handlers.GenericHandler.setting_kwds
# set to None on class level, but initialized in __init__
passlib.utils.handlers.HasManyIdents.ident
passlib.utils.handlers.HasRounds.rounds
# Errors in `__all__` at runtime:
# TODO: change after https://github.com/python/mypy/pull/14217 is released
passlib.handlers.oracle.__all__
passlib.handlers.mysql.__all__
# Compat tools are ignored:
passlib.utils.compat.*
# Tests are not included:
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:
passlib.apache._CommonFile.encoding
passlib.apache._CommonFile.return_unicode
@@ -1,2 +0,0 @@
# Only exists if crypt is present
passlib.hosts.host_context
@@ -1,3 +0,0 @@
from passlib.hash import bcrypt
bcrypt.using(rounds=13).hash("password")
-8
View File
@@ -1,8 +0,0 @@
version = "1.7.*"
upstream_repository = "https://foss.heptapod.net/python-libs/passlib"
no_longer_updated = true
[tool.stubtest]
# The runtime package has an undeclared dependency on setuptools.
# setuptools 82 dropped pkg_resources, which passlib relies on.
stubtest_requirements = ["setuptools<82"]
-3
View File
@@ -1,3 +0,0 @@
from typing import Final
__version__: Final[str]
-102
View File
@@ -1,102 +0,0 @@
from typing_extensions import Self
from .context import CryptContext
from .hash import htdigest
class _CommonFile:
encoding: str
return_unicode: bool
autosave: bool
@classmethod
def from_string(
cls,
data: str | bytes,
*,
new: bool = False,
autoload: bool = True,
autosave: bool = False,
encoding: str = "utf-8",
return_unicode: bool = True,
) -> Self: ...
@classmethod
def from_path(
cls,
path: str,
*,
new: bool = False,
autoload: bool = True,
autosave: bool = False,
encoding: str = "utf-8",
return_unicode: bool = True,
) -> Self: ...
def __init__(
self,
path: str | None = None,
new: bool = False,
autoload: bool = True,
autosave: bool = False,
encoding: str = "utf-8",
return_unicode: bool = True,
) -> None: ...
@property
def path(self) -> str: ...
@path.setter
def path(self, value: str) -> None: ...
@property
def mtime(self) -> float: ...
def load_if_changed(self) -> bool: ...
def load(self, path: str | None = None, force: bool = True) -> bool: ...
def load_string(self, data: str | bytes) -> None: ...
def save(self, path: str | None = None) -> None: ...
def to_string(self) -> bytes: ...
class HtpasswdFile(_CommonFile):
context: CryptContext
def __init__(
self,
path: str | None = None,
default_scheme: str | None = None,
context: CryptContext = ...,
*,
new: bool = False,
autoload: bool = True,
autosave: bool = False,
encoding: str = "utf-8",
return_unicode: bool = True,
) -> None: ...
def users(self) -> list[str | bytes]: ...
def set_password(self, user: str, password: str | bytes) -> bool: ...
def update(self, user: str, password: str | bytes) -> bool: ...
def get_hash(self, user: str) -> bytes | None: ...
def set_hash(self, user: str, hash: str | bytes) -> bool: ...
def find(self, user: str) -> bytes | None: ...
def delete(self, user: str) -> bool: ...
def check_password(self, user: str, password: str | bytes) -> bool | None: ...
def verify(self, user: str, password: str | bytes) -> bool | None: ...
class HtdigestFile(_CommonFile):
default_realm: str | None
def __init__(
self,
path: str | None = None,
default_realm: str | None = None,
*,
new: bool = False,
autoload: bool = True,
autosave: bool = False,
encoding: str = "utf-8",
return_unicode: bool = True,
) -> None: ...
def realms(self) -> list[str | bytes]: ...
def users(self, realm: str | None = None) -> list[str | bytes]: ...
def set_password(self, user: str, realm: str | None = None, password: str | bytes = ...) -> bool: ...
def update(self, user: str, realm: str | None, password: str | bytes) -> bool: ...
def get_hash(self, user: str, realm: str | None = None) -> htdigest | None: ...
def set_hash(self, user: str, realm: str | None = None, hash: str | bytes = ...) -> bool: ...
def find(self, user: str, realm: str | None) -> htdigest | None: ...
def delete(self, user: str, realm: str | None = None) -> bool: ...
def delete_realm(self, realm: str | None) -> int: ...
def check_password(self, user: str, realm: str | None = None, password: str | bytes = ...) -> bool | None: ...
def verify(self, user: str, realm: str | None, password: str | bytes) -> bool | None: ...
__all__ = ["HtpasswdFile", "HtdigestFile"]
-35
View File
@@ -1,35 +0,0 @@
from .context import CryptContext
__all__ = [
"custom_app_context",
"django_context",
"ldap_context",
"ldap_nocrypt_context",
"mysql_context",
"mysql4_context",
"mysql3_context",
"phpass_context",
"phpbb3_context",
"postgres_context",
]
master_context: CryptContext
custom_app_context: CryptContext
django10_context: CryptContext
django14_context: CryptContext
django16_context: CryptContext
django110_context: CryptContext
django21_context: CryptContext
django_context = django21_context
std_ldap_schemes: list[str]
ldap_nocrypt_context: CryptContext
ldap_context: CryptContext
mysql3_context: CryptContext
mysql4_context: CryptContext
mysql_context = mysql4_context
postgres_context: CryptContext
phpass_context: CryptContext
phpbb3_context: CryptContext
roundup10_context: CryptContext
roundup15_context: CryptContext
roundup_context = roundup15_context
-87
View File
@@ -1,87 +0,0 @@
from _typeshed import StrOrBytesPath, SupportsItems
from typing import Any
from typing_extensions import Self
class CryptPolicy:
@classmethod
def from_path(cls, path, section: str = "passlib", encoding: str = "utf-8"): ...
@classmethod
def from_string(cls, source, section: str = "passlib", encoding: str = "utf-8"): ...
@classmethod
def from_source(cls, source, _warn: bool = True): ...
@classmethod
def from_sources(cls, sources, _warn: bool = True): ...
def replace(self, *args, **kwds): ...
def __init__(self, *args, **kwds) -> None: ...
def has_schemes(self): ...
def iter_handlers(self): ...
def schemes(self, resolve: bool = False): ...
def get_handler(self, name=None, category=None, required: bool = False): ...
def get_min_verify_time(self, category=None): ...
def get_options(self, name, category=None): ...
def handler_is_deprecated(self, name, category=None): ...
def iter_config(self, ini: bool = False, resolve: bool = False): ...
def to_dict(self, resolve: bool = False): ...
def to_file(self, stream, section: str = "passlib") -> None: ...
def to_string(self, section: str = "passlib", encoding=None): ...
class CryptContext:
@classmethod
def from_string(cls, source: str | bytes, section: str = "passlib", encoding: str = "utf-8") -> Self: ...
@classmethod
def from_path(cls, path: StrOrBytesPath, section: str = "passlib", encoding: str = "utf-8") -> Self: ...
def copy(self, **kwds: Any) -> CryptContext: ...
def using(self, **kwds: Any) -> CryptContext: ...
def replace(self, **kwds): ...
def __init__(self, schemes=None, policy=..., _autoload: bool = True, **kwds) -> None: ...
policy: CryptPolicy
def load_path(
self, path: StrOrBytesPath, update: bool = False, section: str = "passlib", encoding: str = "utf-8"
) -> None: ...
def load(
self,
source: str | bytes | SupportsItems[str, Any] | CryptContext,
update: bool = False,
section: str = "passlib",
encoding: str = "utf-8",
) -> None: ...
def update(self, *args: Any, **kwds: Any) -> None: ...
def schemes(self, resolve: bool = False, category=None, unconfigured: bool = False): ...
def default_scheme(self, category=None, resolve: bool = False, unconfigured: bool = False): ...
def handler(self, scheme=None, category=None, unconfigured: bool = False): ...
@property
def context_kwds(self): ...
def to_dict(self, resolve: bool = False) -> dict[str, Any]: ...
def to_string(self, section: str = "passlib") -> str: ...
mvt_estimate_max_samples: int
mvt_estimate_min_samples: int
mvt_estimate_max_time: int
mvt_estimate_resolution: float
harden_verify: Any
min_verify_time: int
def reset_min_verify_time(self) -> None: ...
def needs_update(
self, hash: str | bytes, scheme: str | None = None, category: str | None = None, secret: str | bytes | None = None
) -> bool: ...
def hash_needs_update(self, hash, scheme=None, category=None): ...
def genconfig(self, scheme=None, category=None, **settings): ...
def genhash(self, secret, config, scheme=None, category=None, **kwds): ...
def identify(self, hash, category=None, resolve: bool = False, required: bool = False, unconfigured: bool = False): ...
def hash(self, secret: str | bytes, scheme: str | None = None, category: str | None = None, **kwds: Any) -> str: ...
def encrypt(self, *args, **kwds): ...
def verify(
self, secret: str | bytes, hash: str | bytes | None, scheme: str | None = None, category: str | None = None, **kwds: Any
) -> bool: ...
def verify_and_update(
self, secret: str | bytes, hash: str | bytes | None, scheme: str | None = None, category: str | None = None, **kwds: Any
) -> tuple[bool, str | None]: ...
def dummy_verify(self, elapsed: int = 0): ...
def is_enabled(self, hash: str | bytes) -> bool: ...
def disable(self, hash: str | bytes | None = None) -> str: ...
def enable(self, hash: str | bytes) -> str: ...
class LazyCryptContext(CryptContext):
def __init__(self, schemes=None, **kwds) -> None: ...
def __getattribute__(self, attr: str) -> Any: ...
__all__ = ["CryptContext", "LazyCryptContext", "CryptPolicy"]
@@ -1,5 +0,0 @@
from passlib.crypto._blowfish.unrolled import BlowfishEngine as BlowfishEngine
def raw_bcrypt(password, ident, salt, log_rounds): ...
__all__ = ["BlowfishEngine", "raw_bcrypt"]
@@ -1,11 +0,0 @@
from typing import Any
def varlist(name, count): ...
def indent_block(block, padding): ...
BFSTR: Any
def render_encipher(write, indent: int = 0) -> None: ...
def write_encipher_function(write, indent: int = 0) -> None: ...
def write_expand_function(write, indent: int = 0) -> None: ...
def main() -> None: ...
@@ -1,15 +0,0 @@
from typing import Any
class BlowfishEngine:
P: Any
S: Any
def __init__(self) -> None: ...
@staticmethod
def key_to_words(data, size: int = 18): ...
def encipher(self, l, r): ...
def expand(self, key_words) -> None: ...
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"]
@@ -1,7 +0,0 @@
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"]
-12
View File
@@ -1,12 +0,0 @@
class md4:
name: str
digest_size: int
digestsize: int
block_size: int
def __init__(self, content=None) -> None: ...
def update(self, content) -> None: ...
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
__all__ = ["md4"]
-5
View File
@@ -1,5 +0,0 @@
__all__ = ["expand_des_key", "des_encrypt_block"]
def expand_des_key(key): ...
def des_encrypt_block(key, input, salt: int = 0, rounds: int = 1): ...
def des_encrypt_int_block(key, input, salt: int = 0, rounds: int = 1): ...
-39
View File
@@ -1,39 +0,0 @@
from typing import Any
from passlib.utils import SequenceMixin
def lookup_hash(digest, return_unknown: bool = False, required: bool = True): ...
def norm_hash_name(name, format: str = "hashlib"): ...
class HashInfo(SequenceMixin):
name: Any
iana_name: Any
aliases: Any
const: Any
digest_size: Any
block_size: Any
error_text: Any
unknown: bool
def __init__(self, const, names, required: bool = True) -> None: ...
@property
def supported(self): ...
@property
def supported_by_fastpbkdf2(self): ...
@property
def supported_by_hashlib_pbkdf2(self): ...
def compile_hmac(digest, key, multipart: bool = False): ...
def pbkdf1(digest, secret, salt, rounds, keylen=None): ...
def pbkdf2_hmac(digest, secret, salt, rounds, keylen=None): ...
__all__ = [
# hash utils
"lookup_hash",
"HashInfo",
"norm_hash_name",
# hmac utils
"compile_hmac",
# kdfs
"pbkdf1",
"pbkdf2_hmac",
]
@@ -1,4 +0,0 @@
def validate(n, r, p): ...
def scrypt(secret, salt, n, r, p: int = 1, keylen: int = 32): ...
__all__ = ["validate", "scrypt"]
@@ -1,21 +0,0 @@
from collections.abc import Generator
from typing import Any
class ScryptEngine:
n: int
r: int
p: int
smix_bytes: int
iv_bytes: int
bmix_len: int
bmix_half_len: int
bmix_struct: Any
integerify: Any
@classmethod
def execute(cls, secret, salt, n, r, p, keylen): ...
def __init__(self, n, r, p): ...
def run(self, secret, salt, keylen): ...
def smix(self, input) -> Generator[None, None, Any]: ...
def bmix(self, source, target) -> None: ...
__all__ = ["ScryptEngine"]
@@ -1 +0,0 @@
def main() -> None: ...
@@ -1 +0,0 @@
def salsa20(input): ...
-55
View File
@@ -1,55 +0,0 @@
from typing import Any
class UnknownBackendError(ValueError):
hasher: Any
backend: Any
def __init__(self, hasher, backend) -> None: ...
class MissingBackendError(RuntimeError): ...
class InternalBackendError(RuntimeError): ...
class PasswordValueError(ValueError): ...
class PasswordSizeError(PasswordValueError):
max_size: Any
def __init__(self, max_size, msg=None) -> None: ...
class PasswordTruncateError(PasswordSizeError):
def __init__(self, cls, msg=None) -> None: ...
class PasslibSecurityError(RuntimeError): ...
class TokenError(ValueError):
def __init__(self, msg=None, *args, **kwds) -> None: ...
class MalformedTokenError(TokenError): ...
class InvalidTokenError(TokenError): ...
class UsedTokenError(TokenError):
expire_time: Any
def __init__(self, *args, **kwds) -> None: ...
class UnknownHashError(ValueError):
value: Any
message: Any
def __init__(self, message=None, value=None) -> None: ...
class PasslibWarning(UserWarning): ...
class PasslibConfigWarning(PasslibWarning): ...
class PasslibHashWarning(PasslibWarning): ...
class PasslibRuntimeWarning(PasslibWarning): ...
class PasslibSecurityWarning(PasslibWarning): ...
def type_name(value): ...
def ExpectedTypeError(value, expected, param): ...
def ExpectedStringError(value, param): ...
def MissingDigestError(handler=None): ...
def NullPasswordError(handler=None): ...
def InvalidHashError(handler=None): ...
def MalformedHashError(handler=None, reason=None): ...
def ZeroPaddedRoundsError(handler=None): ...
def ChecksumSizeError(handler, raw: bool = False): ...
ENABLE_DEBUG_ONLY_REPR: bool
def debug_only_repr(value, param: str = "hash"): ...
def CryptBackendError(handler, config, hash, source: str = "crypt.crypt()") -> None: ...
@@ -1,3 +0,0 @@
from typing import Any
password_context: Any
@@ -1,55 +0,0 @@
from typing import Any
__all__ = ["DJANGO_VERSION", "MIN_DJANGO_VERSION", "get_preset_config", "quirks"]
DJANGO_VERSION: tuple[Any, ...]
MIN_DJANGO_VERSION: tuple[int, int]
class quirks:
none_causes_check_password_error: Any
empty_is_usable_password: Any
invalid_is_usable_password: Any
def get_preset_config(name): ...
class DjangoTranslator:
context: Any
def __init__(self, context=None, **kwds) -> None: ...
def reset_hashers(self) -> None: ...
def passlib_to_django_name(self, passlib_name): ...
def passlib_to_django(self, passlib_hasher, cached: bool = True): ...
def django_to_passlib_name(self, django_name): ...
def django_to_passlib(self, django_name, cached: bool = True): ...
def resolve_django_hasher(self, django_name, cached: bool = True): ...
class DjangoContextAdapter(DjangoTranslator):
context: Any
is_password_usable: Any
enabled: bool
patched: bool
log: Any
def __init__(self, context=None, get_user_category=None, **kwds) -> None: ...
def reset_hashers(self) -> None: ...
def get_hashers(self): ...
def get_hasher(self, algorithm: str = "default"): ...
def identify_hasher(self, encoded): ...
def make_password(self, password, salt=None, hasher: str = "default"): ...
def check_password(self, password, encoded, setter=None, preferred: str = "default"): ...
def user_check_password(self, user, password): ...
def user_set_password(self, user, password) -> None: ...
def get_user_category(self, user): ...
HASHERS_PATH: str
MODELS_PATH: str
USER_CLASS_PATH: Any
FORMS_PATH: str
patch_locations: Any
def install_patch(self): ...
def remove_patch(self): ...
def load_model(self) -> None: ...
class ProxyProperty:
attr: Any
def __init__(self, attr) -> None: ...
def __get__(self, obj, cls): ...
def __set__(self, obj, value) -> None: ...
def __delete__(self, obj) -> None: ...
-79
View File
@@ -1,79 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class _DummyCffiHasher:
time_cost: int
memory_cost: int
parallelism: int
salt_len: int
hash_len: int
class _Argon2Common( # type: ignore[misc]
uh.SubclassBackendMixin, uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler
):
name: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
max_parallelism: ClassVar[int]
max_version: ClassVar[int]
min_desired_version: ClassVar[int | None]
min_memory_cost: ClassVar[int]
max_threads: ClassVar[int]
pure_use_threads: ClassVar[bool]
def type_values(cls): ...
type: str
parallelism: int
version: int
memory_cost: int
@property
def type_d(self): ...
data: Any
@classmethod
def using( # type: ignore[override]
cls,
type=None,
memory_cost=None,
salt_len=None,
time_cost=None,
digest_size=None,
checksum_size=None,
hash_len=None,
max_threads=None,
**kwds,
): ...
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
def __init__(self, type=None, type_d: bool = False, version=None, memory_cost=None, data=None, **kwds) -> None: ...
class _NoBackend(_Argon2Common):
@classmethod
def hash(cls, secret): ... # type: ignore[override]
@classmethod
def verify(cls, secret, hash): ... # type: ignore[override]
@classmethod
def genhash(cls, secret, config): ... # type: ignore[override]
class _CffiBackend(_Argon2Common):
@classmethod
def hash(cls, secret): ... # type: ignore[override]
@classmethod
def verify(cls, secret, hash): ... # type: ignore[override]
@classmethod
def genhash(cls, secret, config): ... # type: ignore[override]
class _PureBackend(_Argon2Common): ...
class argon2(_NoBackend, _Argon2Common): # type: ignore[misc]
backends: ClassVar[tuple[str, ...]]
__all__ = ["argon2"]
-57
View File
@@ -1,57 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
default_ident: ClassVar[str]
ident_values: ClassVar[tuple[str, ...]]
ident_aliases: ClassVar[dict[str, str]]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
final_salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
truncate_size: ClassVar[int | None]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def needs_update(cls, hash, **kwds): ... # type: ignore[override]
@classmethod
def normhash(cls, hash): ...
class _NoBackend(_BcryptCommon): ...
class _BcryptBackend(_BcryptCommon): ...
class _BcryptorBackend(_BcryptCommon): ...
class _PyBcryptBackend(_BcryptCommon): ...
class _OsCryptBackend(_BcryptCommon): ...
class _BuiltinBackend(_BcryptCommon): ...
class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc]
backends: ClassVar[tuple[str, ...]]
class _wrapped_bcrypt(bcrypt):
truncate_size: ClassVar[None]
class bcrypt_sha256(_wrapped_bcrypt):
name: ClassVar[str]
ident_values: ClassVar[tuple[str, ...]]
ident_aliases: ClassVar[dict[str, str]]
default_ident: ClassVar[str]
version: ClassVar[int]
@classmethod
def using(cls, version=None, **kwds): ... # type: ignore[override]
prefix: Any
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
def __init__(self, version=None, **kwds) -> None: ...
__all__ = ["bcrypt"]
-30
View File
@@ -1,30 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class cisco_pix(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
truncate_size: ClassVar[int]
truncate_error: ClassVar[bool]
truncate_verify_reject: ClassVar[bool]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
class cisco_asa(cisco_pix): ...
class cisco_type7(uh.GenericHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
min_salt_value: ClassVar[int]
max_salt_value: ClassVar[int]
@classmethod
def using(cls, salt: int | None = None, **kwds): ... # type: ignore[override]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
salt: int
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"]
@@ -1,55 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
truncate_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
backends: ClassVar[tuple[str, ...]]
class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def using(cls, **kwds): ... # type: ignore[override]
backends: ClassVar[tuple[str, ...]]
class bigcrypt(uh.HasSalt, uh.GenericHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
truncate_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
__all__ = ["des_crypt", "bsdi_crypt", "bigcrypt", "crypt16"]
@@ -1,37 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import deprecated
import passlib.utils.handlers as uh
class HexDigestHash(uh.StaticHandler):
checksum_chars: ClassVar[str]
supported: ClassVar[bool]
def create_hex_hash(digest, module="passlib.handlers.digests", django_name=None, required: bool = True): ...
hex_md4: Incomplete
hex_md5: Incomplete
hex_sha1: Incomplete
hex_sha256: Incomplete
hex_sha512: Incomplete
class htdigest(uh.MinimalHandler):
name: ClassVar[str]
default_encoding: ClassVar[str]
setting_kwds: ClassVar[tuple[str, ...]]
context_kwds: ClassVar[tuple[str, ...]]
@classmethod
def hash(cls, secret, user, realm, encoding=None): ... # type: ignore[override]
@classmethod
def verify(cls, secret, hash, user, realm, encoding: str = "utf-8"): ... # type: ignore[override]
@classmethod
def identify(cls, hash): ...
@deprecated("Deprecated since Passlib 1.7, will be removed in 2.0")
@classmethod
def genconfig(cls): ... # type: ignore[override]
@deprecated("Deprecated since Passlib 1.7, will be removed in 2.0")
@classmethod
def genhash(cls, secret, config, user, realm, encoding=None): ... # type: ignore[override]
__all__ = ["create_hex_hash", "hex_md4", "hex_md5", "hex_sha1", "hex_sha256", "hex_sha512"]
-93
View File
@@ -1,93 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
from passlib.handlers.bcrypt import _wrapped_bcrypt
from passlib.ifc import DisabledHash
class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler):
default_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
checksum_chars: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): # type: ignore[misc]
min_rounds: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class django_salted_sha1(DjangoSaltedHash):
name: ClassVar[str]
django_name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
class django_salted_md5(DjangoSaltedHash):
name: ClassVar[str]
django_name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
django_bcrypt: Any
class django_bcrypt_sha256(_wrapped_bcrypt):
name: ClassVar[str]
django_name: ClassVar[str]
django_prefix: ClassVar[str]
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class django_pbkdf2_sha256(DjangoVariableHash):
name: ClassVar[str]
django_name: ClassVar[str]
ident: ClassVar[str]
min_salt_size: ClassVar[int]
max_rounds: ClassVar[int]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
default_rounds: ClassVar[int]
class django_pbkdf2_sha1(django_pbkdf2_sha256):
name: ClassVar[str]
django_name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_rounds: ClassVar[int]
django_argon2: Any
class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
django_name: ClassVar[str]
ident: ClassVar[str]
checksum_chars: ClassVar[str]
salt_chars: ClassVar[str]
checksum_size: ClassVar[int]
min_salt_size: ClassVar[int]
default_salt_size: ClassVar[int]
truncate_size: ClassVar[int]
use_duplicate_salt: bool
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class django_disabled(DisabledHash, uh.StaticHandler):
name: ClassVar[str]
suffix_length: ClassVar[int]
@classmethod
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",
]
-29
View File
@@ -1,29 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_chars: ClassVar[str]
ident: ClassVar[str]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[None]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
default_variant: ClassVar[int]
@classmethod
def using(cls, variant: int | str | bytes | None = None, **kwds): ... # type: ignore[override]
variant: int | None
use_defaults: Any
def __init__(self, variant: int | str | bytes | None = None, **kwds) -> None: ...
@property
def checksum_alg(self): ...
@property
def checksum_size(self): ... # type: ignore[override]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
__all__ = ["fshp"]
@@ -1,82 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
from passlib.handlers.misc import plaintext
from passlib.utils.handlers import PrefixWrapper
__all__ = [
"ldap_plaintext",
"ldap_md5",
"ldap_sha1",
"ldap_salted_md5",
"ldap_salted_sha1",
"ldap_salted_sha256",
"ldap_salted_sha512",
"ldap_des_crypt",
"ldap_bsdi_crypt",
"ldap_md5_crypt",
"ldap_sha1_crypt",
"ldap_bcrypt",
"ldap_sha256_crypt",
"ldap_sha512_crypt",
]
class _Base64DigestHelper(uh.StaticHandler):
ident: ClassVar[str | None]
checksum_chars: ClassVar[str]
class _SaltedBase64DigestHelper(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
checksum_chars: ClassVar[str]
ident: ClassVar[str | None]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class ldap_md5(_Base64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
class ldap_sha1(_Base64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
class ldap_salted_md5(_SaltedBase64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
class ldap_salted_sha1(_SaltedBase64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
class ldap_salted_sha256(_SaltedBase64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
class ldap_salted_sha512(_SaltedBase64DigestHelper):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
class ldap_plaintext(plaintext):
name: ClassVar[str]
@classmethod
def genconfig(cls): ... # type: ignore[override]
@classmethod
def identify(cls, hash): ...
# Dynamically created
ldap_sha512_crypt: PrefixWrapper
ldap_sha256_crypt: PrefixWrapper
ldap_sha1_crypt: PrefixWrapper
ldap_bcrypt: PrefixWrapper
ldap_md5_crypt: PrefixWrapper
ldap_bsdi_crypt: PrefixWrapper
ldap_des_crypt: PrefixWrapper
@@ -1,23 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class _MD5_Common(uh.HasSalt, uh.GenericHandler):
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class md5_crypt(uh.HasManyBackends, _MD5_Common):
name: ClassVar[str]
ident: ClassVar[str]
backends: ClassVar[tuple[str, ...]]
class apr_md5_crypt(_MD5_Common):
name: ClassVar[str]
ident: ClassVar[str]
__all__ = ["md5_crypt", "apr_md5_crypt"]
-54
View File
@@ -1,54 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import deprecated
import passlib.utils.handlers as uh
from passlib.ifc import DisabledHash
class unix_fallback(DisabledHash, uh.StaticHandler):
name: ClassVar[str]
@classmethod
def identify(cls, hash: str | bytes) -> bool: ...
enable_wildcard: Any
def __init__(self, enable_wildcard: bool = False, **kwds) -> None: ...
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes, enable_wildcard: bool = False): ... # type: ignore[override]
class unix_disabled(DisabledHash, uh.MinimalHandler):
name: ClassVar[str]
default_marker: ClassVar[str]
setting_kwds: ClassVar[tuple[str, ...]]
context_kwds: ClassVar[tuple[str, ...]]
@classmethod
def using(cls, marker=None, **kwds): ... # type: ignore[override]
@classmethod
def identify(cls, hash: str | bytes) -> bool: ...
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
@classmethod
def hash(cls, secret: str | bytes, **kwds) -> str: ...
@classmethod
def genhash(cls, secret: str | bytes, config, marker=None): ... # type: ignore[override]
@classmethod
def disable(cls, hash: str | bytes | None = None) -> str: ...
@classmethod
def enable(cls, hash: str | bytes) -> str: ...
class plaintext(uh.MinimalHandler):
name: ClassVar[str]
default_encoding: ClassVar[str]
setting_kwds: ClassVar[tuple[str, ...]]
context_kwds: ClassVar[tuple[str, ...]]
@classmethod
def identify(cls, hash: str | bytes): ...
@classmethod
def hash(cls, secret: str | bytes, encoding=None): ... # type: ignore[override]
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes, encoding: str | None = None): ... # type: ignore[override]
@deprecated("Deprecated since Passlib 1.7, will be removed in 2.0")
@classmethod
def genconfig(cls): ... # type: ignore[override]
@deprecated("Deprecated since Passlib 1.7, will be removed in 2.0")
@classmethod
def genhash(cls, secret, config, encoding: str | None = None): ... # type: ignore[override]
__all__ = ["unix_disabled", "unix_fallback", "plaintext"]
-24
View File
@@ -1,24 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
name: ClassVar[str]
checksum_size: ClassVar[int]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
name: ClassVar[str]
checksum_size: ClassVar[int]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
__all__ = ["mssql2000", "mssql2005"]
-15
View File
@@ -1,15 +0,0 @@
from typing import ClassVar
import passlib.utils.handlers as uh
__all__ = ["mysql323"]
class mysql323(uh.StaticHandler):
name: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
class mysql41(uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
-21
View File
@@ -1,21 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
__all__: list[str] = []
class oracle10(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
class oracle11(uh.HasSalt, uh.GenericHandler):
name: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
-91
View File
@@ -1,91 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
from passlib.utils.handlers import PrefixWrapper
class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
checksum_chars: ClassVar[str]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
# dynamically created by create_pbkdf2_hash()
class pbkdf2_sha1(Pbkdf2DigestHandler):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
encoded_checksum_size: ClassVar[int]
# dynamically created by create_pbkdf2_hash()
class pbkdf2_sha256(Pbkdf2DigestHandler):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
encoded_checksum_size: ClassVar[int]
# dynamically created by create_pbkdf2_hash()
class pbkdf2_sha512(Pbkdf2DigestHandler):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
encoded_checksum_size: ClassVar[int]
ldap_pbkdf2_sha1: PrefixWrapper
ldap_pbkdf2_sha256: PrefixWrapper
ldap_pbkdf2_sha512: PrefixWrapper
class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
ident: ClassVar[str]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
__all__ = ["pbkdf2_sha1", "pbkdf2_sha256", "pbkdf2_sha512", "cta_pbkdf2_sha1", "dlitz_pbkdf2_sha1", "grub_pbkdf2_sha512"]
-22
View File
@@ -1,22 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_chars: ClassVar[str]
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
default_ident: ClassVar[str]
ident_values: ClassVar[tuple[str, ...]]
ident_aliases: ClassVar[dict[str, str]]
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
__all__ = ["phpass"]
@@ -1,10 +0,0 @@
from typing import ClassVar
import passlib.utils.handlers as uh
class postgres_md5(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
__all__ = ["postgres_md5"]
@@ -1,7 +0,0 @@
from typing import Any
roundup_plaintext: Any
ldap_hex_md5: Any
ldap_hex_sha1: Any
__all__ = ["roundup_plaintext", "ldap_hex_md5", "ldap_hex_sha1"]
-32
View File
@@ -1,32 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
ident: ClassVar[str]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
default_algs: ClassVar[list[str]]
algs: Incomplete | None
@classmethod
def extract_digest_info(cls, hash, alg): ...
@classmethod
def extract_digest_algs(cls, hash, format: str = "iana"): ...
@classmethod
def derive_digest(cls, password, salt, rounds, alg): ...
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def using(cls, default_algs=None, algs=None, **kwds): ... # type: ignore[override]
def __init__(self, algs=None, **kwds) -> None: ...
@classmethod
def verify(cls, secret, hash, full: bool = False): ... # type: ignore[override]
__all__ = ["scram"]
-35
View File
@@ -1,35 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.HasManyIdents, uh.GenericHandler): # type: ignore[misc]
backends: ClassVar[tuple[str, ...]]
name: ClassVar[str]
checksum_size: ClassVar[int]
default_ident: ClassVar[str]
ident_values: ClassVar[tuple[str, ...]]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
parallelism: int
block_size: int
@classmethod
def using(cls, block_size=None, **kwds): ... # type: ignore[override]
@classmethod
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def parse(cls, hash): ...
def to_string(self): ...
def __init__(self, block_size=None, **kwds) -> None: ...
@classmethod
def get_backend(cls): ...
@classmethod
def has_backend(cls, name: str = "any"): ...
@classmethod
def set_backend(cls, name: str = "any", dryrun: bool = False) -> None: ...
__all__ = ["scrypt"]
@@ -1,25 +0,0 @@
from typing import Any, ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
log: Any
class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
checksum_chars: ClassVar[str]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
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] = []
@@ -1,31 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
checksum_chars: ClassVar[str]
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
implicit_rounds: bool
def __init__(self, implicit_rounds: bool | None = None, **kwds) -> None: ...
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
backends: ClassVar[tuple[str, ...]]
class sha256_crypt(_SHA2_Common):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_rounds: ClassVar[int]
class sha512_crypt(_SHA2_Common):
name: ClassVar[str]
ident: ClassVar[str]
checksum_size: ClassVar[int]
default_rounds: ClassVar[int]
__all__ = ["sha512_crypt", "sha256_crypt"]
@@ -1,26 +0,0 @@
from typing import ClassVar
from typing_extensions import Self
import passlib.utils.handlers as uh
class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
default_salt_size: ClassVar[int]
max_salt_size: ClassVar[int | None]
salt_chars: ClassVar[str]
default_rounds: ClassVar[int]
min_rounds: ClassVar[int]
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
ident_values: ClassVar[tuple[str, ...]]
bare_salt: bool
def __init__(self, bare_salt: bool = False, **kwds) -> None: ...
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash: str | bytes) -> Self: ... # type: ignore[override]
def to_string(self, _withchk: bool = True) -> str: ...
__all__ = ["sun_md5_crypt"]
@@ -1,45 +0,0 @@
from typing import Any, ClassVar, Literal, overload
import passlib.utils.handlers as uh
class lmhash(uh.TruncateMixin, uh.HasEncodingContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
truncate_size: ClassVar[int]
@classmethod
def raw(cls, secret, encoding=None): ...
class nthash(uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
@classmethod
def raw(cls, secret): ...
@overload
@classmethod
def raw_nthash(cls, secret: str | bytes, hex: Literal[True]) -> str: ...
@overload
@classmethod
def raw_nthash(cls, secret: str | bytes, hex: Literal[False] = False) -> bytes: ...
@overload
@classmethod
def raw_nthash(cls, secret: str | bytes, hex: bool = False) -> str | bytes: ...
bsd_nthash: Any
class msdcc(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
@classmethod
def raw(cls, secret, user): ...
class msdcc2(uh.HasUserContext, uh.StaticHandler):
name: ClassVar[str]
checksum_chars: ClassVar[str]
checksum_size: ClassVar[int]
@classmethod
def raw(cls, secret, user): ...
__all__ = ["lmhash", "nthash", "bsd_nthash", "msdcc", "msdcc2"]
-75
View File
@@ -1,75 +0,0 @@
from passlib.handlers.argon2 import argon2 as argon2
from passlib.handlers.bcrypt import bcrypt as bcrypt, bcrypt_sha256 as bcrypt_sha256
from passlib.handlers.cisco import cisco_asa as cisco_asa, cisco_pix as cisco_pix, cisco_type7 as cisco_type7
from passlib.handlers.des_crypt import bigcrypt as bigcrypt, bsdi_crypt as bsdi_crypt, crypt16 as crypt16, des_crypt as des_crypt
from passlib.handlers.digests import (
hex_md4 as hex_md4,
hex_md5 as hex_md5,
hex_sha1 as hex_sha1,
hex_sha256 as hex_sha256,
hex_sha512 as hex_sha512,
htdigest as htdigest,
)
from passlib.handlers.django import (
django_bcrypt as django_bcrypt,
django_bcrypt_sha256 as django_bcrypt_sha256,
django_des_crypt as django_des_crypt,
django_disabled as django_disabled,
django_pbkdf2_sha1 as django_pbkdf2_sha1,
django_pbkdf2_sha256 as django_pbkdf2_sha256,
django_salted_md5 as django_salted_md5,
django_salted_sha1 as django_salted_sha1,
)
from passlib.handlers.fshp import fshp as fshp
from passlib.handlers.ldap_digests import (
ldap_bcrypt as ldap_bcrypt,
ldap_bsdi_crypt as ldap_bsdi_crypt,
ldap_des_crypt as ldap_des_crypt,
ldap_md5 as ldap_md5,
ldap_md5_crypt as ldap_md5_crypt,
ldap_plaintext as ldap_plaintext,
ldap_salted_md5 as ldap_salted_md5,
ldap_salted_sha1 as ldap_salted_sha1,
ldap_salted_sha256 as ldap_salted_sha256,
ldap_salted_sha512 as ldap_salted_sha512,
ldap_sha1 as ldap_sha1,
ldap_sha1_crypt as ldap_sha1_crypt,
ldap_sha256_crypt as ldap_sha256_crypt,
ldap_sha512_crypt as ldap_sha512_crypt,
)
from passlib.handlers.md5_crypt import apr_md5_crypt as apr_md5_crypt, md5_crypt as md5_crypt
from passlib.handlers.misc import plaintext as plaintext, unix_disabled as unix_disabled, unix_fallback as unix_fallback
from passlib.handlers.mssql import mssql2000 as mssql2000, mssql2005 as mssql2005
from passlib.handlers.mysql import mysql41 as mysql41, mysql323 as mysql323
from passlib.handlers.oracle import oracle10 as oracle10, oracle11 as oracle11
from passlib.handlers.pbkdf2 import (
atlassian_pbkdf2_sha1 as atlassian_pbkdf2_sha1,
cta_pbkdf2_sha1 as cta_pbkdf2_sha1,
dlitz_pbkdf2_sha1 as dlitz_pbkdf2_sha1,
grub_pbkdf2_sha512 as grub_pbkdf2_sha512,
ldap_pbkdf2_sha1 as ldap_pbkdf2_sha1,
ldap_pbkdf2_sha256 as ldap_pbkdf2_sha256,
ldap_pbkdf2_sha512 as ldap_pbkdf2_sha512,
pbkdf2_sha1 as pbkdf2_sha1,
pbkdf2_sha256 as pbkdf2_sha256,
pbkdf2_sha512 as pbkdf2_sha512,
)
from passlib.handlers.phpass import phpass as phpass
from passlib.handlers.postgres import postgres_md5 as postgres_md5
from passlib.handlers.roundup import (
ldap_hex_md5 as ldap_hex_md5,
ldap_hex_sha1 as ldap_hex_sha1,
roundup_plaintext as roundup_plaintext,
)
from passlib.handlers.scram import scram as scram
from passlib.handlers.scrypt import scrypt as scrypt
from passlib.handlers.sha1_crypt import sha1_crypt as sha1_crypt
from passlib.handlers.sha2_crypt import sha256_crypt as sha256_crypt, sha512_crypt as sha512_crypt
from passlib.handlers.sun_md5_crypt import sun_md5_crypt as sun_md5_crypt
from passlib.handlers.windows import (
bsd_nthash as bsd_nthash,
lmhash as lmhash,
msdcc as msdcc,
msdcc2 as msdcc2,
nthash as nthash,
)
-15
View File
@@ -1,15 +0,0 @@
import sys
from passlib.context import CryptContext
linux_context: CryptContext
linux2_context: CryptContext
freebsd_context: CryptContext
openbsd_context: CryptContext
netbsd_context: CryptContext
# Only exists if crypt is present
if sys.version_info < (3, 13) and sys.platform != "win32":
host_context: CryptContext
__all__ = ["linux_context", "linux2_context", "openbsd_context", "netbsd_context", "freebsd_context", "host_context"]
else:
__all__ = ["linux_context", "linux2_context", "openbsd_context", "netbsd_context", "freebsd_context"]
-39
View File
@@ -1,39 +0,0 @@
from abc import ABCMeta, abstractmethod
from typing import Any, ClassVar, Literal
from typing_extensions import Self
class PasswordHash(metaclass=ABCMeta):
is_disabled: ClassVar[bool]
truncate_size: ClassVar[int | None]
truncate_error: ClassVar[bool]
truncate_verify_reject: ClassVar[bool]
@classmethod
@abstractmethod
def hash(cls, secret: str | bytes, **setting_and_context_kwds) -> str: ...
@classmethod
def encrypt(cls, secret: str | bytes, **kwds) -> str: ...
@classmethod
@abstractmethod
def verify(cls, secret: str | bytes, hash: str | bytes, **context_kwds): ...
@classmethod
@abstractmethod
def using(cls, relaxed: bool = False, **kwds: Any) -> type[Self]: ...
@classmethod
def needs_update(cls, hash: str, secret: str | bytes | None = None) -> bool: ...
@classmethod
@abstractmethod
def identify(cls, hash: str | bytes) -> bool: ...
@classmethod
def genconfig(cls, **setting_kwds: Any) -> str: ...
@classmethod
def genhash(cls, secret: str | bytes, config: str, **context: Any) -> str: ...
deprecated: bool
class DisabledHash(PasswordHash, metaclass=ABCMeta):
is_disabled: ClassVar[Literal[True]]
@classmethod
def disable(cls, hash: str | None = None) -> str: ...
@classmethod
def enable(cls, hash: str) -> str: ...
__all__ = ["PasswordHash"]
-142
View File
@@ -1,142 +0,0 @@
import random
from abc import abstractmethod
from collections.abc import Callable, Iterator, MutableMapping, Sequence
from typing import Any, Final, Literal, overload
from typing_extensions import Self, TypeAlias
class SequenceGenerator:
length: int | None
requested_entropy: str
rng: random.Random
@property
@abstractmethod
def symbol_count(self) -> int: ...
def __init__(self, entropy: int | None = None, length: int | None = None, rng: random.Random | None = None) -> None: ...
@property
def entropy_per_symbol(self) -> float: ...
@property
def entropy(self) -> float: ...
def __next__(self) -> str: ...
@overload
def __call__(self, returns: None = None) -> str: ...
@overload
def __call__(self, returns: int) -> list[str]: ...
@overload
def __call__(self, returns: Callable[[Any], Iterator[Any]]) -> Iterator[str]: ... # "returns" must be the "iter" builtin
def __iter__(self) -> Self: ...
_Charset: TypeAlias = Literal["ascii_72", "ascii_62", "ascii_50", "hex"]
default_charsets: Final[dict[_Charset, str]]
class WordGenerator(SequenceGenerator):
charset: _Charset
chars: str | bytes | None
def __init__(
self,
chars: str | bytes | None = None,
charset: _Charset | None = None,
*,
entropy: int | None = None,
length: int | None = None,
rng: random.Random | None = None,
) -> None: ...
@property
def symbol_count(self) -> int: ...
@overload
def genword(
entropy: int | None = None,
length: int | None = None,
returns: None = None,
*,
chars: str | None = None,
charset: _Charset | None = None,
rng: random.Random | None = None,
) -> str: ...
@overload
def genword(
returns: int,
entropy: int | None = None,
length: int | None = None,
*,
chars: str | None = None,
charset: _Charset | None = None,
rng: random.Random | None = None,
) -> list[str]: ...
@overload
def genword(
returns: Callable[[Any], Iterator[Any]],
entropy: int | None = None,
length: int | None = None,
*,
chars: str | None = None,
charset: _Charset | None = None,
rng: random.Random | None = None,
) -> Iterator[str]: ...
class WordsetDict(MutableMapping[Any, Any]):
paths: dict[str, str] | None
def __init__(self, *args, **kwds) -> None: ...
def __getitem__(self, key: str) -> tuple[str | bytes, ...]: ...
def set_path(self, key: str, path: str) -> None: ...
def __setitem__(self, key: str, value: tuple[str | bytes, ...]) -> None: ...
def __delitem__(self, key: str) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __len__(self) -> int: ...
def __contains__(self, key: object) -> bool: ...
default_wordsets: WordsetDict
_Wordset: TypeAlias = Literal["eff_long", "eff_short", "eff_prefixed", "bip39"]
class PhraseGenerator(SequenceGenerator):
wordset: _Wordset
words: Sequence[str | bytes] | None
sep: str | None
def __init__(
self,
wordset: _Wordset | None = None,
words: Sequence[str | bytes] | None = None,
sep: str | bytes | None = None,
*,
entropy: int | None = None,
length: int | None = None,
rng: random.Random | None = None,
) -> None: ...
@property
def symbol_count(self) -> int: ...
@overload
def genphrase(
entropy: int | None = None,
length: int | None = None,
returns: None = None,
*,
wordset: _Wordset | None = None,
words: Sequence[str | bytes] | None = None,
sep: str | bytes | None = None,
rng: random.Random | None = None,
) -> str: ...
@overload
def genphrase(
returns: int,
entropy: int | None = None,
length: int | None = None,
*,
wordset: _Wordset | None = None,
words: Sequence[str | bytes] | None = None,
sep: str | bytes | None = None,
rng: random.Random | None = None,
) -> list[str]: ...
@overload
def genphrase(
returns: Callable[[Any], Iterator[Any]],
entropy: int | None = None,
length: int | None = None,
*,
wordset: _Wordset | None = None,
words: Sequence[str | bytes] | None = None,
sep: str | bytes | None = None,
rng: random.Random | None = None,
) -> Iterator[str]: ...
__all__ = ["genword", "default_charsets", "genphrase", "default_wordsets"]
-17
View File
@@ -1,17 +0,0 @@
from typing import Any
class _PasslibRegistryProxy:
__name__: str
__package__: str | None
def __getattr__(self, attr: str) -> Any: ... # returns handler that is a value from object.__dict__
def __setattr__(self, attr: str, value) -> None: ...
def __dir__(self) -> list[str]: ...
def register_crypt_handler_path(name: str, path: str) -> None: ...
def register_crypt_handler(
handler: Any, force: bool = False, _attr: str | None = None
) -> None: ... # expected handler is object with attr handler.name
def get_crypt_handler(name: str, default: Any = ...) -> Any: ... # returns handler or default
def list_crypt_handlers(loaded_only: bool = False) -> list[str]: ...
__all__ = ["register_crypt_handler_path", "register_crypt_handler", "get_crypt_handler", "list_crypt_handlers"]
-159
View File
@@ -1,159 +0,0 @@
from collections.abc import Callable
from datetime import datetime
from typing import Any, Literal
from typing_extensions import Self
from passlib.exc import (
InvalidTokenError as InvalidTokenError,
MalformedTokenError as MalformedTokenError,
TokenError as TokenError,
UsedTokenError as UsedTokenError,
)
from passlib.utils import SequenceMixin
class AppWallet:
salt_size: int
encrypt_cost: int
default_tag: str | None
def __init__(
self,
secrets: dict[int, str] | dict[int, bytes] | dict[str, str] | dict[str, bytes] | str | None = None,
default_tag: str | None = None,
encrypt_cost: int | None = None,
secrets_path: str | None = None,
) -> None: ...
@property
def has_secrets(self) -> bool: ...
def get_secret(self, tag: str) -> bytes: ...
def encrypt_key(self, key: bytes) -> dict[str, Any]: ...
def decrypt_key(self, enckey: dict[str, Any]) -> tuple[bytes, bool]: ...
class TOTP:
min_json_version: int
json_version: int
wallet: AppWallet | None
now: Callable[[], float]
digits: int
alg: str
label: str | None
issuer: str | None
period: int
changed: bool
@classmethod
def using(
cls,
digits: int | None = None,
alg: Literal["sha1", "sha256", "sha512"] | None = None,
period: int | None = None,
issuer: str | None = None,
wallet: AppWallet | None = None,
now: Callable[[], float] | None = None,
*,
secrets: dict[int, str] | dict[int, bytes] | dict[str, str] | dict[str, bytes] | str | None = None,
**kwds: Any,
) -> type[TOTP]: ...
@classmethod
def new(cls, **kwds: Any) -> Self: ...
def __init__(
self,
key: str | bytes | None = None,
format: str = "base32",
new: bool = False,
digits: int | None = None,
alg: Literal["sha1", "sha256", "sha512"] | None = None,
size: int | None = None,
period: int | None = None,
label: str | None = None,
issuer: str | None = None,
changed: bool = False,
**kwds: Any,
) -> None: ...
@property
def key(self) -> bytes: ...
@key.setter
def key(self, value: bytes) -> None: ...
@property
def encrypted_key(self) -> dict[str, Any]: ...
@encrypted_key.setter
def encrypted_key(self, value: dict[str, Any]) -> None: ...
@property
def hex_key(self) -> str: ...
@property
def base32_key(self) -> str: ...
def pretty_key(self, format: str = "base32", sep: str | Literal[False] = "-") -> str: ...
@classmethod
def normalize_time(cls, time: float | datetime | None) -> int: ...
def normalize_token(self_or_cls, token: bytes | str | int) -> str: ...
def generate(self, time: float | datetime | None = None) -> TotpToken: ...
@classmethod
def verify(
cls,
token: int | str,
source: TOTP | dict[str, Any] | str | bytes,
*,
time: float | datetime | None = ...,
window: int = ...,
skew: int = ...,
last_counter: int | None = ...,
) -> TotpMatch: ...
def match(
self,
token: int | str,
time: float | datetime | None = None,
window: int = 30,
skew: int = 0,
last_counter: int | None = None,
) -> TotpMatch: ...
@classmethod
def from_source(cls, source: TOTP | dict[str, Any] | str | bytes) -> Self: ...
@classmethod
def from_uri(cls, uri: str) -> Self: ...
def to_uri(self, label: str | None = None, issuer: str | None = None) -> str: ...
@classmethod
def from_json(cls, source: str | bytes) -> Self: ...
def to_json(self, encrypt: bool | None = None) -> str: ...
@classmethod
def from_dict(cls, source: dict[str, Any]) -> Self: ...
def to_dict(self, encrypt: bool | None = None) -> dict[str, Any]: ...
class TotpToken(SequenceMixin):
totp: TOTP | None
token: str | None
counter: int | None
def __init__(self, totp: TOTP, token: str, counter: int) -> None: ...
@property
def start_time(self) -> int: ...
@property
def expire_time(self) -> int: ...
@property
def remaining(self) -> float: ...
@property
def valid(self) -> bool: ...
class TotpMatch(SequenceMixin):
totp: TOTP | None
counter: int
time: int
window: int
def __init__(self, totp: TOTP, counter: int, time: int, window: int = 30) -> None: ...
@property
def expected_counter(self) -> int: ...
@property
def skipped(self) -> int: ...
@property
def expire_time(self) -> int: ...
@property
def cache_seconds(self) -> int: ...
@property
def cache_time(self) -> int: ...
__all__ = [
"AppWallet",
"TOTP",
"TokenError",
"MalformedTokenError",
"InvalidTokenError",
"UsedTokenError",
"TotpToken",
"TotpMatch",
]
-87
View File
@@ -1,87 +0,0 @@
import random
import timeit
from _typeshed import ReadableBuffer
from collections.abc import Iterable
from hmac import compare_digest
from typing import Final, Literal, SupportsBytes, SupportsIndex, overload
from passlib.utils.compat import JYTHON as JYTHON
__all__ = [
"JYTHON",
"sys_bits",
"unix_crypt_schemes",
"rounds_cost_values",
"consteq",
"saslprep",
"xor_bytes",
"render_bytes",
"is_same_codec",
"is_ascii_safe",
"to_bytes",
"to_unicode",
"to_native_str",
"has_crypt",
"test_crypt",
"safe_crypt",
"tick",
"rng",
"getrandbytes",
"getrandstr",
"generate_password",
"is_crypt_handler",
"is_crypt_context",
"has_rounds_info",
"has_salt_info",
]
sys_bits: Final[int]
unix_crypt_schemes: list[str]
rounds_cost_values: Final[list[str]]
class SequenceMixin:
def __getitem__(self, idx): ...
def __iter__(self): ...
def __len__(self) -> int: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
consteq = compare_digest
def str_consteq(left: str | bytes, right: str | bytes) -> bool: ...
def splitcomma(source: str, sep: str = ",") -> list[str]: ...
def saslprep(source: str, param: str = "value") -> str: ...
def render_bytes(source: str | bytes, *args: str | bytes) -> bytes: ...
def bytes_to_int(value: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer) -> int: ...
def int_to_bytes(value: int, count: SupportsIndex) -> bytes: ...
def xor_bytes(
left: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
right: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
) -> bytes: ...
def repeat_string(source: str | bytes, size: int) -> str | bytes: ...
def is_ascii_codec(codec: str) -> bool: ...
def is_same_codec(left: str, right: str) -> bool: ...
def is_ascii_safe(source: str | bytes) -> bool: ...
def to_bytes(source: str | bytes, encoding: str = "utf-8", param: str = "value", source_encoding: str | None = None) -> bytes: ...
def to_unicode(source: str | bytes, encoding: str = "utf-8", param: str = "value") -> str: ...
def to_native_str(source: str | bytes, encoding: str = "utf-8", param: str = "value") -> str: ...
has_crypt: bool
def safe_crypt(secret: str | bytes, hash: str | bytes) -> str | None: ...
def test_crypt(secret: str | bytes, hash: str) -> bool: ...
timer = timeit.default_timer
tick = timer
rng: random.Random
@overload
def getrandbytes(rng: random.Random, count: None) -> Literal[b""]: ...
@overload
def getrandbytes(rng: random.Random, count) -> bytes: ...
def getrandstr(rng: random.Random, charset: str, count: int) -> str: ...
def generate_password(size: int = 10, charset: str = ...) -> str: ...
def is_crypt_handler(obj) -> bool: ...
def is_crypt_context(obj) -> bool: ...
def has_rounds_info(handler) -> bool: ...
def has_salt_info(handler) -> bool: ...
-83
View File
@@ -1,83 +0,0 @@
from _typeshed import ReadableBuffer
from logging import Logger
from typing import Any, Final
log: Logger
BASE64_CHARS: Final[str]
AB64_CHARS: Final[str]
HASH64_CHARS: Final[str]
BCRYPT_CHARS: Final[str]
PADDED_BASE64_CHARS: Final[str]
HEX_CHARS: Final[str]
UPPER_HEX_CHARS: Final[str]
LOWER_HEX_CHARS: Final[str]
ALL_BYTE_VALUES: Final[bytes]
def compile_byte_translation(mapping: dict[str | bytes | int, str | bytes], source: bytes | None = None) -> bytes: ...
def b64s_encode(data: ReadableBuffer) -> bytes: ...
def b64s_decode(data: str | ReadableBuffer) -> bytes: ...
def ab64_encode(data: ReadableBuffer) -> bytes: ...
def ab64_decode(data: str | ReadableBuffer) -> bytes: ...
def b32encode(source: ReadableBuffer) -> str: ...
def b32decode(source: str | bytes) -> bytes: ...
class Base64Engine:
bytemap: Any
big: Any
def __init__(self, charmap, big: bool = False) -> None: ...
@property
def charmap(self): ...
def encode_bytes(self, source): ...
def decode_bytes(self, source): ...
def check_repair_unused(self, source): ...
def repair_unused(self, source): ...
def encode_transposed_bytes(self, source, offsets): ...
def decode_transposed_bytes(self, source, offsets): ...
def decode_int6(self, source): ...
def decode_int12(self, source): ...
def decode_int24(self, source): ...
def decode_int30(self, source): ...
def decode_int64(self, source): ...
def encode_int6(self, value): ...
def encode_int12(self, value): ...
def encode_int24(self, value): ...
def encode_int30(self, value): ...
def encode_int64(self, value): ...
class LazyBase64Engine(Base64Engine):
def __init__(self, *args, **kwds) -> None: ...
def __getattribute__(self, attr: str): ...
h64: Base64Engine
h64big: Base64Engine
bcrypt64: Base64Engine
__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",
]
@@ -1,8 +0,0 @@
from typing import Literal
PY2: Literal[False]
PY3: Literal[True]
PY26: Literal[False]
JYTHON: bool
PYPY: bool
PYSTON: bool
@@ -1,27 +0,0 @@
from _typeshed import Incomplete
from collections.abc import Generator
from typing import Any
class OrderedDict(dict[Any, Any]):
def __init__(self, *args, **kwds) -> None: ...
def __setitem__(self, key, value, dict_setitem=...) -> None: ...
def __delitem__(self, key, dict_delitem=...) -> None: ...
def __iter__(self): ...
def __reversed__(self) -> Generator[Any, None, None]: ...
def clear(self) -> None: ...
def popitem(self, last: bool = ...): ...
def keys(self): ...
def values(self): ...
def items(self): ...
def iterkeys(self): ...
def itervalues(self) -> Generator[Any, None, None]: ...
def iteritems(self) -> Generator[Any, None, None]: ...
def update(*args, **kwds) -> None: ... # type: ignore[override]
def pop(self, key, default=...): ...
def setdefault(self, key, default: Incomplete | None = ...): ...
def __reduce__(self): ...
def copy(self): ...
@classmethod
def fromkeys(cls, iterable, value: Incomplete | None = ...): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
-38
View File
@@ -1,38 +0,0 @@
from typing import Any
class classproperty:
im_func: Any
def __init__(self, func) -> None: ...
def __get__(self, obj, cls): ...
@property
def __func__(self): ...
class hybrid_method:
func: Any
def __init__(self, func) -> None: ...
def __get__(self, obj, cls): ...
def memoize_single_value(func): ...
class memoized_property:
__func__: Any
__name__: Any
__doc__: Any
def __init__(self, func) -> None: ...
def __get__(self, obj, cls): ...
def clear_cache(self, obj) -> None: ...
def peek_cache(self, obj, default=None): ...
def deprecated_function(
msg=None, deprecated=None, removed=None, updoc: bool = True, replacement=None, _is_method: bool = False, func_module=None
): ...
def deprecated_method(msg=None, deprecated=None, removed=None, updoc: bool = True, replacement=None): ...
__all__ = [
"classproperty",
"hybrid_method",
"memoize_single_value",
"memoized_property",
"deprecated_function",
"deprecated_method",
]
-8
View File
@@ -1,8 +0,0 @@
from passlib.crypto.des import (
des_encrypt_block as des_encrypt_block,
des_encrypt_int_block as des_encrypt_int_block,
expand_des_key as expand_des_key,
)
from passlib.utils.decor import deprecated_function as deprecated_function
def mdes_encrypt_int_block(key, input, salt: int = 0, rounds: int = 1): ...
-192
View File
@@ -1,192 +0,0 @@
import abc
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing_extensions import Self
from passlib.ifc import PasswordHash
from passlib.utils.binary import BASE64_CHARS, HASH64_CHARS, LOWER_HEX_CHARS, PADDED_BASE64_CHARS, UPPER_HEX_CHARS
H64_CHARS = HASH64_CHARS
B64_CHARS = BASE64_CHARS
PADDED_B64_CHARS = PADDED_BASE64_CHARS
UC_HEX_CHARS = UPPER_HEX_CHARS
LC_HEX_CHARS = LOWER_HEX_CHARS
def parse_mc2(hash, prefix, sep="$", handler=None): ...
def parse_mc3(hash, prefix, sep="$", rounds_base: int = 10, default_rounds=None, handler=None): ...
def render_mc2(ident, salt, checksum, sep="$"): ...
def render_mc3(ident, rounds, salt, checksum, sep="$", rounds_base: int = 10): ...
class MinimalHandler(PasswordHash, metaclass=abc.ABCMeta):
@classmethod
def using(cls, relaxed: bool = False) -> type[Self]: ... # type: ignore[override]
class TruncateMixin(MinimalHandler, metaclass=abc.ABCMeta):
truncate_error: ClassVar[bool]
truncate_verify_reject: ClassVar[bool]
@classmethod
def using(cls, truncate_error: object = None, **kwds: Any) -> type[Self]: ... # type: ignore[override]
class GenericHandler(MinimalHandler):
setting_kwds: ClassVar[tuple[str, ...]]
context_kwds: ClassVar[tuple[str, ...]]
ident: ClassVar[str | None]
checksum_size: ClassVar[int | None]
checksum_chars: ClassVar[str | None]
checksum: str | None
use_defaults: bool
def __init__(self, checksum: str | None = None, use_defaults: bool = False) -> None: ...
@classmethod
def identify(cls, hash: str | bytes) -> bool: ...
@classmethod
def from_string(cls, hash: str | bytes, **context: Any) -> Self: ... # context parameters are passed to constructor
def to_string(self) -> str: ...
@classmethod
def hash(cls, secret: str | bytes, **kwds: Any) -> str: ...
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes, **context: Any) -> bool: ...
@classmethod
def genconfig(cls, **kwds: Any) -> str: ...
@classmethod
def genhash(cls, secret: str | bytes, config: str, **context: Any) -> str: ...
@classmethod
def needs_update(cls, hash: str | bytes, secret: str | bytes | None = None, **kwds: Any) -> bool: ...
@classmethod
def parsehash(cls, hash: str | bytes, checksum: bool = True, sanitize: bool = False) -> dict[str, Any]: ...
@classmethod
def bitsize(cls, **kwds: Any) -> dict[str, Any]: ...
class StaticHandler(GenericHandler):
setting_kwds: ClassVar[tuple[str, ...]]
class HasEncodingContext(GenericHandler):
default_encoding: ClassVar[str]
encoding: str
def __init__(self, encoding: str | None = None, **kwds) -> None: ...
class HasUserContext(GenericHandler):
user: Incomplete | None
def __init__(self, user=None, **kwds) -> None: ...
@classmethod
def hash(cls, secret, user=None, **context): ...
@classmethod
def verify(cls, secret, hash, user=None, **context): ...
@classmethod
def genhash(cls, secret, config, user=None, **context): ...
class HasRawChecksum(GenericHandler): ...
class HasManyIdents(GenericHandler):
default_ident: ClassVar[str | None]
ident_values: ClassVar[tuple[str, ...] | None]
ident_aliases: ClassVar[dict[str, str] | None]
ident: str # type: ignore[misc]
@classmethod
def using(cls, default_ident=None, ident=None, **kwds): ... # type: ignore[override]
def __init__(self, ident=None, **kwds) -> None: ...
class HasSalt(GenericHandler):
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int | None]
salt_chars: ClassVar[str | None]
default_salt_size: ClassVar[int | None]
default_salt_chars: ClassVar[str | None]
salt: str | bytes | None
@classmethod
def using( # type: ignore[override]
cls, default_salt_size: int | None = None, salt_size: int | None = None, salt: str | bytes | None = None, **kwds
): ...
def __init__(self, salt: str | bytes | None = None, **kwds) -> None: ...
@classmethod
def bitsize(cls, salt_size: int | None = None, **kwds): ...
class HasRawSalt(HasSalt):
salt_chars: ClassVar[bytes] # type: ignore[assignment]
class HasRounds(GenericHandler):
min_rounds: ClassVar[int]
max_rounds: ClassVar[int | None]
rounds_cost: ClassVar[str]
using_rounds_kwds: ClassVar[tuple[str, ...]]
min_desired_rounds: ClassVar[int | None]
max_desired_rounds: ClassVar[int | None]
default_rounds: ClassVar[int | None]
vary_rounds: ClassVar[Incomplete | None]
rounds: int
@classmethod
def using( # type: ignore[override]
cls,
min_desired_rounds=None,
max_desired_rounds=None,
default_rounds=None,
vary_rounds=None,
min_rounds=None,
max_rounds=None,
rounds=None,
**kwds,
): ...
def __init__(self, rounds=None, **kwds) -> None: ...
@classmethod
def bitsize(cls, rounds=None, vary_rounds: float = 0.1, **kwds): ...
class ParallelismMixin(GenericHandler):
parallelism: int
@classmethod
def using(cls, parallelism=None, **kwds): ... # type: ignore[override]
def __init__(self, parallelism=None, **kwds) -> None: ...
class BackendMixin(PasswordHash, metaclass=abc.ABCMeta):
backends: ClassVar[tuple[str, ...] | None]
@classmethod
def get_backend(cls): ...
@classmethod
def has_backend(cls, name: str = "any") -> bool: ...
@classmethod
def set_backend(cls, name: str = "any", dryrun: bool = False): ...
class SubclassBackendMixin(BackendMixin, metaclass=abc.ABCMeta): ...
class HasManyBackends(BackendMixin, GenericHandler): ...
class PrefixWrapper:
name: Any
prefix: Any
orig_prefix: Any
__doc__: Any
def __init__(self, name, wrapped, prefix="", orig_prefix="", lazy: bool = False, doc=None, ident=None) -> None: ...
@property
def wrapped(self): ...
@property
def ident(self): ...
@property
def ident_values(self): ...
def __dir__(self): ...
def __getattr__(self, attr: str): ...
def __setattr__(self, attr: str, value) -> None: ...
def using(self, **kwds): ...
def needs_update(self, hash, **kwds): ...
def identify(self, hash): ...
def genconfig(self, **kwds): ...
def genhash(self, secret, config, **kwds): ...
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",
]
-5
View File
@@ -1,5 +0,0 @@
from typing import Any
md4: Any
__all__ = ["md4"]
-15
View File
@@ -1,15 +0,0 @@
from passlib.crypto.digest import norm_hash_name as norm_hash_name
def get_prf(name): ...
def pbkdf1(secret, salt, rounds, keylen=None, hash: str = "sha1"): ...
def pbkdf2(secret, salt, rounds, keylen=None, prf: str = "hmac-sha1"): ...
__all__ = [
# hash utils
"norm_hash_name",
# prf utils
"get_prf",
# kdfs
"pbkdf1",
"pbkdf2",
]
-16
View File
@@ -1,16 +0,0 @@
from binascii import hexlify as hexlify
from typing import Final, Literal, overload
from passlib.handlers.windows import nthash as nthash
LM_MAGIC: Final[bytes]
raw_nthash = nthash.raw_nthash
@overload
def raw_lmhash(secret: str | bytes, encoding: str = "ascii", hex: Literal[False] = False) -> bytes: ...
@overload
def raw_lmhash(secret: str | bytes, encoding: str, hex: Literal[True]) -> str: ...
@overload
def raw_lmhash(secret: str | bytes, *, hex: Literal[True]) -> str: ...
__all__ = ["nthash", "raw_lmhash", "raw_nthash"]