diff --git a/internal/config/settings/helpers.go b/internal/config/settings/helpers.go index 444030f7..9ffe8b47 100644 --- a/internal/config/settings/helpers.go +++ b/internal/config/settings/helpers.go @@ -4,10 +4,6 @@ func andStrings(strings []string) (result string) { return joinStrings(strings, "and") } -func orStrings(strings []string) (result string) { - return joinStrings(strings, "or") -} - func joinStrings(strings []string, lastJoin string) (result string) { if len(strings) == 0 { return "" diff --git a/internal/config/settings/validation.go b/internal/config/settings/validation.go index a97c2d6d..4fa7020e 100644 --- a/internal/config/settings/validation.go +++ b/internal/config/settings/validation.go @@ -41,23 +41,10 @@ func checkListeningAddress(address string) (err error) { } func checkProviderNames(providerNames []string) (err error) { - allProviders := provider.All() - allProviderNames := make([]string, len(allProviders)) - for i, provider := range allProviders { - allProviderNames[i] = provider.Name - } - for _, providerName := range providerNames { - valid := false - for _, acceptedProviderName := range allProviderNames { - if strings.EqualFold(providerName, acceptedProviderName) { - valid = true - break - } - } - if !valid { - return fmt.Errorf("%w: %q must be one of: %s", - ErrValueNotOneOf, providerName, orStrings(allProviderNames)) + _, err := provider.Parse(providerName) + if err != nil { + return fmt.Errorf("parsing provider: %w", err) } }