MCPcopy Create free account
hub / github.com/prometheus/common / NewBasicAuthRoundTripper

Function NewBasicAuthRoundTripper

config/http_config.go:660–662  ·  view source on GitHub ↗

NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has already been set.

(username string, password Secret, usernameFile, passwordFile string, rt http.RoundTripper)

Source from the content-addressed store, hash-verified

658// NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has
659// already been set.
660func NewBasicAuthRoundTripper(username string, password Secret, usernameFile, passwordFile string, rt http.RoundTripper) http.RoundTripper {
661 return &basicAuthRoundTripper{username, password, usernameFile, passwordFile, rt}
662}
663
664func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
665 var username string

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected