import { ApplicationLoggerService } from "@neoma/logging"; import { NestMiddleware } from "@nestjs/common"; import { Request, NextFunction } from "express"; import { GarmrOptions } from "../garmr.options"; import { AuthenticationService } from "../services/authentication.service"; /** * Middleware that attempts to authenticate the request using the * garmr.sid cookie (or a custom cookie name from options). * * If req.principal is already set (by a previous middleware), this * middleware skips authentication and calls next. * * If no cookie header is present or there is no matching cookie, * the request proceeds unauthenticated without error. * * If the cookie is present but authentication fails, no principal * is assigned and the request proceeds unauthenticated with a * warning logged. */ export declare class CookieAuthenticationMiddleware implements NestMiddleware { private readonly service; private readonly logger; private readonly cookieName; constructor(service: AuthenticationService, logger: ApplicationLoggerService, options: GarmrOptions); use(req: Request, _res: Express.Response, next: NextFunction): Promise; }