Skip to content

settings

BaseSettings for oteapi-core. This configuration/settings-class is intended to be incorporated as a parentclass into the configuration of an FastAPI application. See https://fastapi.tiangolo.com/advanced/settings/ as reference.

Otherwise, check https://github.com/EMMC-ASBL/oteapi-services/blob/master/app/main.py for a direct example of an inclusion of the OTE api and its settings into an FastAPI instance.

OteApiCoreSettings

Bases: BaseSettings

Basic configuration for the oteapi-core.

Source code in oteapi/settings.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class OteApiCoreSettings(BaseSettings):
    """Basic configuration for the oteapi-core."""

    expose_secrets: bool = Field(
        False,
        description="Whether `SecretStr` in `pydantic` should be exposed or not.\n\n"
        "!!! warning\n"
        "    Depending on the configuration and user management of the services"
        "    using oteapi-core, secrets might be readable by other users when serialized!"
        "    This especially takes place when then models and configs are put into the cache."
        "    Hence be careful while using this option in production.",
    )

    class Config:
        """Pydantic config for the OteApiCoreSettings."""

        env_prefix = "OTEAPI_"

Config

Pydantic config for the OteApiCoreSettings.

Source code in oteapi/settings.py
25
26
27
28
class Config:
    """Pydantic config for the OteApiCoreSettings."""

    env_prefix = "OTEAPI_"