MCPcopy
hub / github.com/cloudfoundry/cli / newWrappedUAAClient

Function newWrappedUAAClient

command/v7/shared/new_clients.go:75–98  ·  view source on GitHub ↗
(config command.Config, ui command.UI)

Source from the content-addressed store, hash-verified

73}
74
75func newWrappedUAAClient(config command.Config, ui command.UI) (*uaa.Client, error) {
76 var err error
77 verbose, location := config.Verbose()
78
79 uaaClient := uaa.NewClient(config)
80 if verbose {
81 uaaClient.WrapConnection(uaaWrapper.NewRequestLogger(ui.RequestLoggerTerminalDisplay()))
82 }
83 if location != nil {
84 uaaClient.WrapConnection(uaaWrapper.NewRequestLogger(ui.RequestLoggerFileWriter(location)))
85 }
86
87 uaaAuthWrapper := uaaWrapper.NewUAAAuthentication(uaaClient, config)
88 uaaClient.WrapConnection(uaaAuthWrapper)
89 uaaClient.WrapConnection(uaaWrapper.NewUAATraceHeaderRequest(config.B3TraceID()))
90 uaaClient.WrapConnection(uaaWrapper.NewRetryRequest(config.RequestRetryCount()))
91
92 err = uaaClient.SetupResources(config.UAAEndpoint(), config.AuthorizationEndpoint())
93 if err != nil {
94 return nil, err
95 }
96
97 return uaaClient, nil
98}
99
100func newWrappedRoutingClient(config command.Config, ui command.UI, uaaClient *uaa.Client) (*router.Client, error) {
101 routingConfig := router.Config{

Callers 1

Calls 10

WrapConnectionMethod · 0.95
SetupResourcesMethod · 0.95
NewClientFunction · 0.92
VerboseMethod · 0.65
B3TraceIDMethod · 0.65
RequestRetryCountMethod · 0.65
UAAEndpointMethod · 0.65
AuthorizationEndpointMethod · 0.65

Tested by

no test coverage detected