Skip to content

Commit

Permalink
Don't add nil issuers to issuer pool
Browse files Browse the repository at this point in the history
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
  • Loading branch information
priyawadhwa committed Mar 13, 2023
1 parent d54c156 commit 42fdd12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/server/issuer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ import (
func NewIssuerPool(cfg *config.FulcioConfig) identity.IssuerPool {
var ip identity.IssuerPool
for _, i := range cfg.OIDCIssuers {
ip = append(ip, getIssuer("", i))
iss := getIssuer("", i)
if iss != nil {
ip = append(ip, iss)
}
}
for meta, i := range cfg.MetaIssuers {
ip = append(ip, getIssuer(meta, i))
iss := getIssuer(meta, i)
if iss != nil {
ip = append(ip, iss)
}
}
return ip
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/server/issuer_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func TestIssuerPool(t *testing.T) {
IssuerClaim: "$.federated_claims.connector_id",
Type: config.IssuerTypeEmail,
},
"https://custom.issuer.type": {
IssuerURL: "https://custom.issuer.type",
Type: "custom",
},
},
}
// Build the expected issuer pool
Expand Down

0 comments on commit 42fdd12

Please sign in to comment.