diff --git a/src/schemas/validators.py b/src/schemas/validators.py index 90bb2ab..5910daf 100644 --- a/src/schemas/validators.py +++ b/src/schemas/validators.py @@ -2,5 +2,10 @@ from typing import Any def ensure_password(value: Any) -> Any: - #TODO - ... + 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