fix: s3 update

This commit is contained in:
2026-05-17 14:46:57 +03:00
parent e4369df0d8
commit 6f6d10567e
2 changed files with 5 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ class Settings(BaseSettings):
S3_SECRET_ACCESS_KEY: str = '' S3_SECRET_ACCESS_KEY: str = ''
S3_ENDPOINT_URL: str = '' S3_ENDPOINT_URL: str = ''
S3_PUBLIC_BASE_URL: str = '' S3_PUBLIC_BASE_URL: str = ''
S3_REGRU_PUBLIC_WEBSITE_HOST: bool = True S3_REGRU_PUBLIC_WEBSITE_HOST: bool = False
S3_AVATAR_KEY_PREFIX: str = 'avatars' S3_AVATAR_KEY_PREFIX: str = 'avatars'
LOG_LEVEL: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO' LOG_LEVEL: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO'
@@ -116,7 +116,7 @@ class Settings(BaseSettings):
object.__setattr__(self, 'S3_ENDPOINT_URL', '') object.__setattr__(self, 'S3_ENDPOINT_URL', '')
object.__setattr__(self, 'S3_PUBLIC_BASE_URL', '') object.__setattr__(self, 'S3_PUBLIC_BASE_URL', '')
object.__setattr__(self, 'S3_REGION', 'us-east-1') object.__setattr__(self, 'S3_REGION', 'us-east-1')
object.__setattr__(self, 'S3_REGRU_PUBLIC_WEBSITE_HOST', True) object.__setattr__(self, 'S3_REGRU_PUBLIC_WEBSITE_HOST', False)
object.__setattr__(self, 'S3_AVATAR_KEY_PREFIX', 'avatars') object.__setattr__(self, 'S3_AVATAR_KEY_PREFIX', 'avatars')
@staticmethod @staticmethod

View File

@@ -3,7 +3,7 @@ from fastapi.responses import ORJSONResponse
from starlette import status from starlette import status
from src.application.commands import SetPhoneCommand, SetAvatarCommand from src.application.commands import SetPhoneCommand, SetAvatarCommand
from src.application.domain.dto import AuthContext from src.application.domain.dto import AuthContext
from src.presentation.decorators import require_access_token from src.presentation.decorators import require_access_token, csrf_protect
from src.presentation.dependencies import ( from src.presentation.dependencies import (
get_set_avatar_command, get_set_avatar_command,
get_set_phone_command, get_set_phone_command,
@@ -46,6 +46,7 @@ _SET_AVATAR_ERROR_RESPONSES: dict[int, dict[str, object]] = {
@account_settings_router.patch(path='/phone', response_class=ORJSONResponse, status_code=status.HTTP_200_OK) @account_settings_router.patch(path='/phone', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
@csrf_protect()
async def set_phone( async def set_phone(
request: Request, request: Request,
body: SetPhoneRequest, body: SetPhoneRequest,
@@ -70,6 +71,7 @@ async def set_phone(
), ),
responses=_SET_AVATAR_ERROR_RESPONSES, responses=_SET_AVATAR_ERROR_RESPONSES,
) )
@csrf_protect()
async def set_avatar( async def set_avatar(
request: Request, request: Request,
body: SetAvatarRequest, body: SetAvatarRequest,