Skip to content

covenix / bearer

Function: bearer()

bearer(handler, options?): SecurityScheme

Defined in: src/security.ts:47

Builds an HTTP bearer security scheme (Authorization: Bearer <token>).

Parameters

handler

SecurityHandler

Resolves the request to a principal, or null for 401.

options?

BearerOptions = {}

Optional bearerFormat hint for the OpenAPI document.

Returns

SecurityScheme

Example

ts
new Covenix({ info, security: { bearerAuth: bearer((req) => verifyJwt(req)) } });