Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Jun 3, 2024
1 parent eab4c8a commit d7b19f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion store/app/api/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from botocore.exceptions import ClientError
from redis import Redis
from types_aiobotocore_dynamodb.service_resource import DynamoDBServiceResource

from store.settings import settings

logger = logging.getLogger(__name__)
Expand All @@ -32,7 +33,9 @@ async def __aenter__(self) -> Self:
db = await db.__aenter__()
self.__db = db

self.kv = Redis(host = settings.redis.host, password=settings.redis.password, port=settings.redis.port, db=settings.redis.db)
self.kv = Redis(
host=settings.redis.host, password=settings.redis.password, port=settings.redis.port, db=settings.redis.db
)
return self

async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: # noqa: ANN401
Expand Down
1 change: 1 addition & 0 deletions store/app/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def from_uuid(cls, user_id: uuid.UUID, email: str) -> "User":
def to_uuid(self) -> uuid.UUID:
return uuid.UUID(self.user_id)


# Stored in Redis rather than DynamoDB
class ApiKey(BaseModel):
api_key_hash: str # Primary key
Expand Down
1 change: 1 addition & 0 deletions store/app/api/routers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ async def get_login_response(email: str, lifetime: int, crud: Crud) -> UserLogin
Args:
email: The validated email of the user.
crud: The database CRUD object.
lifetime: The lifetime (in seconds) of the API key to be returned.
Returns:
The API key for the user.
Expand Down
2 changes: 2 additions & 0 deletions store/settings/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

from omegaconf import MISSING


@dataclass
class RedisSettings:
host: str = field(default=MISSING)
password: str = field(default=MISSING)
port: int = field(default=6379)
db: int = field(default=0)


@dataclass
class CryptoSettings:
expire_token_minutes: int = field(default=10)
Expand Down

0 comments on commit d7b19f6

Please sign in to comment.