Make settings secret

Requires: abstractions module.

By default settings are subject to logging, which is generally not appropriate for secrets. This can be fixed either by disabling logging entirely on the configuration provider or by annotating fields and properties of the model with [Secret] attribute:

class MySettings 
{
    [Secret]
    public MySecrets Secrets { get; } = new MySecrets();
    
    public TimeSpan Timeout { get; } = TimeSpan.FromSeconds(30);
    
    [Secret]
    public string EncryptionKey { get; }
}

class MySecrets 
{
    public string ApiKey { get; }
    public string Login { get; }
    public string Password { get; }
}
pageLog settings updatespageLog errors

Last updated