mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-01 09:03:23 +08:00
passlib: Annotate various handler methods and fields (#7521)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -29,3 +29,8 @@ 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
|
||||
|
||||
@@ -12,27 +12,26 @@ class _DummyCffiHasher:
|
||||
class _Argon2Common( # type: ignore[misc]
|
||||
uh.SubclassBackendMixin, uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler
|
||||
):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: Any
|
||||
name: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
min_salt_size: int
|
||||
max_salt_size: Any
|
||||
default_rounds: Any
|
||||
min_rounds: int
|
||||
max_rounds: Any
|
||||
rounds_cost: str
|
||||
max_parallelism: Any
|
||||
max_version: Any
|
||||
min_desired_version: Any
|
||||
min_memory_cost: int
|
||||
max_threads: int
|
||||
pure_use_threads: bool
|
||||
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: ignore
|
||||
type: Any
|
||||
parallelism: Any
|
||||
version: Any
|
||||
memory_cost: Any
|
||||
type: str
|
||||
parallelism: int
|
||||
version: int
|
||||
memory_cost: int
|
||||
@property
|
||||
def type_d(self): ...
|
||||
data: Any
|
||||
@@ -53,7 +52,6 @@ class _Argon2Common( # type: ignore[misc]
|
||||
def identify(cls, hash): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
def __init__(
|
||||
self,
|
||||
type: Any | None = ...,
|
||||
@@ -83,4 +81,4 @@ class _CffiBackend(_Argon2Common):
|
||||
class _PureBackend(_Argon2Common): ...
|
||||
|
||||
class argon2(_NoBackend, _Argon2Common): # type: ignore[misc]
|
||||
backends: Any
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
default_ident: Any
|
||||
ident_values: Any
|
||||
ident_aliases: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
final_salt_chars: str
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
truncate_size: int
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
@classmethod
|
||||
def needs_update(cls, hash, **kwds): ...
|
||||
@classmethod
|
||||
@@ -35,18 +33,17 @@ class _OsCryptBackend(_BcryptCommon): ...
|
||||
class _BuiltinBackend(_BcryptCommon): ...
|
||||
|
||||
class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc]
|
||||
backends: Any
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
class _wrapped_bcrypt(bcrypt):
|
||||
setting_kwds: Any
|
||||
truncate_size: Any
|
||||
truncate_size: ClassVar[None]
|
||||
|
||||
class bcrypt_sha256(_wrapped_bcrypt):
|
||||
name: str
|
||||
ident_values: Any
|
||||
ident_aliases: Any
|
||||
default_ident: Any
|
||||
version: int
|
||||
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: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
prefix: Any
|
||||
@@ -54,5 +51,4 @@ class bcrypt_sha256(_wrapped_bcrypt):
|
||||
def identify(cls, hash): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
def __init__(self, version: Any | None = ..., **kwds) -> None: ...
|
||||
|
||||
@@ -1,31 +1,27 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class cisco_pix(uh.HasUserContext, uh.StaticHandler):
|
||||
name: str
|
||||
truncate_size: int
|
||||
truncate_error: bool
|
||||
truncate_verify_reject: bool
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
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):
|
||||
name: str
|
||||
truncate_size: int
|
||||
class cisco_asa(cisco_pix): ...
|
||||
|
||||
class cisco_type7(uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
min_salt_value: int
|
||||
max_salt_value: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
min_salt_value: ClassVar[int]
|
||||
max_salt_value: ClassVar[int]
|
||||
@classmethod
|
||||
def using(cls, salt: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
def using(cls, salt: int | None = ..., **kwds): ... # type: ignore[override]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
salt: Any
|
||||
def __init__(self, salt: Any | None = ..., **kwds) -> None: ...
|
||||
def to_string(self): ...
|
||||
salt: int
|
||||
def __init__(self, salt: int | None = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def decode(cls, hash, encoding: str = ...): ...
|
||||
|
||||
@@ -1,60 +1,52 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
truncate_size: int
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
backends: Any
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
@classmethod
|
||||
def using(cls, **kwds): ...
|
||||
backends: Any
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
class bigcrypt(uh.HasSalt, uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
truncate_size: int
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class HexDigestHash(uh.StaticHandler):
|
||||
checksum_size: Any
|
||||
checksum_chars: Any
|
||||
supported: bool
|
||||
checksum_chars: ClassVar[str]
|
||||
supported: ClassVar[bool]
|
||||
|
||||
def create_hex_hash(digest, module=..., django_name: Any | None = ..., required: bool = ...): ...
|
||||
|
||||
@@ -16,10 +15,8 @@ hex_sha256: Any
|
||||
hex_sha512: Any
|
||||
|
||||
class htdigest(uh.MinimalHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
context_kwds: Any
|
||||
default_encoding: str
|
||||
name: ClassVar[str]
|
||||
default_encoding: ClassVar[str]
|
||||
@classmethod
|
||||
def hash(cls, secret, user, realm, encoding: Any | None = ...): ... # type: ignore[override]
|
||||
@classmethod
|
||||
|
||||
@@ -5,85 +5,77 @@ from passlib.handlers.bcrypt import _wrapped_bcrypt
|
||||
from passlib.ifc import DisabledHash
|
||||
|
||||
class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler):
|
||||
setting_kwds: Any
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: Any
|
||||
salt_chars: Any
|
||||
checksum_chars: Any
|
||||
salt_chars: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): # type: ignore[misc]
|
||||
setting_kwds: Any
|
||||
min_rounds: int
|
||||
min_rounds: ClassVar[int]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class django_salted_sha1(DjangoSaltedHash):
|
||||
name: str
|
||||
django_name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
django_name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
class django_salted_md5(DjangoSaltedHash):
|
||||
name: str
|
||||
django_name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
django_name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
django_bcrypt: Any
|
||||
|
||||
class django_bcrypt_sha256(_wrapped_bcrypt):
|
||||
name: str
|
||||
django_name: str
|
||||
django_prefix: Any
|
||||
name: ClassVar[str]
|
||||
django_name: ClassVar[str]
|
||||
django_prefix: ClassVar[str]
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class django_pbkdf2_sha256(DjangoVariableHash):
|
||||
name: str
|
||||
django_name: str
|
||||
ident: Any
|
||||
min_salt_size: int
|
||||
max_rounds: int
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
default_rounds: Any
|
||||
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: str
|
||||
django_name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
default_rounds: Any
|
||||
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: str
|
||||
django_name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
checksum_chars: Any
|
||||
salt_chars: Any
|
||||
checksum_size: int
|
||||
min_salt_size: int
|
||||
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: int
|
||||
truncate_size: ClassVar[int]
|
||||
use_duplicate_salt: bool
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class django_disabled(DisabledHash, uh.StaticHandler):
|
||||
name: str
|
||||
suffix_length: int
|
||||
name: ClassVar[str]
|
||||
suffix_length: ClassVar[int]
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes) -> bool: ...
|
||||
@classmethod
|
||||
def verify(cls, secret, hash): ...
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
|
||||
|
||||
@@ -3,26 +3,24 @@ from typing import Any, ClassVar
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: Any
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
default_variant: 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: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
variant: Any
|
||||
def using(cls, variant: int | str | bytes | None = ..., **kwds): ... # type: ignore[override]
|
||||
variant: int | None
|
||||
use_defaults: Any
|
||||
def __init__(self, variant: Any | None = ..., **kwds) -> None: ...
|
||||
def __init__(self, variant: int | str | bytes | None = ..., **kwds) -> None: ...
|
||||
@property
|
||||
def checksum_alg(self): ...
|
||||
@property
|
||||
def checksum_size(self): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, ClassVar
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
from passlib.handlers.misc import plaintext
|
||||
@@ -22,52 +22,50 @@ __all__ = [
|
||||
]
|
||||
|
||||
class _Base64DigestHelper(uh.StaticHandler):
|
||||
ident: Any
|
||||
checksum_chars: Any
|
||||
ident: ClassVar[str | None]
|
||||
checksum_chars: ClassVar[str]
|
||||
|
||||
class _SaltedBase64DigestHelper(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
ident: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class ldap_md5(_Base64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
|
||||
class ldap_sha1(_Base64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
|
||||
class ldap_salted_md5(_SaltedBase64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
class ldap_salted_sha1(_SaltedBase64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
class ldap_salted_sha256(_SaltedBase64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
|
||||
class ldap_salted_sha512(_SaltedBase64DigestHelper):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
|
||||
class ldap_plaintext(plaintext):
|
||||
name: str
|
||||
name: ClassVar[str]
|
||||
@classmethod
|
||||
def genconfig(cls): ...
|
||||
@classmethod
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class _MD5_Common(uh.HasSalt, uh.GenericHandler):
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
checksum_size: ClassVar[int]
|
||||
checksum_chars: ClassVar[str]
|
||||
max_salt_size: ClassVar[int]
|
||||
salt_chars: ClassVar[str]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class md5_crypt(uh.HasManyBackends, _MD5_Common):
|
||||
name: str
|
||||
ident: Any
|
||||
backends: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
class apr_md5_crypt(_MD5_Common):
|
||||
name: str
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
|
||||
@@ -1,50 +1,45 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
from passlib.ifc import DisabledHash
|
||||
|
||||
class unix_fallback(DisabledHash, uh.StaticHandler):
|
||||
name: str
|
||||
context_kwds: Any
|
||||
name: ClassVar[str]
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes) -> bool: ...
|
||||
enable_wildcard: Any
|
||||
def __init__(self, enable_wildcard: bool = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def verify(cls, secret, hash, enable_wildcard: bool = ...): ... # type: ignore[override]
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes, enable_wildcard: bool = ...): ... # type: ignore[override]
|
||||
|
||||
class unix_disabled(DisabledHash, uh.MinimalHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
context_kwds: Any
|
||||
default_marker: Any
|
||||
name: ClassVar[str]
|
||||
default_marker: ClassVar[str]
|
||||
@classmethod
|
||||
def using(cls, marker: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes) -> bool: ...
|
||||
@classmethod
|
||||
def verify(cls, secret, hash): ...
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
|
||||
@classmethod
|
||||
def hash(cls, secret, **kwds): ...
|
||||
def hash(cls, secret: str | bytes, **kwds) -> str: ...
|
||||
@classmethod
|
||||
def genhash(cls, secret, config, marker: Any | None = ...): ... # type: ignore[override]
|
||||
def genhash(cls, secret: str | bytes, config, marker: Any | None = ...): ... # type: ignore[override]
|
||||
@classmethod
|
||||
def disable(cls, hash: Any | None = ...): ...
|
||||
def disable(cls, hash: str | bytes | None = ...) -> str: ...
|
||||
@classmethod
|
||||
def enable(cls, hash): ...
|
||||
def enable(cls, hash: str | bytes) -> str: ...
|
||||
|
||||
class plaintext(uh.MinimalHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
context_kwds: Any
|
||||
default_encoding: str
|
||||
name: ClassVar[str]
|
||||
default_encoding: ClassVar[str]
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes): ...
|
||||
@classmethod
|
||||
def hash(cls, secret, encoding: Any | None = ...): ... # type: ignore[override]
|
||||
def hash(cls, secret: str | bytes, encoding: Any | None = ...): ... # type: ignore[override]
|
||||
@classmethod
|
||||
def verify(cls, secret, hash, encoding: Any | None = ...): ... # type: ignore[override]
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes, encoding: str | None = ...): ... # type: ignore[override]
|
||||
@classmethod
|
||||
def genconfig(cls): ...
|
||||
@classmethod
|
||||
def genhash(cls, secret, config, encoding: Any | None = ...): ... # type: ignore[override]
|
||||
def genhash(cls, secret, config, encoding: str | None = ...): ... # type: ignore[override]
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
name: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
min_salt_size: ClassVar[int]
|
||||
max_salt_size: ClassVar[int]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
@classmethod
|
||||
def verify(cls, secret, hash): ...
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]
|
||||
|
||||
class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
name: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
min_salt_size: ClassVar[int]
|
||||
max_salt_size: ClassVar[int]
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
__all__ = ["mysql323"]
|
||||
|
||||
class mysql323(uh.StaticHandler):
|
||||
name: str
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
name: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
checksum_chars: ClassVar[str]
|
||||
|
||||
class mysql41(uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# mysq41
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
__all__: list[str] = []
|
||||
|
||||
class oracle10(uh.HasUserContext, uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
class oracle11(uh.HasSalt, uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# oracle10g
|
||||
# oracle11g
|
||||
|
||||
@@ -1,98 +1,89 @@
|
||||
from typing import Any, ClassVar
|
||||
from _typeshed import Self
|
||||
from typing import ClassVar
|
||||
|
||||
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]
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
checksum_chars: ClassVar[str]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override]
|
||||
|
||||
# dynamically created by create_pbkdf2_hash()
|
||||
class pbkdf2_sha1(Pbkdf2DigestHandler):
|
||||
name: str
|
||||
ident: str
|
||||
checksum_size: int
|
||||
encoded_checksum_size: int
|
||||
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: str
|
||||
ident: str
|
||||
checksum_size: int
|
||||
encoded_checksum_size: int
|
||||
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: str
|
||||
ident: str
|
||||
checksum_size: int
|
||||
encoded_checksum_size: int
|
||||
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: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
default_rounds: Any
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
default_rounds: Any
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
default_rounds: Any
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
from typing import Any
|
||||
from _typeshed import Self
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
min_salt_size: int
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
default_ident: Any
|
||||
ident_values: Any
|
||||
ident_aliases: Any
|
||||
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): ...
|
||||
def to_string(self): ...
|
||||
def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class postgres_md5(uh.HasUserContext, uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
|
||||
@@ -3,17 +3,16 @@ from typing import Any, ClassVar
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: Any
|
||||
rounds_cost: str
|
||||
default_algs: Any
|
||||
algs: Any
|
||||
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: Any | None
|
||||
@classmethod
|
||||
def extract_digest_info(cls, hash, alg): ...
|
||||
@classmethod
|
||||
@@ -22,7 +21,6 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
|
||||
def derive_digest(cls, password, salt, rounds, alg): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
@classmethod
|
||||
def using(cls, default_algs: Any | None = ..., algs: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
def __init__(self, algs: Any | None = ..., **kwds) -> None: ...
|
||||
|
||||
@@ -4,17 +4,16 @@ 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: str
|
||||
setting_kwds: Any
|
||||
checksum_size: int
|
||||
default_ident: Any
|
||||
ident_values: Any
|
||||
name: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_ident: ClassVar[str]
|
||||
ident_values: ClassVar[tuple[str, ...]]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from typing import Any, ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
@@ -5,19 +6,18 @@ import passlib.utils.handlers as uh
|
||||
log: Any
|
||||
|
||||
class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
checksum_chars: Any
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
checksum_chars: ClassVar[str]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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): ...
|
||||
def to_string(self, config: bool = ...): ...
|
||||
backends: Any
|
||||
def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override]
|
||||
def to_string(self, config: bool = ...) -> str: ...
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
from typing import Any
|
||||
from _typeshed import Self
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
max_salt_size: int
|
||||
salt_chars: Any
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
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: Any | None = ..., **kwds) -> None: ...
|
||||
def __init__(self, implicit_rounds: bool | None = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self): ...
|
||||
backends: Any
|
||||
def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override]
|
||||
backends: ClassVar[tuple[str, ...]]
|
||||
|
||||
class sha256_crypt(_SHA2_Common):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
default_rounds: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_rounds: ClassVar[int]
|
||||
|
||||
class sha512_crypt(_SHA2_Common):
|
||||
name: str
|
||||
ident: Any
|
||||
checksum_size: int
|
||||
default_rounds: int
|
||||
name: ClassVar[str]
|
||||
ident: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_rounds: ClassVar[int]
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
from typing import Any, ClassVar
|
||||
from _typeshed import Self
|
||||
from typing import ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
default_salt_size: ClassVar[int]
|
||||
max_salt_size: Any
|
||||
salt_chars: Any
|
||||
default_rounds: int
|
||||
min_rounds: int
|
||||
max_rounds: int
|
||||
rounds_cost: str
|
||||
ident_values: Any
|
||||
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 = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
@classmethod
|
||||
def from_string(cls, hash): ...
|
||||
def to_string(self, _withchk: bool = ...): ...
|
||||
def from_string(cls: type[Self], hash: str | bytes) -> Self: ... # type: ignore[override]
|
||||
def to_string(self, _withchk: bool = ...) -> str: ...
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
class lmhash(uh.TruncateMixin, uh.HasEncodingContext, uh.StaticHandler):
|
||||
name: str
|
||||
setting_kwds: Any
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
truncate_size: int
|
||||
default_encoding: str
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
truncate_size: ClassVar[int]
|
||||
@classmethod
|
||||
def raw(cls, secret, encoding: Any | None = ...): ...
|
||||
|
||||
class nthash(uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
@classmethod
|
||||
def raw(cls, secret): ...
|
||||
@classmethod
|
||||
@@ -24,15 +22,15 @@ class nthash(uh.StaticHandler):
|
||||
bsd_nthash: Any
|
||||
|
||||
class msdcc(uh.HasUserContext, uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
@classmethod
|
||||
def raw(cls, secret, user): ...
|
||||
|
||||
class msdcc2(uh.HasUserContext, uh.StaticHandler):
|
||||
name: str
|
||||
checksum_chars: Any
|
||||
checksum_size: int
|
||||
name: ClassVar[str]
|
||||
checksum_chars: ClassVar[str]
|
||||
checksum_size: ClassVar[int]
|
||||
@classmethod
|
||||
def raw(cls, secret, user): ...
|
||||
|
||||
@@ -1,37 +1,38 @@
|
||||
import abc
|
||||
from abc import abstractmethod
|
||||
from typing import Any
|
||||
from _typeshed import Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
class PasswordHash(metaclass=abc.ABCMeta):
|
||||
is_disabled: bool
|
||||
truncate_size: Any
|
||||
truncate_error: bool
|
||||
truncate_verify_reject: bool
|
||||
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, **setting_and_context_kwds): ...
|
||||
def hash(cls, secret: str | bytes, **setting_and_context_kwds) -> str: ...
|
||||
@classmethod
|
||||
def encrypt(cls, *args, **kwds): ...
|
||||
def encrypt(cls, secret: str | bytes, **kwds) -> str: ...
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def verify(cls, secret, hash, **context_kwds): ...
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes, **context_kwds): ...
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def using(cls, relaxed: bool = ..., **kwds): ...
|
||||
def using(cls: type[Self], relaxed: bool = ..., **kwds: Any) -> type[Self]: ...
|
||||
@classmethod
|
||||
def needs_update(cls, hash, secret: Any | None = ...): ...
|
||||
def needs_update(cls, hash: str, secret: str | bytes | None = ...) -> bool: ...
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes) -> bool: ...
|
||||
@classmethod
|
||||
def genconfig(cls, **setting_kwds): ...
|
||||
def genconfig(cls, **setting_kwds: Any) -> str: ...
|
||||
@classmethod
|
||||
def genhash(cls, secret, config, **context) -> None: ...
|
||||
def genhash(cls, secret: str | bytes, config: str, **context: Any) -> str: ...
|
||||
deprecated: bool
|
||||
|
||||
class DisabledHash(PasswordHash, metaclass=abc.ABCMeta):
|
||||
is_disabled: bool
|
||||
class DisabledHash(PasswordHash, metaclass=ABCMeta):
|
||||
is_disabled: ClassVar[Literal[True]]
|
||||
@classmethod
|
||||
def disable(cls, hash: Any | None = ...): ...
|
||||
def disable(cls, hash: str | None = ...) -> str: ...
|
||||
@classmethod
|
||||
def enable(cls, hash) -> None: ...
|
||||
def enable(cls, hash: str) -> str: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import abc
|
||||
from _typeshed import Self
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from passlib.ifc import PasswordHash
|
||||
@@ -17,58 +18,53 @@ def render_mc3(ident, rounds, salt, checksum, sep=..., rounds_base: int = ...):
|
||||
|
||||
class MinimalHandler(PasswordHash, metaclass=abc.ABCMeta):
|
||||
@classmethod
|
||||
def using(cls, relaxed: bool = ...): ... # type: ignore[override]
|
||||
def using(cls: Self, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override]
|
||||
|
||||
class TruncateMixin(MinimalHandler, metaclass=abc.ABCMeta):
|
||||
truncate_error: bool
|
||||
truncate_verify_reject: bool
|
||||
truncate_error: ClassVar[bool]
|
||||
truncate_verify_reject: ClassVar[bool]
|
||||
@classmethod
|
||||
def using(cls, truncate_error: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
def using(cls: type[Self], truncate_error: object = ..., *, relaxed: bool = ...) -> type[Self]: ... # type: ignore[override]
|
||||
|
||||
class GenericHandler(MinimalHandler):
|
||||
setting_kwds: Any
|
||||
context_kwds: Any
|
||||
ident: Any
|
||||
checksum_size: Any
|
||||
checksum_chars: Any
|
||||
checksum: Any
|
||||
use_defaults: Any
|
||||
def __init__(self, checksum: Any | None = ..., use_defaults: bool = ..., **kwds) -> None: ...
|
||||
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 = ..., use_defaults: bool = ...) -> None: ...
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
def identify(cls, hash: str | bytes) -> bool: ...
|
||||
@classmethod
|
||||
def from_string(cls, hash, **context) -> None: ...
|
||||
def to_string(self) -> None: ...
|
||||
def from_string(cls: type[Self], hash: str | bytes, **context: Any) -> Self: ...
|
||||
def to_string(self) -> str: ...
|
||||
@classmethod
|
||||
def hash(cls, secret, **kwds): ...
|
||||
def hash(cls, secret: str | bytes, **kwds: Any) -> str: ...
|
||||
@classmethod
|
||||
def verify(cls, secret, hash, **context): ...
|
||||
def verify(cls, secret: str | bytes, hash: str | bytes, **context: Any) -> bool: ...
|
||||
@classmethod
|
||||
def genconfig(cls, **kwds): ...
|
||||
def genconfig(cls, **kwds: Any) -> str: ...
|
||||
@classmethod
|
||||
def genhash(cls, secret, config, **context): ...
|
||||
def genhash(cls, secret: str | bytes, config: str, **context: Any) -> str: ...
|
||||
@classmethod
|
||||
def needs_update(cls, hash, secret: Any | None = ..., **kwds): ...
|
||||
def needs_update(cls, hash: str | bytes, secret: str | bytes | None = ..., **kwds: Any) -> bool: ...
|
||||
@classmethod
|
||||
def parsehash(cls, hash, checksum: bool = ..., sanitize: bool = ...): ...
|
||||
def parsehash(cls, hash: str | bytes, checksum: bool = ..., sanitize: bool = ...) -> dict[str, Any]: ...
|
||||
@classmethod
|
||||
def bitsize(cls, **kwds): ...
|
||||
def bitsize(cls, **kwds: Any) -> dict[str, Any]: ...
|
||||
|
||||
class StaticHandler(GenericHandler):
|
||||
setting_kwds: Any
|
||||
@classmethod
|
||||
def from_string(cls, hash, **context): ...
|
||||
def to_string(self): ...
|
||||
setting_kwds: ClassVar[tuple[str, ...]]
|
||||
|
||||
class HasEncodingContext(GenericHandler):
|
||||
context_kwds: Any
|
||||
default_encoding: str
|
||||
encoding: Any
|
||||
def __init__(self, encoding: Any | None = ..., **kwds) -> None: ...
|
||||
default_encoding: ClassVar[str]
|
||||
encoding: str
|
||||
def __init__(self, encoding: str | None = ..., **kwds) -> None: ...
|
||||
|
||||
class HasUserContext(GenericHandler):
|
||||
context_kwds: Any
|
||||
user: Any
|
||||
user: Any | None
|
||||
def __init__(self, user: Any | None = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def hash(cls, secret, user: Any | None = ..., **context): ...
|
||||
@@ -80,42 +76,40 @@ class HasUserContext(GenericHandler):
|
||||
class HasRawChecksum(GenericHandler): ...
|
||||
|
||||
class HasManyIdents(GenericHandler):
|
||||
default_ident: Any
|
||||
ident_values: Any
|
||||
ident_aliases: Any
|
||||
ident: Any
|
||||
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: Any | None = ..., ident: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
def __init__(self, ident: Any | None = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def identify(cls, hash): ...
|
||||
|
||||
class HasSalt(GenericHandler):
|
||||
min_salt_size: int
|
||||
max_salt_size: Any
|
||||
salt_chars: Any
|
||||
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[int | None]
|
||||
salt: Any
|
||||
default_salt_chars: ClassVar[str | None]
|
||||
salt: str | bytes | None
|
||||
@classmethod
|
||||
def using(cls, default_salt_size: Any | None = ..., salt_size: Any | None = ..., salt: Any | None = ..., **kwds): ... # type: ignore[override]
|
||||
def __init__(self, salt: Any | None = ..., **kwds) -> None: ...
|
||||
def using(cls, default_salt_size: int | None = ..., salt_size: int | None = ..., salt: str | bytes | None = ..., **kwds): ... # type: ignore[override]
|
||||
def __init__(self, salt: str | bytes | None = ..., **kwds) -> None: ...
|
||||
@classmethod
|
||||
def bitsize(cls, salt_size: Any | None = ..., **kwds): ...
|
||||
def bitsize(cls, salt_size: int | None = ..., **kwds): ...
|
||||
|
||||
class HasRawSalt(HasSalt):
|
||||
salt_chars: Any
|
||||
salt_chars: ClassVar[bytes] # type: ignore[assignment]
|
||||
|
||||
class HasRounds(GenericHandler):
|
||||
min_rounds: int
|
||||
max_rounds: Any
|
||||
rounds_cost: str
|
||||
using_rounds_kwds: Any
|
||||
min_desired_rounds: Any
|
||||
max_desired_rounds: Any
|
||||
default_rounds: Any
|
||||
vary_rounds: Any
|
||||
rounds: Any
|
||||
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[Any | None]
|
||||
rounds: int
|
||||
@classmethod
|
||||
def using( # type: ignore[override]
|
||||
cls,
|
||||
@@ -139,11 +133,11 @@ class ParallelismMixin(GenericHandler):
|
||||
def __init__(self, parallelism: Any | None = ..., **kwds) -> None: ...
|
||||
|
||||
class BackendMixin(PasswordHash, metaclass=abc.ABCMeta):
|
||||
backends: Any
|
||||
backends: ClassVar[tuple[str, ...] | None]
|
||||
@classmethod
|
||||
def get_backend(cls): ...
|
||||
@classmethod
|
||||
def has_backend(cls, name: str = ...): ...
|
||||
def has_backend(cls, name: str = ...) -> bool: ...
|
||||
@classmethod
|
||||
def set_backend(cls, name: str = ..., dryrun: bool = ...): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user