move generic secret errors to shared, fix edgecase in cli flags

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-04-29 11:15:13 +02:00
parent d86a86a884
commit 72688b3650
12 changed files with 53 additions and 25 deletions
@@ -2,11 +2,11 @@ package parser
import (
"errors"
"fmt"
"github.com/owncloud/ocis/extensions/sharing/pkg/config"
"github.com/owncloud/ocis/extensions/sharing/pkg/config/defaults"
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/owncloud/ocis/ocis-pkg/config/envdecode"
)
@@ -35,11 +35,11 @@ func ParseConfig(cfg *config.Config) error {
func Validate(cfg *config.Config) error {
if cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey == "" {
return fmt.Errorf("machine auth api key for the cs3 public sharing driver is not set up properly, bailing out (%s)", cfg.Service.Name)
return shared.MissingMachineAuthApiKeyError(cfg.Service.Name)
}
if cfg.UserSharingDrivers.CS3.MachineAuthAPIKey == "" {
return fmt.Errorf("machine auth api key for the cs3 user sharing driver is not set up properly, bailing out (%s)", cfg.Service.Name)
return shared.MissingMachineAuthApiKeyError(cfg.Service.Name)
}
return nil