load only required plugins

This commit is contained in:
Devaev Maxim
2019-04-28 21:01:03 +03:00
parent 26338c5acf
commit e13b5027d6
7 changed files with 22 additions and 38 deletions

View File

@@ -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"),
}

View File

@@ -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),