mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
strict file validation
This commit is contained in:
@@ -26,7 +26,7 @@ import passlib.apache
|
||||
|
||||
from ...yamlconf import Option
|
||||
|
||||
from ...validators.os import valid_abs_path_exists
|
||||
from ...validators.os import valid_abs_file
|
||||
|
||||
from . import BaseAuthService
|
||||
|
||||
@@ -39,7 +39,7 @@ class Plugin(BaseAuthService):
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"file": Option("/etc/kvmd/htpasswd", type=valid_abs_path_exists, unpack_as="path"),
|
||||
"file": Option("/etc/kvmd/htpasswd", type=valid_abs_file, unpack_as="path"),
|
||||
}
|
||||
|
||||
async def authorize(self, user: str, passwd: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user