From 210ee835662877c4e5a94450d0656680875e0e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 25 Jul 2023 21:42:27 +0200 Subject: 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. --- mu4web/user/local.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mu4web/user/local.py') 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) -- cgit v1.2.3