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

Function NewAuthorizationCredentialsFileRoundTripper

config/http_config.go:625–627  ·  view source on GitHub ↗

NewAuthorizationCredentialsFileRoundTripper adds the authorization credentials read from the provided file to a request unless the authorization header has already been set. This file is read for every request.

(authType, authCredentialsFile string, rt http.RoundTripper)

Source from the content-addressed store, hash-verified

623// credentials read from the provided file to a request unless the authorization
624// header has already been set. This file is read for every request.
625func NewAuthorizationCredentialsFileRoundTripper(authType, authCredentialsFile string, rt http.RoundTripper) http.RoundTripper {
626 return &authorizationCredentialsFileRoundTripper{authType, authCredentialsFile, rt}
627}
628
629func (rt *authorizationCredentialsFileRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
630 if len(req.Header.Get("Authorization")) == 0 {

Callers 2

Calls

no outgoing calls

Tested by 1