import { Application, HttpContext, HttpRequest, Middleware, NextHandler } from '@supercharge/contracts'; export declare class VerifyCsrfTokenMiddleware implements Middleware { /** * Stores the application instance. */ protected readonly app: Application; /** * Create a new middleware instance. * * @param {Application} app */ constructor(app: Application); /** * Returns an array of URIs that should be excluded from CSRF verfication. * * @returns {Array} */ exclude(): string[]; /** * Handle the incoming request. * * @param ctx HttpContext * @param next NextHandler */ handle(ctx: HttpContext, next: NextHandler): Promise; /** * Determine whether to skip checking the CSRF token on the given `request`. * * @param {HttpRequest} request * * @returns {Boolean} */ shouldValidate(request: HttpRequest): boolean; /** * Determine whether the `request`’s URI is not excluded from CSRF verification. * * @param {HttpRequest} request * * @returns {Boolean} */ isNotExcludedUrl(request: HttpRequest): boolean; /** * Validate the CSRF tokens and throw an exception in case they don’t match. * * @param {HttpRequest} request */ validateCsrfToken(request: HttpRequest): this; /** * Retrieve the incoming CSRF token from the request. * * @param {Request} request * * @returns {String} */ getCsrfTokenFrom(request: HttpRequest): string | undefined; /** * Regenerate the CSRF token. * * @param {Request} request */ rotateToken(request: any): this; /** * Append the `XSRF-Token` to the response using an encrypted cookie. * * @param {HttpContext} ctx */ addCookieToResponse({ request, response }: HttpContext): void; }