Files
taskncoffee/src/schemas/validators.py
2025-07-12 13:10:22 +03:00

12 lines
341 B
Python

from typing import Any
def ensure_password(value: Any) -> Any:
if not isinstance(value, str):
raise TypeError("Password must be a string")
if len(value) < 8:
raise ValueError("Password must be at least 8 characters")
if value.strip() == "":
raise ValueError("Password cannot be empty")
return value