pikvm/pikvm#1204: Expire user session

This commit is contained in:
Maxim Devaev
2025-02-08 23:30:52 +02:00
parent abbd65a9a0
commit a7c3cdc1ea
8 changed files with 225 additions and 57 deletions

View File

@@ -23,6 +23,7 @@
from typing import Any
from .basic import valid_string_list
from .basic import valid_number
from . import check_re_match
@@ -40,5 +41,9 @@ def valid_passwd(arg: Any) -> str:
return check_re_match(arg, "passwd characters", r"^[\x20-\x7e]*\Z$", strip=False, hide=True)
def valid_expire(arg: Any) -> int:
return int(valid_number(arg, min=0, name="expiration time"))
def valid_auth_token(arg: Any) -> str:
return check_re_match(arg, "auth token", r"^[0-9a-f]{64}$", hide=True)