23 lines
741 B
Go
23 lines
741 B
Go
package config
|
|
|
|
import "testing"
|
|
|
|
func TestCustodyBootstrapNativeLoader(t *testing.T) {
|
|
cfg, err := Load("../../bootstrap-fixture.json")
|
|
if err != nil {
|
|
t.Fatal("bootstrap output failed native config parsing")
|
|
}
|
|
if cfg.PrivacyIDEA.AdminToken != "" || cfg.PrivacyIDEA.AdminTokenFile != "/etc/keycape-factor/admin-token" {
|
|
t.Fatal("credential source mismatch")
|
|
}
|
|
if cfg.PrivacyIDEA.Realm != "coulomb" || !cfg.PrivacyIDEA.RequireForAll {
|
|
t.Fatal("factor policy mismatch")
|
|
}
|
|
clients, err := cfg.Registrations()
|
|
if err != nil || len(clients) != 5 {
|
|
t.Fatal("bootstrap registrations did not survive parsing")
|
|
}
|
|
if cfg.LLDAP.BindPW == "" || cfg.Authelia.ClientSecret == "" {
|
|
t.Fatal("bootstrap credential fields missing")
|
|
}
|
|
}
|