mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
load only required plugins
This commit is contained in:
@@ -33,13 +33,11 @@ from . import BaseAuthService
|
||||
|
||||
# =====
|
||||
class Plugin(BaseAuthService):
|
||||
PLUGIN_NAME = "htpasswd"
|
||||
|
||||
def __init__(self, path: str) -> None: # pylint: disable=super-init-not-called
|
||||
self.__path = path
|
||||
|
||||
@classmethod
|
||||
def get_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
return {
|
||||
"file": Option("/etc/kvmd/htpasswd", type=valid_abs_path_exists, unpack_as="path"),
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ from . import BaseAuthService
|
||||
|
||||
# =====
|
||||
class Plugin(BaseAuthService):
|
||||
PLUGIN_NAME = "http"
|
||||
|
||||
def __init__( # pylint: disable=super-init-not-called
|
||||
self,
|
||||
url: str,
|
||||
@@ -60,7 +58,7 @@ class Plugin(BaseAuthService):
|
||||
self.__http_session: Optional[aiohttp.ClientSession] = None
|
||||
|
||||
@classmethod
|
||||
def get_options(cls) -> Dict[str, Option]:
|
||||
def get_plugin_options(cls) -> Dict[str, Option]:
|
||||
return {
|
||||
"url": Option("http://localhost/auth"),
|
||||
"verify": Option(True, type=valid_bool),
|
||||
|
||||
Reference in New Issue
Block a user