Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/http_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,12 @@ func (rt *oauth2RoundTripper) RoundTrip(req *http.Request) (*http.Response, erro
needsInit bool
)

// This should not happen when config goes through the normal Prometheus
// validation path, but guard against a nil credential to avoid a panic.
if rt.oauthCredential == nil {
return nil, errors.New("oauth2 client secret is required")
}

rt.mtx.RLock()
secret = rt.lastSecret
needsInit = rt.lastRT.Source == nil
Expand Down
Loading