feat: Implement random password and token generation for tests
This commit is contained in:
13
tests/utils/security.py
Normal file
13
tests/utils/security.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import secrets
|
||||
|
||||
|
||||
def random_password() -> str:
|
||||
"""Return a strong test password that satisfies complexity checks."""
|
||||
return f"Aa1!{secrets.token_urlsafe(16)}"
|
||||
|
||||
|
||||
def random_token() -> str:
|
||||
"""Return a random token suitable for test session data."""
|
||||
return secrets.token_urlsafe(24)
|
||||
Reference in New Issue
Block a user