singer_sdk.authenticators.APIKeyAuthenticator

class singer_sdk.authenticators.APIKeyAuthenticator[source]

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.

__init__(*args, key, value, location='header', **kwargs)[source]

Create a new authenticator.

Parameters:
  • *args (Any) – Positional arguments.

  • key (str) – API key parameter name.

  • value (str) – API key value.

  • location (Literal['header', 'params']) – Where the API key is to be added. Either ‘header’ or ‘params’.

  • **kwargs (Any) – Keyword arguments.

Raises:

ValueError – If the location value is not ‘header’ or ‘params’.

Return type:

None