| 257 | } |
| 258 | |
| 259 | func plainHttpClientFunc(ios *iostreams.IOStreams, appVersion string, invokingAgent string, telemetryDisabler ghtelemetry.Disabler) func() (*http.Client, error) { |
| 260 | return func() (*http.Client, error) { |
| 261 | opts := api.HTTPClientOptions{ |
| 262 | Log: ios.ErrOut, |
| 263 | LogColorize: ios.ColorEnabled(), |
| 264 | AppVersion: appVersion, |
| 265 | InvokingAgent: invokingAgent, |
| 266 | // This is required to prevent automatic setting of auth and other headers. |
| 267 | SkipDefaultHeaders: true, |
| 268 | TelemetryDisabler: telemetryDisabler, |
| 269 | } |
| 270 | client, err := api.NewHTTPClient(opts) |
| 271 | if err != nil { |
| 272 | return nil, err |
| 273 | } |
| 274 | return client, nil |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | // configWithTokenRefresher returns a config accessor that injects the OAuth token refresher into the AuthConfig the |
| 279 | // first time the configuration is resolved, so refreshable credentials can be renewed during ordinary commands. The |