Enable SSO in CI.

This commit is contained in:
Tommie Gannert 2022-05-27 19:30:30 +02:00
parent ac706be242
commit 80fa0bcb4c
2 changed files with 28 additions and 5 deletions

View file

@ -82,6 +82,27 @@ func main() {
if *defaultsForCI { if *defaultsForCI {
cfg.AppServiceAPI.DisableTLSValidation = true cfg.AppServiceAPI.DisableTLSValidation = true
cfg.ClientAPI.RateLimiting.Enabled = false cfg.ClientAPI.RateLimiting.Enabled = false
cfg.ClientAPI.Login.SSO.Enabled = true
cfg.ClientAPI.Login.SSO.Providers = []config.IdentityProvider{
{
ID: "github",
Name: "Fake GitHub",
OIDC: config.OIDC{
ClientID: "aclientid",
ClientSecret: "aclientsecret",
},
},
{
ID: "google",
Name: "Fake Google",
Type: "oidc",
OIDC: config.OIDC{
ClientID: "aclientid",
ClientSecret: "aclientsecret",
DiscoveryURL: "https://accounts.google.com/.well-known/openid-configuration",
},
},
}
cfg.FederationAPI.DisableTLSValidation = false cfg.FederationAPI.DisableTLSValidation = false
// don't hit matrix.org when running tests!!! // don't hit matrix.org when running tests!!!
cfg.FederationAPI.KeyPerspectives = config.KeyPerspectives{} cfg.FederationAPI.KeyPerspectives = config.KeyPerspectives{}

View file

@ -180,11 +180,13 @@ type IdentityProvider struct {
Type IdentityProviderType `yaml:"type"` Type IdentityProviderType `yaml:"type"`
// OIDC contains settings for providers based on OpenID Connect (OAuth 2). // OIDC contains settings for providers based on OpenID Connect (OAuth 2).
OIDC struct { OIDC OIDC `yaml:"oidc"`
ClientID string `yaml:"client_id"` }
ClientSecret string `yaml:"client_secret"`
DiscoveryURL string `yaml:"discovery_url"` type OIDC struct {
} `yaml:"oidc"` ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
DiscoveryURL string `yaml:"discovery_url"`
} }
func (idp *IdentityProvider) Verify(configErrs *ConfigErrors) { func (idp *IdentityProvider) Verify(configErrs *ConfigErrors) {