templates/composer: Verify against mass sso and rh sso

This commit is contained in:
Sanne Raymaekers 2022-02-23 14:19:45 +01:00 committed by Ondřej Budai
parent 91d9417f5a
commit b05723a37e
6 changed files with 13 additions and 15 deletions

View file

@ -221,9 +221,6 @@ func (c *Composer) Start() error {
var err error
if c.config.Worker.EnableJWT {
keysURLs := c.config.Worker.JWTKeysURLs
if c.config.Worker.JWTKeysURL != "" {
keysURLs = append(keysURLs, c.config.Worker.JWTKeysURL)
}
handler, err = auth.BuildJWTAuthHandler(
keysURLs,
c.config.Worker.JWTKeysCA,
@ -270,9 +267,6 @@ func (c *Composer) Start() error {
var err error
if c.config.Koji.EnableJWT {
keysURLs := c.config.Koji.JWTKeysURLs
if c.config.Koji.JWTKeysURL != "" {
keysURLs = append(keysURLs, c.config.Koji.JWTKeysURL)
}
handler, err = auth.BuildJWTAuthHandler(
keysURLs,
c.config.Koji.JWTKeysCA,

View file

@ -24,7 +24,6 @@ type KojiAPIConfig struct {
EnableTLS bool `toml:"enable_tls"`
EnableMTLS bool `toml:"enable_mtls"`
EnableJWT bool `toml:"enable_jwt"`
JWTKeysURL string `toml:"jwt_keys_url"`
JWTKeysURLs []string `toml:"jwt_keys_urls"`
JWTKeysCA string `toml:"jwt_ca_file"`
JWTACLFile string `toml:"jwt_acl_file"`
@ -51,7 +50,6 @@ type WorkerAPIConfig struct {
EnableTLS bool `toml:"enable_tls"`
EnableMTLS bool `toml:"enable_mtls"`
EnableJWT bool `toml:"enable_jwt"`
JWTKeysURL string `toml:"jwt_keys_url"`
JWTKeysURLs []string `toml:"jwt_keys_urls"`
JWTKeysCA string `toml:"jwt_ca_file"`
JWTACLFile string `toml:"jwt_acl_file"`

View file

@ -86,7 +86,7 @@ func TestConfig(t *testing.T) {
require.Equal(t, "composer-db", config.Worker.PGDatabase)
require.False(t, config.Koji.EnableJWT)
require.Equal(t, "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs", config.Koji.JWTKeysURL)
require.Equal(t, []string{"https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs"}, config.Koji.JWTKeysURLs)
require.Equal(t, "", config.Koji.JWTKeysCA)
require.Equal(t, "/var/lib/osbuild-composer/acl", config.Koji.JWTACLFile)
}

View file

@ -2,7 +2,7 @@
allowed_domains = [ "osbuild.org" ]
ca = "/etc/osbuild-composer/ca-crt.pem"
enable_jwt = false
jwt_keys_url = "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs"
jwt_keys_urls = ["https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs"]
jwt_acl_file = "/var/lib/osbuild-composer/acl"
[worker]