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

Function NewApiKeyQueryParamAuthHTTPClient

common/apiKey.go:26–35  ·  view source on GitHub ↗

NewApiKeyQueryParamAuthHTTPClient returns a new http client, with automatic API key authentication. Specifically this means that the client will automatically add the API key (as a query param) to every request.

( //nolint:ireturn
	ctx context.Context,
	queryParamName, apiKey string,
	opts ...QueryParamAuthClientOption,
)

Source from the content-addressed store, hash-verified

24// authentication. Specifically this means that the client will automatically
25// add the API key (as a query param) to every request.
26func NewApiKeyQueryParamAuthHTTPClient( //nolint:ireturn
27 ctx context.Context,
28 queryParamName, apiKey string,
29 opts ...QueryParamAuthClientOption,
30) (AuthenticatedHTTPClient, error) {
31 return NewQueryParamAuthHTTPClient(ctx, append(opts, WithQueryParams(QueryParam{
32 Key: queryParamName,
33 Value: apiKey,
34 }))...)
35}

Callers 5

createApiKeyHTTPClientFunction · 0.92
GetSmartleadV2ConnectorFunction · 0.92
GetLemlistConnectorFunction · 0.92
GetHunterConnectorFunction · 0.92

Calls 2

WithQueryParamsFunction · 0.85

Tested by

no test coverage detected