diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-07-25 21:42:27 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-07-25 22:05:20 +0200 |
commit | 210ee835662877c4e5a94450d0656680875e0e18 (patch) | |
tree | 79823306a0aea842541a8b2586fcf47b0ced0eb5 /mu4web/user/local.py | |
parent | Configure linters. (diff) | |
download | mu4web-210ee835662877c4e5a94450d0656680875e0e18.tar.gz mu4web-210ee835662877c4e5a94450d0656680875e0e18.tar.xz |
Fix and harden linter checks.
Harden the requirements of mypy, and also check against flake8
docstrings. And fix all errors and warnings resulting from that.
Diffstat (limited to 'mu4web/user/local.py')
-rw-r--r-- | mu4web/user/local.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mu4web/user/local.py b/mu4web/user/local.py index 37e88cb..c7936d6 100644 --- a/mu4web/user/local.py +++ b/mu4web/user/local.py @@ -1,12 +1,21 @@ +""" +User authentication through local password store. + +Currently (hard codedly) loads the file password.json from the current +path. Take care. +""" + from .. import password from ..password import Passwords from typing import cast import os from . import User -passwords: Passwords = password.Passwords(cast(os.PathLike, 'passwords.json')) +passwords: Passwords = password.Passwords(cast(os.PathLike[str], 'passwords.json')) class LocalUser(User): - def validate(self, password: str) -> bool: + """Authenticate user through local password file.""" + + def validate(self, password: str) -> bool: # noqa: 201 return passwords.validate(self._username, password) |