summaryrefslogtreecommitdiff
path: root/kvmd/validators/auth.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-10 21:40:34 +0300
committerDevaev Maxim <[email protected]>2019-04-10 21:40:34 +0300
commit07c59485fcef43a8a3dc122d05c7352a3da8aa15 (patch)
treeed03ed4c9a314f1be301f90cc5bba64eff4ecbc7 /kvmd/validators/auth.py
parent4eb89c9399d3bd440577d275a9c07578c2f47484 (diff)
moar validators
Diffstat (limited to 'kvmd/validators/auth.py')
-rw-r--r--kvmd/validators/auth.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/kvmd/validators/auth.py b/kvmd/validators/auth.py
index 7e110162..535ba445 100644
--- a/kvmd/validators/auth.py
+++ b/kvmd/validators/auth.py
@@ -20,8 +20,11 @@
# ========================================================================== #
+from typing import List
from typing import Any
+from .basic import valid_string_list
+
from . import check_re_match
@@ -30,6 +33,10 @@ def valid_user(arg: Any) -> str:
return check_re_match(arg, "username characters", r"^[a-z_][a-z0-9_-]*$")
+def valid_users_list(arg: Any) -> List[str]:
+ return valid_string_list(arg, subval=valid_user, name="users list")
+
+
def valid_passwd(arg: Any) -> str:
return check_re_match(arg, "passwd characters", r"^[\x20-\x7e]*\Z$", strip=False, hide=True)