UNPKG

@allan1361/iota-big3-sdk-middleware

Version:

🏆 A+ Grade Certified Enterprise Middleware Framework - Phase 3 Certified (90/100) with advanced resilience patterns, comprehensive type safety, and production-ready observability

35 lines 1.11 kB
import type { NextFunction, Request, Response } from 'express'; export interface CSRFConfig { enabled?: boolean; tokenLength?: number; cookieName?: string; headerName?: string; sessionKey?: string; sameSite?: 'strict' | 'lax' | 'none'; secure?: boolean; httpOnly?: boolean; excludePaths?: string[]; excludeMethods?: string[]; } export interface CSRFToken { token: string; createdAt: Date; expiresAt: Date; } export declare class CSRFProtection { private config; private logger?; private tokens; constructor(config?: CSRFConfig, logger?: Logger); expressMiddleware(): (req: Request, res: Response, next: NextFunction) => void | Response<any, Record<string, any>>; fastifyPluginAsync(fastify: import('fastify').FastifyInstance): Promise<void>; generateToken(): CSRFToken; private setToken; private setTokenFastify; private validateToken; private validateTokenFastify; private isExcludedPath; private cleanExpiredTokens; getToken(req: Request): string | null; } //# sourceMappingURL=csrf-protection.d.ts.map