singer_sdk.authenticators.APIKeyAuthenticator

class singer_sdk.authenticators.APIKeyAuthenticator(stream: singer_sdk.streams.core.Stream, key: str, value: str, location: str = 'header')

Implements API key authentication for REST Streams.

This authenticator will merge a key-value pair with either the HTTP headers or query parameters specified on the stream. Common examples of key names are “x-api-key” and “Authorization” but any key-value pair may be used for this authenticator.

classmethod create_for_stream(stream: singer_sdk.streams.core.Stream, key: str, value: str, location: str)singer_sdk.authenticators.APIKeyAuthenticator

Create an Authenticator object specific to the Stream class.

Parameters
  • stream – The stream instance to use with this authenticator.

  • key – API key parameter name.

  • value – API key value.

  • location – Where the API key is to be added. Either ‘header’ or ‘params’.

Returns

A new singer_sdk.authenticators.APIKeyAuthenticator instance.