import { Principal } from "../model/security/Principal"; import { LogFactory } from "../util/logging/LogFactory"; import { ErrorInterceptor } from "./error/ErrorInterceptor"; import { IAuthFilter } from "./security/IAuthFilter"; import { IAuthorizer } from "./security/IAuthorizer"; /** * Holds all the middleware that will be applied to incoming HTTP * requests before or after calling endpoint methods. */ export declare class MiddlewareRegistry { private _authFilters; private _authorizers; private _errorInterceptors; private readonly logger; /** * Authentication filters to apply. These are chained, meaning only * one of the filters registered needs to authenticate a user to * for the request to be authenticated. */ get authFilters(): IAuthFilter[]; /** * Authorizers to apply. These are chained, meaning only * one of the authorizers registered needs to authorise a user against * a role for the request to be authorized. */ get authorizers(): IAuthorizer[]; /** * Error interceptors to use. Multiple interceptors can be * registered against one endpoint/controller, however only * the first interceptor registered will be invoked. */ get errorInterceptors(): ErrorInterceptor[]; constructor(logFactory: LogFactory); /** * Add an authentication filter. * * @param authFilter The filter to add. * @throws If the `authFilter` parameter is null or undefined. */ addAuthFilter(authFilter: IAuthFilter): void; /** * Adds an authorizer. * * @param authorizer The authorizer to add. * @throws If the `authorizer` parameter is null or undefined. */ addAuthorizer(authorizer: IAuthorizer): void; /** * Adds an error interceptor. * * @param errorInterceptor The interceptor to add. * @throws If the `errorInterceptor` parameter is null or undefined. */ addErrorInterceptor(errorInterceptor: ErrorInterceptor): void; }