Skip to content

Commit

Permalink
Do not block startup if OIDC provider cannot be created
Browse files Browse the repository at this point in the history
Fixes #1358

If a provider is down, this will prevent the service from starting. We
now log an error if the provider is down. The service will try to fetch
the provider during the next request where that provider is needed.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
  • Loading branch information
haydentherapper committed Oct 3, 2023
1 parent aedb400 commit 5d3367d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ func (fc *FulcioConfig) prepare() error {
defer cancel()
provider, err := oidc.NewProvider(ctx, iss.IssuerURL)
if err != nil {
return fmt.Errorf("provider %s: %w", iss.IssuerURL, err)
log.Logger.Errorf("error creating provider for issuer URL %q: %v", iss.IssuerURL, err)
} else {
cfg := &oidc.Config{ClientID: iss.ClientID}
fc.verifiers[iss.IssuerURL] = []*verifierWithConfig{{provider.Verifier(cfg), cfg}}
}
cfg := &oidc.Config{ClientID: iss.ClientID}
fc.verifiers[iss.IssuerURL] = []*verifierWithConfig{{provider.Verifier(cfg), cfg}}
}

cache, err := lru.New2Q(100 /* size */)
Expand Down

0 comments on commit 5d3367d

Please sign in to comment.