05/07 Phase 3: initial codes

This commit is contained in:
2026-05-07 12:17:19 -04:00
parent 6e5518c103
commit ce462c57b2
107 changed files with 6365 additions and 208 deletions
+9
View File
@@ -104,3 +104,12 @@ def validate_setting_key(key: str) -> bool:
"""Return True if key is a valid setting key (alphanumeric, underscores, dots)."""
import re
return bool(key and re.match(r'^[a-zA-Z0-9_.]+$', key) and len(key) <= 100)
def validate_passcode(passcode: str, min_len: int = 4, max_len: int = 6) -> bool:
"""Return True if passcode is digits only and within the allowed length range."""
return (
bool(passcode)
and passcode.isdigit()
and min_len <= len(passcode) <= max_len
)