Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions stubs/passlib/passlib/handlers/argon2.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand Down Expand Up @@ -51,24 +52,24 @@ class _Argon2Common( # type: ignore[misc]
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash): ...
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): ...
def hash(cls, secret): ... # type: ignore[override]
@classmethod
def verify(cls, secret, hash): ...
def verify(cls, secret, hash): ... # type: ignore[override]
@classmethod
def genhash(cls, secret, config): ...
def genhash(cls, secret, config): ... # type: ignore[override]

class _CffiBackend(_Argon2Common):
@classmethod
def hash(cls, secret): ...
def hash(cls, secret): ... # type: ignore[override]
@classmethod
def verify(cls, secret, hash): ...
def verify(cls, secret, hash): ... # type: ignore[override]
@classmethod
def genhash(cls, secret, config): ...
def genhash(cls, secret, config): ... # type: ignore[override]

class _PureBackend(_Argon2Common): ...

Expand Down
7 changes: 4 additions & 3 deletions stubs/passlib/passlib/handlers/bcrypt.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -19,9 +20,9 @@ class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents,
rounds_cost: ClassVar[str]
truncate_size: ClassVar[int | None]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def needs_update(cls, hash, **kwds): ...
def needs_update(cls, hash, **kwds): ... # type: ignore[override]
@classmethod
def normhash(cls, hash): ...

Expand Down Expand Up @@ -50,7 +51,7 @@ class bcrypt_sha256(_wrapped_bcrypt):
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
def __init__(self, version=None, **kwds) -> None: ...

__all__ = ["bcrypt"]
3 changes: 2 additions & 1 deletion stubs/passlib/passlib/handlers/cisco.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -20,7 +21,7 @@ class cisco_type7(uh.GenericHandler):
@classmethod
def using(cls, salt: int | None = None, **kwds): ... # type: ignore[override]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
salt: int
def __init__(self, salt: int | None = None, **kwds) -> None: ...
@classmethod
Expand Down
11 changes: 6 additions & 5 deletions stubs/passlib/passlib/handlers/des_crypt.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -11,7 +12,7 @@ class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHand
salt_chars: ClassVar[str]
truncate_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
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]
Expand All @@ -26,9 +27,9 @@ class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def using(cls, **kwds): ...
def using(cls, **kwds): ... # type: ignore[override]
backends: ClassVar[tuple[str, ...]]

class bigcrypt(uh.HasSalt, uh.GenericHandler):
Expand All @@ -38,7 +39,7 @@ class bigcrypt(uh.HasSalt, uh.GenericHandler):
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc]
name: ClassVar[str]
Expand All @@ -49,6 +50,6 @@ class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[
salt_chars: ClassVar[str]
truncate_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

__all__ = ["des_crypt", "bsdi_crypt", "bigcrypt", "crypt16"]
18 changes: 11 additions & 7 deletions stubs/passlib/passlib/handlers/digests.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import deprecated

import passlib.utils.handlers as uh

Expand All @@ -8,11 +10,11 @@ class HexDigestHash(uh.StaticHandler):

def create_hex_hash(digest, module="passlib.handlers.digests", django_name=None, required: bool = True): ...

hex_md4: Any
hex_md5: Any
hex_sha1: Any
hex_sha256: Any
hex_sha512: Any
hex_md4: Incomplete
hex_md5: Incomplete
hex_sha1: Incomplete
hex_sha256: Incomplete
hex_sha512: Incomplete

class htdigest(uh.MinimalHandler):
name: ClassVar[str]
Expand All @@ -25,8 +27,10 @@ class htdigest(uh.MinimalHandler):
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): ...
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]

Expand Down
9 changes: 5 additions & 4 deletions stubs/passlib/passlib/handlers/django.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh
from passlib.handlers.bcrypt import _wrapped_bcrypt
Expand All @@ -9,12 +10,12 @@ class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler):
salt_chars: ClassVar[str]
checksum_chars: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
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): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class django_salted_sha1(DjangoSaltedHash):
name: ClassVar[str]
Expand All @@ -37,7 +38,7 @@ class django_bcrypt_sha256(_wrapped_bcrypt):
@classmethod
def identify(cls, hash): ...
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class django_pbkdf2_sha256(DjangoVariableHash):
name: ClassVar[str]
Expand Down Expand Up @@ -70,7 +71,7 @@ class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type
truncate_size: ClassVar[int]
use_duplicate_salt: bool
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class django_disabled(DisabledHash, uh.StaticHandler):
name: ClassVar[str]
Expand Down
5 changes: 3 additions & 2 deletions stubs/passlib/passlib/handlers/fshp.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -21,8 +22,8 @@ class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
@property
def checksum_alg(self): ...
@property
def checksum_size(self): ...
def checksum_size(self): ... # type: ignore[override]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

__all__ = ["fshp"]
5 changes: 3 additions & 2 deletions stubs/passlib/passlib/handlers/ldap_digests.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh
from passlib.handlers.misc import plaintext
Expand Down Expand Up @@ -32,7 +33,7 @@ class _SaltedBase64DigestHelper(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHand
max_salt_size: ClassVar[int]
default_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class ldap_md5(_Base64DigestHelper):
name: ClassVar[str]
Expand Down Expand Up @@ -67,7 +68,7 @@ class ldap_salted_sha512(_SaltedBase64DigestHelper):
class ldap_plaintext(plaintext):
name: ClassVar[str]
@classmethod
def genconfig(cls): ...
def genconfig(cls): ... # type: ignore[override]
@classmethod
def identify(cls, hash): ...

Expand Down
3 changes: 2 additions & 1 deletion stubs/passlib/passlib/handlers/md5_crypt.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -8,7 +9,7 @@ class _MD5_Common(uh.HasSalt, uh.GenericHandler):
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class md5_crypt(uh.HasManyBackends, _MD5_Common):
name: ClassVar[str]
Expand Down
5 changes: 4 additions & 1 deletion stubs/passlib/passlib/handlers/misc.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from typing_extensions import deprecated

import passlib.utils.handlers as uh
from passlib.ifc import DisabledHash
Expand Down Expand Up @@ -43,8 +44,10 @@ class plaintext(uh.MinimalHandler):
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): ...
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]

Expand Down
5 changes: 3 additions & 2 deletions stubs/passlib/passlib/handlers/mssql.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -8,7 +9,7 @@ class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def verify(cls, secret: str | bytes, hash: str | bytes) -> bool: ... # type: ignore[override]

Expand All @@ -18,6 +19,6 @@ class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

__all__ = ["mssql2000", "mssql2005"]
3 changes: 2 additions & 1 deletion stubs/passlib/passlib/handlers/oracle.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -17,4 +18,4 @@ class oracle11(uh.HasSalt, uh.GenericHandler):
max_salt_size: ClassVar[int]
salt_chars: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
8 changes: 4 additions & 4 deletions stubs/passlib/passlib/handlers/pbkdf2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Generic
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
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]
Expand All @@ -64,7 +64,7 @@ class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: i
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]

class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
name: ClassVar[str]
Expand All @@ -73,7 +73,7 @@ class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler)
min_salt_size: ClassVar[int]
max_salt_size: ClassVar[int]
@classmethod
def from_string(cls, hash): ...
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]
Expand All @@ -86,6 +86,6 @@ class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Gene
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
@classmethod
def from_string(cls, hash): ...
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"]
3 changes: 2 additions & 1 deletion stubs/passlib/passlib/handlers/scram.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -21,7 +22,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
@classmethod
def derive_digest(cls, password, salt, rounds, alg): ...
@classmethod
def from_string(cls, hash): ...
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: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/passlib/passlib/handlers/scrypt.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar
from typing_extensions import Self

import passlib.utils.handlers as uh

Expand All @@ -19,7 +20,7 @@ class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum
@classmethod
def using(cls, block_size=None, **kwds): ... # type: ignore[override]
@classmethod
def from_string(cls, hash): ...
def from_string(cls, hash) -> Self: ... # type: ignore[override]
@classmethod
def parse(cls, hash): ...
def to_string(self): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/passlib/passlib/utils/handlers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GenericHandler(MinimalHandler):
@classmethod
def identify(cls, hash: str | bytes) -> bool: ...
@classmethod
def from_string(cls, hash: str | bytes, **context: Any) -> Self: ...
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: ...
Expand Down