2021-03-22 16:04:09 +07:00
|
|
|
package configuration
|
|
|
|
|
2021-08-03 16:55:21 +07:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DefaultEnvPrefix is the default environment prefix.
|
|
|
|
const DefaultEnvPrefix = "AUTHELIA_"
|
|
|
|
|
|
|
|
// DefaultEnvDelimiter is the default environment delimiter.
|
|
|
|
const DefaultEnvDelimiter = "_"
|
|
|
|
|
|
|
|
const (
|
|
|
|
constSecretSuffix = "_FILE"
|
|
|
|
|
|
|
|
constDelimiter = "."
|
|
|
|
|
|
|
|
constWindows = "windows"
|
|
|
|
)
|
|
|
|
|
2022-04-03 19:44:52 +07:00
|
|
|
var (
|
|
|
|
errNoValidator = errors.New("no validator provided")
|
|
|
|
errNoSources = errors.New("no sources provided")
|
|
|
|
|
|
|
|
errDecodeNonPtrMustHaveValue = errors.New("must have a non-empty value")
|
|
|
|
)
|
|
|
|
|
2021-08-03 16:55:21 +07:00
|
|
|
const (
|
|
|
|
errFmtSecretAlreadyDefined = "secrets: error loading secret into key '%s': it's already defined in other " +
|
|
|
|
"configuration sources"
|
|
|
|
errFmtSecretIOIssue = "secrets: error loading secret path %s into key '%s': %v"
|
|
|
|
errFmtGenerateConfiguration = "error occurred generating configuration: %+v"
|
2022-04-03 19:44:52 +07:00
|
|
|
|
|
|
|
errFmtDecodeHookCouldNotParse = "could not decode '%s' to a %s: %w"
|
|
|
|
errFmtDecodeHookCouldNotParseEmptyValue = "could not decode an empty value to a %s: %w"
|
2021-08-03 16:55:21 +07:00
|
|
|
)
|
|
|
|
|
|
|
|
var secretSuffixes = []string{"key", "secret", "password", "token"}
|