feat: update desc
This commit is contained in:
@@ -247,12 +247,8 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
s3_rel_path = self.VAULT_S3_SECRET_PATH.strip()
|
s3_rel_path = self.VAULT_S3_SECRET_PATH.strip()
|
||||||
if s3_rel_path:
|
if s3_rel_path:
|
||||||
try:
|
s3_secret_data = client.read_secret_optional(s3_rel_path)
|
||||||
s3_secret_data = client.read_secret(s3_rel_path)
|
if s3_secret_data:
|
||||||
except Exception as exc:
|
|
||||||
raise ValueError(
|
|
||||||
f'Vault S3 secret not readable at mount {self.VAULT_MOUNT_POINT}/{s3_rel_path}: {exc!r}'
|
|
||||||
) from exc
|
|
||||||
self._apply_s3_from_vault_secret(s3_secret_data)
|
self._apply_s3_from_vault_secret(s3_secret_data)
|
||||||
|
|
||||||
if not self.DATABASE_URL:
|
if not self.DATABASE_URL:
|
||||||
|
|||||||
@@ -80,119 +80,119 @@ async def set_avatar(
|
|||||||
pub = me_user_public(user)
|
pub = me_user_public(user)
|
||||||
return SetAvatarPublicResponse(**pub.model_dump(), webp_size_bytes=webp_size)
|
return SetAvatarPublicResponse(**pub.model_dump(), webp_size_bytes=webp_size)
|
||||||
|
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/encrypted-mnemonic/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/encrypted-mnemonic/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def encrypted_mnemonic_start(
|
# async def encrypted_mnemonic_start(
|
||||||
request: Request,
|
# request: Request,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: SetEncryptedMnemonicStartCommand = Depends(get_set_encrypted_mnemonic_start_command),
|
# command: SetEncryptedMnemonicStartCommand = Depends(get_set_encrypted_mnemonic_start_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id)
|
# result = await command(user_id=auth.user_id)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/encrypted-mnemonic/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/encrypted-mnemonic/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def encrypted_mnemonic_complete(
|
# async def encrypted_mnemonic_complete(
|
||||||
request: Request,
|
# request: Request,
|
||||||
body: EncryptedMnemonicConfirmRequest,
|
# body: EncryptedMnemonicConfirmRequest,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: SetEncryptedMnemonicCompleteCommand = Depends(get_set_encrypted_mnemonic_complete_command),
|
# command: SetEncryptedMnemonicCompleteCommand = Depends(get_set_encrypted_mnemonic_complete_command),
|
||||||
):
|
# ):
|
||||||
user = await command(
|
# user = await command(
|
||||||
user_id=auth.user_id,
|
# user_id=auth.user_id,
|
||||||
code=body.code,
|
# code=body.code,
|
||||||
encrypted_mnemonic=body.encrypted_mnemonic,
|
# encrypted_mnemonic=body.encrypted_mnemonic,
|
||||||
)
|
# )
|
||||||
return {'encrypted_mnemonic': user.encrypted_mnemonic}
|
# return {'encrypted_mnemonic': user.encrypted_mnemonic}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/email/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/email/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def change_email_start(
|
# async def change_email_start(
|
||||||
request: Request,
|
# request: Request,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: ChangeEmailStartCommand = Depends(get_change_email_start_command),
|
# command: ChangeEmailStartCommand = Depends(get_change_email_start_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id)
|
# result = await command(user_id=auth.user_id)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/email/confirm-old', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/email/confirm-old', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def change_email_confirm_old(
|
# async def change_email_confirm_old(
|
||||||
request: Request,
|
# request: Request,
|
||||||
body: ChangeEmailConfirmOldRequest,
|
# body: ChangeEmailConfirmOldRequest,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: ChangeEmailConfirmOldCommand = Depends(get_change_email_confirm_old_command),
|
# command: ChangeEmailConfirmOldCommand = Depends(get_change_email_confirm_old_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id, code=body.code, new_email=body.new_email)
|
# result = await command(user_id=auth.user_id, code=body.code, new_email=body.new_email)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/email/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/email/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def change_email_complete(
|
# async def change_email_complete(
|
||||||
request: Request,
|
# request: Request,
|
||||||
body: ChangeEmailCompleteRequest,
|
# body: ChangeEmailCompleteRequest,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: ChangeEmailCompleteCommand = Depends(get_change_email_complete_command),
|
# command: ChangeEmailCompleteCommand = Depends(get_change_email_complete_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id, code=body.code)
|
# result = await command(user_id=auth.user_id, code=body.code)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/password/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/password/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def change_password_start(
|
# async def change_password_start(
|
||||||
request: Request,
|
# request: Request,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: ChangePasswordStartCommand = Depends(get_change_password_start_command),
|
# command: ChangePasswordStartCommand = Depends(get_change_password_start_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id)
|
# result = await command(user_id=auth.user_id)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/password/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/password/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def change_password_complete(
|
# async def change_password_complete(
|
||||||
request: Request,
|
# request: Request,
|
||||||
body: ChangePasswordConfirmRequest,
|
# body: ChangePasswordConfirmRequest,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: ChangePasswordCompleteCommand = Depends(get_change_password_complete_command),
|
# command: ChangePasswordCompleteCommand = Depends(get_change_password_complete_command),
|
||||||
):
|
# ):
|
||||||
result = await command(
|
# result = await command(
|
||||||
user_id=auth.user_id,
|
# user_id=auth.user_id,
|
||||||
code=body.code,
|
# code=body.code,
|
||||||
new_password=body.new_password,
|
# new_password=body.new_password,
|
||||||
confirm_password=body.confirm_password,
|
# confirm_password=body.confirm_password,
|
||||||
)
|
# )
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/bank/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/bank/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def bank_details_start(
|
# async def bank_details_start(
|
||||||
request: Request,
|
# request: Request,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: UpdateBankDetailsStartCommand = Depends(get_update_bank_details_start_command),
|
# command: UpdateBankDetailsStartCommand = Depends(get_update_bank_details_start_command),
|
||||||
):
|
# ):
|
||||||
result = await command(user_id=auth.user_id)
|
# result = await command(user_id=auth.user_id)
|
||||||
return {'success': result}
|
# return {'success': result}
|
||||||
|
#
|
||||||
|
#
|
||||||
@account_settings_router.post(path='/bank/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
# @account_settings_router.post(path='/bank/complete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||||
async def bank_details_complete(
|
# async def bank_details_complete(
|
||||||
request: Request,
|
# request: Request,
|
||||||
body: BankConfirmRequest,
|
# body: BankConfirmRequest,
|
||||||
auth: AuthContext = Depends(require_access_token),
|
# auth: AuthContext = Depends(require_access_token),
|
||||||
command: UpdateBankDetailsCompleteCommand = Depends(get_update_bank_details_complete_command),
|
# command: UpdateBankDetailsCompleteCommand = Depends(get_update_bank_details_complete_command),
|
||||||
):
|
# ):
|
||||||
user = await command(
|
# user = await command(
|
||||||
user_id=auth.user_id,
|
# user_id=auth.user_id,
|
||||||
code=body.code,
|
# code=body.code,
|
||||||
passport_data=body.passport_data,
|
# passport_data=body.passport_data,
|
||||||
inn=body.inn,
|
# inn=body.inn,
|
||||||
erc20=body.erc20,
|
# erc20=body.erc20,
|
||||||
)
|
# )
|
||||||
return ORJSONResponse(
|
# return ORJSONResponse(
|
||||||
status_code=status.HTTP_200_OK,
|
# status_code=status.HTTP_200_OK,
|
||||||
content={
|
# content={
|
||||||
'passport_data': user.passport_data,
|
# 'passport_data': user.passport_data,
|
||||||
'inn': user.inn,
|
# 'inn': user.inn,
|
||||||
'erc20': user.erc20,
|
# 'erc20': user.erc20,
|
||||||
},
|
# },
|
||||||
)
|
# )
|
||||||
|
|||||||
Reference in New Issue
Block a user