@senacor/azure-function-middleware
Version:
Middleware for azure functions to handle authentication, authorization, error handling and logging
12 lines (11 loc) • 519 B
TypeScript
import { HttpHandler } from '@azure/functions';
import { Headers } from 'undici';
import { BeforeExecutionFunction } from '../middleware';
export type ValidationFunction = (headers: Headers) => boolean | Promise<boolean>;
export type HeaderAuthenticationOptions = {
validateUsingHeaderFn: ValidationFunction;
errorResponseBody: unknown;
skipIfResultIsFaulty: boolean;
};
declare const _default: (opts?: Partial<HeaderAuthenticationOptions>) => BeforeExecutionFunction<HttpHandler>;
export default _default;