mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
pikvm/pikvm#1204: Expire user session
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user