Skip to main content

RateLimitedMultipleTokenAuthenticator

Authenticator that rotates between multiple interchangeable tokens, tracking each token's remaining call quota. Outgoing requests are classified into quota pools using request matchers. When the active token's quota for the matched pool is exhausted, the authenticator rotates to the next token. When all tokens are exhausted, it waits until the earliest quota reset (bounded by max_wait_time) before resuming. Quota counters are seeded per token from quota_status_source at startup and refreshed after an exhaustion wait.

  • type: object
  • required: ["type","tokens","quota_status_source","quotas"]

type​

  • Required: Yes
  • type: string
  • enum: ["RateLimitedMultipleTokenAuthenticator"]

tokens​

The tokens to rotate between. Either an explicit list of tokens, or a single string containing multiple tokens separated by token_delimiter.

  • Required: Yes
  • Available variables: config

Examples:

{{ config['credentials']['personal_access_token'] }}
- '{{ config[''token_1''] }}'
- '{{ config[''token_2''] }}'
  • anyOf:

    • type: string
  • anyOf:

    • type: array

    • minItems: 1

    • items:

      • type: string

token_delimiter​

Delimiter used to split a single token string into multiple tokens.

  • Required: No
  • type: string
  • default: ,

auth_method​

The prefix to prepend to the token in the auth header value (e.g. Authorization: Bearer <token>).

  • Required: No
  • type: string
  • default: Bearer

Examples:

Bearer
token

The name of the HTTP header in which to inject the token.

  • Required: No
  • type: string
  • default: Authorization

quota_status_source​

Defines where to fetch each token's current quota status. Called once per token at startup and after an exhaustion wait, not per data request.

quotas​

Quota pools tracked per token. Each outgoing request is classified into the first pool whose matchers match the request; a pool with no matchers acts as the default. The remaining_path and reset_path locate each pool's values in the quota status response.

  • Required: Yes

  • type: array

  • minItems: 1

  • items:

max_wait_time​

ISO 8601 duration. When all tokens are exhausted, the maximum time to wait for a quota reset before raising a transient error.

  • Required: No
  • type: string
  • default: PT2H
  • Available variables: config

Examples:

PT2H
PT30M
PT{{ config.get('max_waiting_time', 120) }}M

budget_reserve_fraction​

Fraction of each token's quota to keep in reserve. When every token drops below its reserve, requests are proactively throttled to spread the remaining calls until the quota reset. Set to 0 (along with budget_min_reserve) to disable throttling.

  • Required: No
  • type: number
  • default: 0.1

budget_min_reserve​

Minimum number of calls to keep in reserve per token before proactive throttling kicks in.

  • Required: No
  • type: integer
  • default: 50

$parameters​

  • Required: No
  • type: object