diff --git a/internal/config/config.go b/internal/config/config.go index 629a4bb..9453db6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -311,6 +311,10 @@ func (c *Config) Missing() []string { if !c.Enabled(comp) { continue } + // The playbook refuses Synapse's password providers once MAS does the logins. + if c.UsesMAS() && (comp.ID == "rest-auth" || comp.ID == "shared-secret-auth" || comp.ID == "ldap-auth" || comp.ID == "corporal") { + out = append(out, comp.Name+": doesn't work with MAS logins; untick one") + } if h := c.Values[comp.HostVar()]; h != "" && !ValidHost(h) { out = append(out, comp.Name+": address "+h+" isn't a hostname") } diff --git a/internal/config/missing_test.go b/internal/config/missing_test.go index 7f81f3b..4644ed6 100644 --- a/internal/config/missing_test.go +++ b/internal/config/missing_test.go @@ -18,3 +18,19 @@ func TestMissingFlagsInvalidExtraYAML(t *testing.T) { t.Fatalf("valid extra YAML reported: %v", m) } } + +// The playbook fails on a Synapse password provider next to MAS. +func TestMissingFlagsPasswordProviderWithMAS(t *testing.T) { + c := Default() + c.Domain = "example.org" + c.Components = map[string]bool{"mas": true, "ldap-auth": true} + c.Values["matrix_synapse_ext_password_provider_ldap_uri"] = "ldap://ldap.example.org" + c.Values["matrix_synapse_ext_password_provider_ldap_base"] = "dc=example,dc=org" + if got := strings.Join(c.Missing(), "\n"); !strings.Contains(got, "doesn't work with MAS logins") { + t.Fatalf("LDAP next to MAS not reported: %q", got) + } + c.Components["mas"] = false + if m := c.Missing(); len(m) != 0 { + t.Fatalf("LDAP without MAS reported: %v", m) + } +} diff --git a/internal/ui/shot_test.go b/internal/ui/shot_test.go index de8e3dc..9b4d2cb 100644 --- a/internal/ui/shot_test.go +++ b/internal/ui/shot_test.go @@ -66,7 +66,7 @@ func TestShot(t *testing.T) { for i, ids := range [][]string{ {"coturn", "exim", "ddclient"}, {"element", "cinny", "sable", "fluffychat"}, - {"mas", "ketesa", "shared-secret-auth", "ldap-auth"}, + {"uvs", "mas", "ketesa", "element-admin"}, {"s3-provider"}, {"double-puppet", "bridges-e2ee", "telegram", "whatsapp", "signal", "postmoogle"}, {"reminder-bot", "honoroit", "baibot", "draupnir"},