mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-05 02:20:28 -05:00
move config validation into a separate function
This commit is contained in:
@@ -2,6 +2,7 @@ package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/proxy/pkg/config"
|
||||
"github.com/owncloud/ocis/extensions/proxy/pkg/config/defaults"
|
||||
@@ -28,5 +29,13 @@ func ParseConfig(cfg *config.Config) error {
|
||||
|
||||
defaults.Sanitize(cfg)
|
||||
|
||||
return Validate(cfg)
|
||||
}
|
||||
|
||||
func Validate(cfg *config.Config) error {
|
||||
if cfg.MachineAuthAPIKey == "" {
|
||||
return fmt.Errorf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user