diff --git a/store/app/model.py b/store/app/model.py index 4d427ebc..292292cd 100644 --- a/store/app/model.py +++ b/store/app/model.py @@ -7,7 +7,7 @@ import time from datetime import datetime, timedelta -from typing import Optional, Self, Set, Literal +from typing import Literal, Optional, Self, Set from pydantic import BaseModel, EmailStr @@ -83,11 +83,7 @@ class OAuthKey(RobolistBaseModel): @classmethod def create(cls, user_id: str, provider: str, token: str) -> Self: - return cls( - id=new_uuid(), - user_id=user_id, - provider=provider, - token=token), + return (cls(id=new_uuid(), user_id=user_id, provider=provider, token=token),) APIKeySource = Literal["user", "oauth"] @@ -118,12 +114,7 @@ def create( if permissions == "full": permissions = {"read", "write", "admin"} ttl_timestamp = int((datetime.utcnow() + timedelta(days=90)).timestamp()) - return cls( - id=new_uuid(), - user_id=user_id, - source=source, - permissions=permissions, - ttl=ttl_timestamp), + return (cls(id=new_uuid(), user_id=user_id, source=source, permissions=permissions, ttl=ttl_timestamp),) ArtifactSize = Literal["small", "large"] diff --git a/store/requirements.txt b/store/requirements.txt index 6194abe1..456b432f 100644 --- a/store/requirements.txt +++ b/store/requirements.txt @@ -4,6 +4,7 @@ omegaconf bson pydantic +email-validator # AWS dependencies. aioboto3 @@ -11,6 +12,7 @@ aioboto3 # Crypto dependencies argon2-cffi pyjwt[asyncio] +bcrypt # FastAPI dependencies. aiohttp