Settings
Settings API endpoints.
get_settings(service, current_user)
async
List all settings with secrets masked.
This endpoint ensures default settings exist (self-healing) and returns all settings. Secrets are masked with asterisks for security. Logged in users only.
Parameters:
-
service(Annotated[SettingsService, Depends(get_settings_service)]) –The settings service instance.
-
current_user(Annotated[User, Depends(get_current_user)]) –The currently authenticated user.
Returns:
-
List[SettingResponse]–List[SettingResponse]: A list of settings with masked secret values.
Raises:
-
TechnicalError–If there is an error fetching the settings.
Source code in app/api/v1/endpoints/settings.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
update_settings(settings_in, service, current_admin)
async
Batch update settings.
This endpoint allows administrators to update multiple settings at once. Secrets in the response are masked.
Parameters:
-
settings_in(List[SettingUpdate]) –A list of settings to update.
-
service(Annotated[SettingsService, Depends(get_settings_service)]) –The settings service instance.
-
current_admin(Annotated[User, Depends(get_current_admin)]) –The currently authenticated administrator.
Returns:
-
List[SettingResponse]–List[SettingResponse]: A list of the updated settings with masked secret values.
Raises:
-
TechnicalError–If there is an error updating the settings.
Source code in app/api/v1/endpoints/settings.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |