-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b33d943
commit afcf6d8
Showing
8 changed files
with
102 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Literal | ||
|
||
class AddressAuth(netius.auth.base.Auth): | ||
def __init__(self, allowed: list = ..., *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, allowed: list = ..., *args, **kwargs) -> bool: ... | ||
@classmethod | ||
def is_simple(cls) -> Literal[True]: ... | ||
def auth_i(self, *args, **kwargs): ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Literal | ||
|
||
class AllowAuth(netius.auth.base.Auth): | ||
@classmethod | ||
def auth(cls, *args, **kwargs) -> Literal[True]: ... | ||
@classmethod | ||
def is_simple(cls) -> Literal[True]: ... |
This file contains 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,13 +1,25 @@ | ||
from typing import Literal | ||
import netius as netius | ||
|
||
HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"] | ||
from typing import Any, Literal, NoReturn, PathLike, Unbound | ||
|
||
class Auth(object): | ||
class Auth: | ||
def __init__(self, *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, *args, **kwargs) -> NoReturn: ... | ||
@classmethod | ||
def meta(cls, *args, **kwargs) -> dict: ... | ||
@classmethod | ||
def auth_assert(cls, *args, **kwargs) -> None: ... | ||
@classmethod | ||
def verify(cls, encoded: str, decoded: str) -> bool: ... | ||
|
||
@classmethod | ||
def generate(cls, password: str, type: HashType = "sha256", salt: str = "netius") -> str: ... | ||
|
||
def generate(cls, password: str, type: str = ..., salt: str = ...) -> str: ... | ||
@classmethod | ||
def unpack(cls, password) -> tuple[Any | Literal["plain"], bytes | Any | str | None, Any | None, Unbound | Any | None]: ... | ||
@classmethod | ||
def get_file(cls, path: PathLike[str], cache: bool = ..., encoding: str | None = ...) -> (Any | str | bytes): ... | ||
@classmethod | ||
def unpack(cls, password: str) -> tuple[HashType, str, str, str]: ... | ||
def is_simple(cls) -> Literal[False]: ... | ||
def auth_i(self, *args, **kwargs) -> NoReturn: ... | ||
def auth_assert_i(self, *args, **kwargs) -> None: ... | ||
def is_simple_i(self) -> Literal[False]: ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Literal | ||
|
||
class DenyAuth(netius.auth.base.Auth): | ||
@classmethod | ||
def auth(cls, *args, **kwargs) -> Literal[False]: ... | ||
@classmethod | ||
def is_simple(cls) -> Literal[True]: ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Literal | ||
|
||
class DummyAuth(netius.auth.base.Auth): | ||
def __init__(self, value: bool = ..., *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, value: bool = ..., *args, **kwargs) -> bool: ... | ||
@classmethod | ||
def is_simple(cls) -> Literal[True]: ... | ||
def auth_i(self, *args, **kwargs) -> bool: ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import netius as netius | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Dict | ||
|
||
class MemoryAuth(netius.auth.base.Auth): | ||
def __init__(self, registry: Dict | None = ..., *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, username: str, password: str, registry: dict | None = ..., *args, **kwargs) -> bool: ... | ||
@classmethod | ||
def meta(cls, username: str, registry: Dict | None = ..., *args, **kwargs) -> Dict: ... | ||
@classmethod | ||
def get_registry(cls): ... | ||
@classmethod | ||
def load_registry(cls): ... | ||
def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import PathLike, Any, Dict | ||
|
||
class PasswdAuth(netius.auth.base.Auth): | ||
def __init__(self, path: PathLike[str] | None = ..., *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, username: str, password: str, path: str = ..., *args, **kwargs) -> bool: ... | ||
@classmethod | ||
def get_passwd(cls, path: PathLike[str], cache: bool = ...) -> (Any | Dict): ... | ||
def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ... |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import netius.auth.base | ||
import netius.auth.base as base | ||
|
||
from typing import Tuple | ||
|
||
class SimpleAuth(netius.auth.base.Auth): | ||
def __init__(self, username: str | None = ..., password: str | None = ..., *args, **kwargs) -> None: ... | ||
@classmethod | ||
def auth(cls, username: str, password: str, target: Tuple[str:str] | None = ..., *args, **kwargs) -> bool: ... | ||
def auth_i(self, username:str , password: str, *args, **kwargs) -> bool: ... |