using salted sha512 for htpasswd by default

This commit is contained in:
Maxim Devaev
2025-02-11 16:55:45 +02:00
parent 800d2724b8
commit de4f1903aa
8 changed files with 88 additions and 29 deletions

View File

@@ -20,12 +20,12 @@
# ========================================================================== #
import passlib.apache
from ...yamlconf import Option
from ...validators.os import valid_abs_file
from ...crypto import KvmdHtpasswdFile
from . import BaseAuthService
@@ -43,5 +43,5 @@ class Plugin(BaseAuthService):
async def authorize(self, user: str, passwd: str) -> bool:
assert user == user.strip()
assert user
htpasswd = passlib.apache.HtpasswdFile(self.__path)
htpasswd = KvmdHtpasswdFile(self.__path)
return htpasswd.check_password(user, passwd)