import { DependencyContainer } from "tsyringe"; import { LogHandlerInterface } from "@pristine-ts/logging"; import { IdentityInterface, Request, TracingManagerInterface } from "@pristine-ts/common"; import { AuthorizerManagerInterface } from "../interfaces/authorizer-manager.interface"; import { GuardFactory } from "../factories/guard.factory"; /** * The authorizer manager provides authorization by authorizing the action. * It is tagged and can be injected using AuthorizerManagerInterface which facilitates mocking. */ export declare class AuthorizerManager implements AuthorizerManagerInterface { private readonly logHandler; private readonly tracingManager; private readonly guardFactory; /** * The authorizer manager provides authorization by authorizing the action. * @param logHandler The log handler to output logs. * @param tracingManager The tracing manager used to attach markers per guard decision. * @param guardFactory The factory to create the guard. */ constructor(logHandler: LogHandlerInterface, tracingManager: TracingManagerInterface, guardFactory: GuardFactory); /** * Returns whether or not the request is authorized to access the route. Drops one marker * per guard (`authz.guard-decision` with the guard's class name and `allow`/`deny`/`error`) * so the trace shows which guard was the deciding one. * @param request The request to authorize. * @param routeContext The route context. * @param container The dependency container to resolve the guard from. * @param identity The identity making the request. */ isAuthorized(request: Request, routeContext: any, container: DependencyContainer, identity?: IdentityInterface): Promise; }