ensure password
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user