ART Framework API Docs
    Preparing search index...

    Class ApiKeyStrategy

    Simple API key authentication strategy. Supports configurable header names for different service requirements.

    Implements

    Index

    Constructors

    • Creates a new API key authentication strategy.

      Parameters

      • apiKey: string

        The API key to use for authentication

      • headerName: string = 'Authorization'

        The header name to use (defaults to 'Authorization')

      Returns ApiKeyStrategy

    Methods

    • Generates authentication headers for API key-based authentication. Uses Bearer token format for Authorization header, plain key for custom headers.

      Returns Promise<Record<string, string>>

      Promise resolving to authentication headers

    • Gets the configured header name for this strategy.

      Returns string

      The header name that will be used

    • Checks if this strategy uses the standard Authorization header.

      Returns boolean

      True if using Authorization header, false for custom headers