conftest e2e auth/test user create
This commit is contained in:
@@ -5,7 +5,7 @@ from uuid import UUID
|
||||
from pydantic import AfterValidator, BaseModel, EmailStr, Field
|
||||
|
||||
|
||||
async def validate_password(password: str) -> str:
|
||||
def validate_password(password: str) -> str:
|
||||
PUNCTUATION: set[str] = {"$", "@", "#", "%", "!", "^", "&", "*", "(", ")", "-", "_", "+", "=", "{", "}", "[", "]"}
|
||||
if len(password) < 8 or len(password) > 72:
|
||||
raise ValueError("Password must be 8-72 characters")
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import asyncio
|
||||
|
||||
from src.database.users.crud import UsersCrudActions
|
||||
from src.errors.http_errors.errors import Errors
|
||||
from src.models.pydantic_models.model import UserCreate, UserOut, UserUpdate
|
||||
@@ -15,7 +17,7 @@ class CrudService:
|
||||
async def _plain_to_hash(self, user_data:dict)->dict:
|
||||
|
||||
user_data["hashed_password"]=user_data.pop("plain_password")
|
||||
user_data["hashed_password"]=self.hash_service.plain_to_hash(user_data["hashed_password"])
|
||||
user_data["hashed_password"]= await asyncio.to_thread(self.hash_service.plain_to_hash, user_data["hashed_password"])
|
||||
|
||||
return user_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user