@httpc/kit
Version:
httpc toolbox for building function-based API with minimal code and end-to-end type safety
9 lines (8 loc) • 433 B
TypeScript
/// <reference types="node" />
import http from "http";
import { HttpCServerMiddleware } from "@httpc/server";
export type AuthenticationApiKeyMiddlewareOptions = {
extractKey?: (request: http.IncomingMessage) => string | undefined;
onAuthenticate?: (apiKey: string) => Promise<IUser>;
};
export declare function AuthenticationApiKeyMiddleware(options?: AuthenticationApiKeyMiddlewareOptions): HttpCServerMiddleware;