mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Clean up authenticator code formatting
This commit is contained in:
parent
1ce32d2f18
commit
49ad1b6e46
@ -17,10 +17,10 @@ AuthConstructor = Callable[[
|
||||
AUTHENTICATORS: Dict[str, AuthConstructor] = {
|
||||
"credential-file": lambda n, s, c:
|
||||
CredentialFileAuthenticator(n, CredentialFileAuthSection(s)),
|
||||
"keyring": lambda n, s, c:
|
||||
KeyringAuthenticator(n, KeyringAuthSection(s)),
|
||||
"simple": lambda n, s, c:
|
||||
SimpleAuthenticator(n, SimpleAuthSection(s)),
|
||||
"tfa": lambda n, s, c:
|
||||
TfaAuthenticator(n),
|
||||
"keyring": lambda n, s, c:
|
||||
KeyringAuthenticator(n, KeyringAuthSection(s)),
|
||||
}
|
||||
|
@ -17,10 +17,7 @@ class AuthSection(Section):
|
||||
|
||||
|
||||
class Authenticator(ABC):
|
||||
def __init__(
|
||||
self,
|
||||
name: str
|
||||
) -> None:
|
||||
def __init__(self, name: str) -> None:
|
||||
"""
|
||||
Initialize an authenticator from its name and its section in the config
|
||||
file.
|
||||
|
@ -18,11 +18,7 @@ class KeyringAuthSection(AuthSection):
|
||||
|
||||
class KeyringAuthenticator(Authenticator):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
section: KeyringAuthSection,
|
||||
) -> None:
|
||||
def __init__(self, name: str, section: KeyringAuthSection) -> None:
|
||||
super().__init__(name)
|
||||
|
||||
self._username = section.username()
|
||||
|
@ -14,11 +14,7 @@ class SimpleAuthSection(AuthSection):
|
||||
|
||||
|
||||
class SimpleAuthenticator(Authenticator):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
section: SimpleAuthSection,
|
||||
) -> None:
|
||||
def __init__(self, name: str, section: SimpleAuthSection) -> None:
|
||||
super().__init__(name)
|
||||
|
||||
self._username = section.username()
|
||||
|
@ -6,10 +6,7 @@ from .authenticator import Authenticator, AuthError
|
||||
|
||||
|
||||
class TfaAuthenticator(Authenticator):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
) -> None:
|
||||
def __init__(self, name: str) -> None:
|
||||
super().__init__(name)
|
||||
|
||||
async def username(self) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user