settings
All configuration via environment.
Take note of the environment variable prefixes required for each
settings class, except AppSettings.
APISettings ¶
Bases: BaseSettings
API specific configuration.
CACHE_EXPIRATION
class-attribute
¶
Default cache key expiration in seconds.
DB_SESSION_DEPENDENCY_KEY
class-attribute
¶
Parameter name for SQLAlchemy session dependency injection.
DEFAULT_PAGINATION_LIMIT
class-attribute
¶
Max records received for collection routes.
DTO_INFO_KEY
class-attribute
¶
Key used for DTO field config in SQLAlchemy info dict.
HEALTH_PATH
class-attribute
¶
Route that the health check is served under.
AppSettings ¶
Bases: BaseSettings
Generic application settings.
These settings are returned as json by the healthcheck endpoint, so
do not include any sensitive values here, or if you do ensure to
exclude them from serialization in the Config object.
DatabaseSettings ¶
LogSettings ¶
Bases: BaseSettings
Logging config for the application.
EXCLUDE_PATHS
class-attribute
¶
Regex to exclude paths from logging.
HTTP_EVENT
class-attribute
¶
Log event name for logs from Starlite handlers.
INCLUDE_COMPRESSED_BODY
class-attribute
¶
Include 'body' of compressed responses in log output.
JOB_FIELDS
class-attribute
¶
JOB_FIELDS: list[str] = [
"function",
"kwargs",
"key",
"scheduled",
"attempts",
"completed",
"queued",
"started",
"result",
"error",
]
Attributes of the SAQ Job
to be logged.
OBFUSCATE_COOKIES
class-attribute
¶
Request cookie keys to obfuscate.
OBFUSCATE_HEADERS
class-attribute
¶
Request header keys to obfuscate.
REQUEST_FIELDS
class-attribute
¶
REQUEST_FIELDS: list[RequestExtractorField] = [
"path",
"method",
"content_type",
"headers",
"cookies",
"query",
"path_params",
"body",
]
Attributes of the Request to be logged.
UVICORN_ACCESS_LEVEL
class-attribute
¶
Level to log uvicorn access logs.
UVICORN_ERROR_LEVEL
class-attribute
¶
Level to log uvicorn error logs.
WORKER_EVENT
class-attribute
¶
Log event name for logs from SAQ worker.
OpenAPISettings ¶
Bases: BaseSettings
Configures OpenAPI for the application.
CONTACT_EMAIL
class-attribute
¶
Email for contact on document.
RedisSettings ¶
Bases: BaseSettings
Redis settings for the application.
URL
class-attribute
¶
A Redis connection URL.