UNPKG

@adonisjs/shield

Version:

A middleware for AdonisJS to keep web applications secure from common web attacks

30 lines (29 loc) 1 kB
import type { ApplicationService } from '@adonisjs/core/types'; /** * ShieldProvider is responsible for registering the Shield security middleware * with the AdonisJS container. It handles the configuration and initialization * of security features like CSRF protection, content security policy, and more. * * @example * ```ts * // Provider is automatically registered in providers array * const providers = [ * () => import('@adonisjs/shield/shield_provider') * ] * ``` */ export default class ShieldProvider { protected app: ApplicationService; /** * Creates a new instance of ShieldProvider * * @param app - The AdonisJS application service instance */ constructor(app: ApplicationService); /** * Registers ShieldMiddleware to the container with proper configuration * and dependencies. This method binds the middleware to the IoC container * and sets up Edge.js integration when available. */ register(): Promise<void>; }