UNPKG

@dvsa/appdev-api-common

Version:

Utils library for common API functionality

16 lines (15 loc) 566 B
import type { Request } from "express"; import type { Action } from "routing-controllers"; import type { APIGatewayModel } from "../api/api-gateway-model"; export type RoutingControllersRequest = Request & { apiGateway: APIGatewayModel; }; export declare class JWTAuthChecker { /** * Perform a JWT token verification and role check * @param {RoutingControllersRequest} request * @param {string | string[]} roles * @returns {Promise<boolean>} */ static execute({ request }: Action, roles?: string | string[]): Promise<boolean>; }