wrapClient is the only way we can accurately instrument the oauth2 client. This is because method calls to the 'OAuth2Config' interface are not 1:1 with network requests. For example, the 'TokenSource' method will return a token source that will make a network request when the 'Token' method is cal
(ctx context.Context, source Oauth2Source)
| 242 | // source that will make a network request when the 'Token' method is called on |
| 243 | // it if the token is expired. |
| 244 | func (c *Config) wrapClient(ctx context.Context, source Oauth2Source) context.Context { |
| 245 | return context.WithValue(ctx, oauth2.HTTPClient, c.oauthHTTPClient(ctx, source)) |
| 246 | } |
| 247 | |
| 248 | // oauthHTTPClient returns an http client that will instrument every request made. |
| 249 | func (c *Config) oauthHTTPClient(ctx context.Context, source Oauth2Source) *http.Client { |
no test coverage detected