FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve `passlib.win32` by donbarbos · Pull Request #13711 · python/typeshed · GitHub

Repository navigation

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

Filter by extension

Filter by extension .pyi  (2) .txt  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 0 additions & 1 deletion stubs/passlib/@tests/stubtest_allowlist.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ passlib.utils.decor.__all__
passlib.utils.handlers.__all__
passlib.utils.md4.__all__
passlib.utils.pbkdf2.__all__
passlib.win32.__all__

# proxy module that uses some import magic incompatible with stubtest
passlib.hash
Expand Down
11 changes: 9 additions & 2 deletions stubs/passlib/passlib/handlers/windows.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import Any, ClassVar, Literal, overload

import passlib.utils.handlers as uh

Expand All @@ -17,8 +17,15 @@ class nthash(uh.StaticHandler):
checksum_size: ClassVar[int]
@classmethod
def raw(cls, secret): ...
@overload
@classmethod
def raw_nthash(cls, secret, hex: bool = False): ...
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: ...
Comment thread
donbarbos marked this conversation as resolved.

bsd_nthash: Any

Expand Down
17 changes: 13 additions & 4 deletions stubs/passlib/passlib/win32.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from typing import Any
from binascii import hexlify as hexlify
from typing import Final, Literal, overload

from passlib.hash import nthash as nthash
from passlib.handlers.windows import nthash as nthash

raw_nthash: Any
LM_MAGIC: Final[bytes]
raw_nthash = nthash.raw_nthash

def raw_lmhash(secret, encoding: str = "ascii", hex: bool = False): ...
@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"]

Back | FazBrowse Home | New Git URL