MCPcopy Create free account
hub / github.com/amp-labs/connectors / NewApiKeyHeaderAuthHTTPClient

Function NewApiKeyHeaderAuthHTTPClient

common/apiKey.go:12–21  ·  view source on GitHub ↗

NewApiKeyHeaderAuthHTTPClient returns a new http client, with automatic API key authentication. Specifically this means that the client will automatically add the API key (as a header) to every request. HeaderValue must be in the correct format. This sometimes means adding prefix to the API Key.

( //nolint:ireturn
	ctx context.Context,
	headerName, headerValue string,
	opts ...HeaderAuthClientOption,
)

Source from the content-addressed store, hash-verified

10// add the API key (as a header) to every request.
11// HeaderValue must be in the correct format. This sometimes means adding prefix to the API Key.
12func NewApiKeyHeaderAuthHTTPClient( //nolint:ireturn
13 ctx context.Context,
14 headerName, headerValue string,
15 opts ...HeaderAuthClientOption,
16) (AuthenticatedHTTPClient, error) {
17 return NewHeaderAuthHTTPClient(ctx, append(opts, WithHeaders(Header{
18 Key: headerName,
19 Value: headerValue,
20 }))...)
21}
22
23// NewApiKeyQueryParamAuthHTTPClient returns a new http client, with automatic API key
24// authentication. Specifically this means that the client will automatically

Callers 15

createApiKeyHTTPClientFunction · 0.92
NewAPIKeyClientFunction · 0.92
GetHappyFoxConnectorFunction · 0.92
NewConnectorFunction · 0.92
GetHeyreachConnectorFunction · 0.92
NewConnectorFunction · 0.92
GetConnectorFunction · 0.92
GetConnectorFunction · 0.92
GetMondayConnectorFunction · 0.92
GetBrevoConnectorFunction · 0.92
NewBrazeConnectorFunction · 0.92

Calls 2

NewHeaderAuthHTTPClientFunction · 0.85
WithHeadersFunction · 0.85

Tested by 1