Skip to content

New component: Add a headers_transform extension with support for authenticator #37616

Open
@constanca-m

Description

@constanca-m

The purpose and use-cases of the new component

Use case: I am using awsfirehosereceiver. The receiver sets my API key in the header X-Amz-Firehose-Access-Key. However, my receiver is using an authenticator extension that expects the header authorization with the scheme ApiKey:

 extensions:
  bearertokenauth/withscheme:
    scheme: "ApiKey"
    token: "randomtoken"

Since the header is not present, even though there is one with the API key, the requests will keep failing.

Purpose: The purpose is to set the authorization in the expected Authorization header. The new extension should get:

  • The name of an authenticator extension
  • A list of OTTL statements to set the values of the headers

It will then execute each statement, before calling Authenticate of the authenticator extension given.

Example configuration for the component

Example configuration:

extensions:
  bearertokenauth/withscheme:
    scheme: "ApiKey"
    token: "randomtoken"

  headers_transform:
    server: # this is meant for receiver
      next_auth: bearertokenauth/withscheme
      statements:
        - set(headers["Authorization"], Format("ApiKey %s", [headers["X-Amz-Firehose-Access-Key"]]))
    # client: # this is meant for exporters

receivers:
  awsfirehosereceiver:
    auth: headers_transform      # <-- headers_transform instead of bearertokenauth/withscheme

Telemetry data types supported

All the supported by the chained authenticator.

Code Owner(s)

@axw

Sponsor (optional)

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Sponsor NeededNew component seeking sponsor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions