MCPcopy Index your code
hub / github.com/coder/coder / oauthHTTPClient

Method oauthHTTPClient

coderd/promoauth/oauth2.go:249–259  ·  view source on GitHub ↗

oauthHTTPClient returns an http client that will instrument every request made.

(ctx context.Context, source Oauth2Source)

Source from the content-addressed store, hash-verified

247
248// oauthHTTPClient returns an http client that will instrument every request made.
249func (c *Config) oauthHTTPClient(ctx context.Context, source Oauth2Source) *http.Client {
250 cli := &http.Client{}
251
252 // Check if the context has a http client already.
253 if hc, ok := ctx.Value(oauth2.HTTPClient).(*http.Client); ok {
254 cli = hc
255 }
256
257 cli = c.InstrumentHTTPClient(cli, source)
258 return cli
259}
260
261type instrumentedTripper struct {
262 c *Config

Callers 2

DoMethod · 0.95
wrapClientMethod · 0.95

Calls 2

InstrumentHTTPClientMethod · 0.95
ValueMethod · 0.45

Tested by

no test coverage detected