summaryrefslogtreecommitdiff
path: root/kvmd/apps/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-09-11 19:11:19 +0300
committerDevaev Maxim <[email protected]>2019-09-11 19:11:19 +0300
commit2535892723e275a3e31aa318edc788869c643fd0 (patch)
treec51277d4ef558cc010622cfa8c4e4c06777a8ed1 /kvmd/apps/__init__.py
parente17889ba426a167804796a830043e59e1941972f (diff)
changed config hierarchy
Diffstat (limited to 'kvmd/apps/__init__.py')
-rw-r--r--kvmd/apps/__init__.py21
1 files changed, 11 insertions, 10 deletions
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": {