Fields
List of keyspace IDs the key must belong to. If the key belongs to a keyspace not in this list, authentication fails with
Frontline.Auth.InvalidKey.Ordered list of locations to extract the API key from. Frontline tries each location in order and uses the first non-empty key. If omitted, defaults to extracting a Bearer token from the
Authorization header.Optional RBAC query evaluated against the key’s permissions. If the key does not satisfy the query, authentication fails with
Frontline.Auth.InsufficientPermissions.Optional list of rate limits to enforce on the verified key, mirroring the
ratelimits field of the verifyKey API. Each entry references a rate limit by name. This is in addition to any auto-applied limits on the key or its identity, which are always enforced. Each entry may optionally override the limit, duration (milliseconds), and cost. Supplying both limit and duration defines an inline limit that does not need to exist on the key. If a named limit does not exist and no inline limit/duration is provided, the request is rejected.Examples
- Bearer token (default)
- Custom header
- Header with prefix stripping
- Query parameter
- With permissions
- With key rate limits
Key extraction
Frontline supports three key extraction locations:
When multiple locations are configured, Frontline tries each in order and uses the first non-empty result.
Verification flow
- Extract the key from the request using configured locations.
- Hash the key using SHA-256.
- Look up the hash in the key cache (fresh: 10s, stale: 10min, max: 100k entries).
- Validate key status. Keys that are not found, disabled, expired, or belong to a disabled workspace are rejected.
- Verify the key belongs to one of the configured
key_space_ids. - Parse the permission query (if configured) and build verify options, including any configured key
ratelimits. - Call
verifier.Verify()with 1 credit deduction per request. Auto-applied key/identity limits and any policy-configuredratelimitsare enforced here, using the same path as the verifyKey API. - Write rate limit headers (regardless of success or failure).
- Check post-verification status (rate limit, usage exceeded, permissions).
- Build and return the principal on success.