| 243 | } |
| 244 | |
| 245 | func plainHttpClientFunc(ios *iostreams.IOStreams, appVersion string, invokingAgent string, telemetryDisabler ghtelemetry.Disabler) func() (*http.Client, error) { |
| 246 | return func() (*http.Client, error) { |
| 247 | opts := api.HTTPClientOptions{ |
| 248 | Log: ios.ErrOut, |
| 249 | LogColorize: ios.ColorEnabled(), |
| 250 | AppVersion: appVersion, |
| 251 | InvokingAgent: invokingAgent, |
| 252 | // This is required to prevent automatic setting of auth and other headers. |
| 253 | SkipDefaultHeaders: true, |
| 254 | TelemetryDisabler: telemetryDisabler, |
| 255 | } |
| 256 | client, err := api.NewHTTPClient(opts) |
| 257 | if err != nil { |
| 258 | return nil, err |
| 259 | } |
| 260 | return client, nil |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | // configWithTokenRefresher returns a config accessor that injects the OAuth token refresher into the AuthConfig the |
| 265 | // first time the configuration is resolved, so refreshable credentials can be renewed during ordinary commands. The |