mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix: add max password length validation (128 chars) to NewUserRequest
This commit is contained in:
parent
c94b9b1c8d
commit
001df38f1f
1 changed files with 2 additions and 0 deletions
|
|
@ -1432,6 +1432,8 @@ class NewUserRequest(GenerateRequestBase):
|
|||
def validate_password(cls, v: Optional[str]) -> Optional[str]:
|
||||
if v is not None and len(v) < 8:
|
||||
raise ValueError("password must be at least 8 characters")
|
||||
if v is not None and len(v) > 128:
|
||||
raise ValueError("password must be at most 128 characters")
|
||||
return v
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue