MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Make

Method Make

api/cloudcontroller/wrapper/uaa_authentication.go:52–65  ·  view source on GitHub ↗

Make adds authentication headers to the passed in request and then calls the wrapped connection's Make. If the client is not set on the wrapper, it will not add any header or handle any authentication errors.

(request *cloudcontroller.Request, passedResponse *cloudcontroller.Response)

Source from the content-addressed store, hash-verified

50// wrapped connection's Make. If the client is not set on the wrapper, it will
51// not add any header or handle any authentication errors.
52func (t *UAAAuthentication) Make(request *cloudcontroller.Request, passedResponse *cloudcontroller.Response) error {
53 if request.Header.Get("Authorization") == "" && (t.cache.AccessToken() != "" || t.cache.RefreshToken() != "") {
54 // assert a valid access token for authenticated requests
55 err := t.refreshTokenIfNecessary(t.cache.AccessToken())
56 if nil != err {
57 return err
58 }
59
60 request.Header.Set("Authorization", t.cache.AccessToken())
61 }
62
63 err := t.connection.Make(request, passedResponse)
64 return err
65}
66
67// SetClient sets the UAA client that the wrapper will use.
68func (t *UAAAuthentication) SetClient(client UAAClient) {

Callers

nothing calls this directly

Calls 6

GetMethod · 0.65
AccessTokenMethod · 0.65
RefreshTokenMethod · 0.65
SetMethod · 0.65
MakeMethod · 0.65

Tested by

no test coverage detected