For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
      • Changelog
      • Installation
      • API
      • Configuration
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
On this page
  • Config
  • constructor
  • Enforcer
  • constructor
  • enforce
  • postEnforce
Enforcer frameworksAWS API Gateway-REST API Gateway-Lambda Authorizer

API

Was this page helpful?
Previous

Configuration

Next
Built with

Config

An object representing the HUMAN configuration that will be provided to the enforcer. A new instance of this class must be constructed and provided to the Enforcer.

constructor

Creates a new instance of the Config class from an HSConfig object. The Config constructor validates the provided HSConfig object. It is unnecessary to validate this configuration object for every Lambda invocation, so recommended usage is to initialize the Config instance outside of the Lambda request handler and provide it to the Enforcer within the handler.

1constructor(config: HSConfig) => Config
  • Parameters
    • config: HSConfig
  • Returns a new instance of Config

For more information on possible enforcer configurations, see the configuration documentation.

Enforcer

The entity responsible for performing HUMAN enforcement.

constructor

Creates a new instance of the Enforcer class.

1constructor(config: Config) => Enforcer
  • Parameters
    • config: Config
  • Returns a new instance of the Enforcer class

enforce

Executes the enforcement functionality, returning either null when the request should be passed to the origin, or an APIGatewayAuthorizerWithContextResult<{pxResponseBody?: string;}> in the case of a block response.

1enforce(event: APIGatewayRequestAuthorizerEvent) => Promise<null | APIGatewayAuthorizerWithContextResult<{pxResponseBody?: string;}>
  • Parameters
    • event: APIGatewayRequestAuthorizerEvent
  • Returns a Promise resolving to null or an APIGatewayAuthorizerWithContextResult

postEnforce

Performs any post-enforcement processing actions required.

1postEnforce(event: APIGatewayAuthorizerWithContextResult, response: APIGatewayAuthorizerWithContextResult) => Promise<void>
  • Parameters
    • event: APIGatewayRequestAuthorizerEvent
    • response: APIGatewayAuthorizerWithContextResult
  • Returns a Promise that resolves to void