summaryrefslogtreecommitdiff
path: root/kvmd/plugins/auth/htpasswd.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-05-15 17:30:14 +0300
committerDevaev Maxim <[email protected]>2020-05-16 17:35:10 +0300
commit2eef3061ce8e3222da7864bfe4fd2bf767b5e5f1 (patch)
treef9adc498cc1ebc5362489bd9ae550a36dec4f0a0 /kvmd/plugins/auth/htpasswd.py
parenta364e689c6d944be90ce80ad34594b21309cdb05 (diff)
improved security checks
Diffstat (limited to 'kvmd/plugins/auth/htpasswd.py')
-rw-r--r--kvmd/plugins/auth/htpasswd.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/kvmd/plugins/auth/htpasswd.py b/kvmd/plugins/auth/htpasswd.py
index 94e29711..045475f8 100644
--- a/kvmd/plugins/auth/htpasswd.py
+++ b/kvmd/plugins/auth/htpasswd.py
@@ -43,5 +43,7 @@ class Plugin(BaseAuthService):
}
async def authorize(self, user: str, passwd: str) -> bool:
+ assert user == user.strip()
+ assert user
htpasswd = passlib.apache.HtpasswdFile(self.__path)
return htpasswd.check_password(user, passwd)