Skip to content

secretconfig

AttrDict for specifying user credentials or secrets.

TogglableSecretStr = Annotated[SecretStr, PlainSerializer(lambda value: value.get_secret_value() if settings.expose_secrets else str(value), return_type=str, when_used='json-unless-none')] module-attribute

Annotated type alias for a secret string that can be toggled to be exposed or not.

SecretConfig

Bases: BaseModel

Simple model for handling secret in other config-models.

Source code in oteapi/models/secretconfig.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class SecretConfig(BaseModel):
    """Simple model for handling secret in other config-models."""

    user: Optional[TogglableSecretStr] = Field(
        None, description="User name for authentication."
    )
    password: Optional[TogglableSecretStr] = Field(
        None, description="Password for authentication."
    )
    token: Optional[TogglableSecretStr] = Field(
        None,
        description=(
            "An access token for providing access and meta data to an application."
        ),
    )
    client_id: Optional[TogglableSecretStr] = Field(
        None, description="Client ID for an OAUTH2 client."
    )
    client_secret: Optional[TogglableSecretStr] = Field(
        None, description="Client secret for an OAUTH2 client."
    )

client_id: Optional[TogglableSecretStr] = Field(None, description='Client ID for an OAUTH2 client.') class-attribute instance-attribute

client_secret: Optional[TogglableSecretStr] = Field(None, description='Client secret for an OAUTH2 client.') class-attribute instance-attribute

password: Optional[TogglableSecretStr] = Field(None, description='Password for authentication.') class-attribute instance-attribute

token: Optional[TogglableSecretStr] = Field(None, description='An access token for providing access and meta data to an application.') class-attribute instance-attribute

user: Optional[TogglableSecretStr] = Field(None, description='User name for authentication.') class-attribute instance-attribute