createHumanSecurityHandler()

An out-of-the box handler with the HUMAN Enforcer returns a default Express middleware function with built-in HUMAN enforcement.

createEnforcedRequestHandler(config: HumanSecurityConfiguration) => RequestHandler
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a default HTTP request handler function in the form of (request: Express Request, response: Express Response, next: NextFunction) => Promise

HumanSecurityEnforcer

The entity responsible for performing HUMAN enforcement.

constructor

Creates a new HumanSecurityEnforcer instance from a HumanSecurityConfiguration object (see the configuration section for more information).

constructor(configuration: HumanSecurityConfiguration) => HumanSecurityEnforcer
  • Parameters
    • config: HumanSecurityConfiguration
  • Returns a new instance of the HumanSecurityEnforcer

enforce()

Executes the enforcement functionality, returning either a response or null depending on which action should be taken.

enforce(request: Request, response: Response) => Promise<Response | null>

postEnforce()

Performs any post-enforcement processing actions such as sending HUMAN data to the collector.

postEnforce(request: Request, response: Response) => Promise<void>