From 2535892723e275a3e31aa318edc788869c643fd0 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 11 Sep 2019 19:11:19 +0300 Subject: changed config hierarchy --- kvmd/apps/__init__.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'kvmd/apps/__init__.py') diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py index 974a7d70..7b8f2ef2 100644 --- a/kvmd/apps/__init__.py +++ b/kvmd/apps/__init__.py @@ -112,11 +112,11 @@ def _init_config(config_path: str, sections: List[str], override_options: List[s config = make_config(raw_config, scheme) if "kvmd" in sections: - scheme["kvmd"]["auth"]["internal"] = get_auth_service_class(config.kvmd.auth.internal_type).get_plugin_options() - if config.kvmd.auth.external_type: - scheme["kvmd"]["auth"]["external"] = get_auth_service_class(config.kvmd.auth.external_type).get_plugin_options() + scheme["kvmd"]["auth"]["internal"].update(get_auth_service_class(config.kvmd.auth.internal.type).get_plugin_options()) + if config.kvmd.auth.external.type: + scheme["kvmd"]["auth"]["external"].update(get_auth_service_class(config.kvmd.auth.external.type).get_plugin_options()) - scheme["kvmd"]["hid"]["params"] = get_hid_class(config.kvmd.hid.type).get_plugin_options() + scheme["kvmd"]["hid"].update(get_hid_class(config.kvmd.hid.type).get_plugin_options()) config = make_config(raw_config, scheme) @@ -164,11 +164,13 @@ def _get_config_scheme(sections: List[str]) -> Dict: }, "auth": { - "internal_type": Option("htpasswd"), - # "internal": {}, - "external_type": Option(""), - # "external": {}, - "internal_users": Option([], type=valid_users_list), + "internal": { + "type": Option("htpasswd"), + "force_users": Option([], type=valid_users_list), + }, + "external": { + "type": Option(""), + }, }, "info": { @@ -178,7 +180,6 @@ def _get_config_scheme(sections: List[str]) -> Dict: "hid": { "type": Option("tty"), - # "params": {}, }, "atx": { -- cgit v1.2.3