airflow.providers.openlineage.token_provider

Attributes

AIRFLOW_CONNECTION_API_KEY_AUTH_TYPE

Exceptions

OpenLineageAirflowConnectionAuthError

Raised when OpenLineage API key auth cannot be resolved from an Airflow connection.

OpenLineageAirflowConnectionConfigError

Raised when OpenLineage config cannot be resolved from an Airflow connection.

Classes

AirflowConnectionConfigProvider

Resolve OpenLineage client configuration from an Airflow connection.

AirflowConnectionTokenProvider

Resolve an OpenLineage API key from an Airflow connection.

Functions

resolve_airflow_connection_auth(config[, config_conn_id])

Read the API key from an Airflow connection and put it into the OpenLineage config.

Module Contents

airflow.providers.openlineage.token_provider.AIRFLOW_CONNECTION_API_KEY_AUTH_TYPE = 'airflow_connection_api_key'[source]
exception airflow.providers.openlineage.token_provider.OpenLineageAirflowConnectionAuthError[source]

Bases: airflow.providers.common.compat.sdk.AirflowException

Raised when OpenLineage API key auth cannot be resolved from an Airflow connection.

exception airflow.providers.openlineage.token_provider.OpenLineageAirflowConnectionConfigError[source]

Bases: airflow.providers.common.compat.sdk.AirflowException

Raised when OpenLineage config cannot be resolved from an Airflow connection.

class airflow.providers.openlineage.token_provider.AirflowConnectionConfigProvider(conn_id)[source]

Resolve OpenLineage client configuration from an Airflow connection.

The connection extra contains the full OpenLineage client config, for example {"transport": {"type": "console"}}.

conn_id[source]
get_config()[source]
class airflow.providers.openlineage.token_provider.AirflowConnectionTokenProvider(config, default_conn_id=None)[source]

Resolve an OpenLineage API key from an Airflow connection.

The connection password is preferred. If it is empty and extra_key is configured, that key is read from connection extra. Otherwise, common extra keys are checked.

conn_id[source]
extra_key[source]
get_api_key()[source]
airflow.providers.openlineage.token_provider.resolve_airflow_connection_auth(config, config_conn_id=None)[source]

Read the API key from an Airflow connection and put it into the OpenLineage config.

OpenLineage config can contain one transport, a composite transport, or composite transports nested inside each other. This function walks through that structure and updates every matching auth block in place.

This only makes sense for HTTP transports: airflow_connection_api_key is replaced with {"type": "api_key", "apiKey": ...}.

Was this entry helpful?