set generate ldap secrets

This commit is contained in:
Willy Kloucek
2022-04-27 17:00:31 +02:00
parent a37126f523
commit 4043f181b1
13 changed files with 145 additions and 127 deletions
@@ -1,6 +1,8 @@
package defaults
import (
"log"
"github.com/owncloud/ocis/extensions/auth-machine/pkg/config"
)
@@ -31,11 +33,6 @@ func DefaultConfig() *config.Config {
Address: "127.0.0.1:9142",
},
AuthProvider: "ldap",
AuthProviders: config.AuthProviders{
Machine: config.MachineProvider{
APIKey: "change-me-please",
},
},
}
}
@@ -78,6 +75,12 @@ func EnsureDefaults(cfg *config.Config) {
} else if cfg.TokenManager == nil {
cfg.TokenManager = &config.TokenManager{}
}
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
} else if cfg.MachineAuthAPIKey == "" {
log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
}
}
func Sanitize(cfg *config.Config) {