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
    • Callout Enforcer
      • Changelog
      • Installation
      • API
      • Configuration
    • 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
  • createDefaultEnforcedRouter
  • HumanSecurity
  • constructor
  • matchFirstParty
  • matchFilteredExtensions
  • createEnforcer
  • Enforcer
  • enforce
  • postEnforce
Enforcer frameworksEdgio Serverless Compute

API

Was this page helpful?
Previous

Configuration

Next
Built with

createDefaultEnforcedRouter

Creates a Router that has the HUMAN enforcer integrated into it already.

1createDefaultEnforcedRouter(params: ConfigurationParams, originName: string) => Router
  • Parameters
    • params: ConfigurationParams
    • originName: string
  • Returns a Router

HumanSecurity

constructor

Creates a new instance of the HumanSecurity class from a ConfigurationParams object (see the configuration section for more information).

1constructor(params: ConfigurationParams) => HumanSecurity
  • Parameters
    • params: ConfigurationParams
  • Returns a new instance of the HumanSecurity class

matchFirstParty

Provides the required first party path and handler parameters for the Router.match() function.

1matchFirstParty() => [string, RouteHandler]
  • Returns an array whose elements are
    • a string for matching HUMAN first party requests ('/<FIRST_PARTY_PREFIXES>/:path*')
    • a RouteHandler for first party requests

Caching settings are controlled by the Cache-Control response header.

matchFilteredExtensions

Provides the filtered extension path and handler parameters for the Router.match() function.

1matchFilteredExtensions(originName: string) => [string, RouteHandler]
  • Parameters
    • originName: string
  • Returns an array whose elements are
    • a string for matching HUMAN requests with filtered extensions
    • a RouteHandler for requests that should be filtered based on their file extensions

The path match will be a string like '/:path*/:file.:ext(jpg|css|png|...)*' where the extensions are based px_filter_by_extension configuration value. This function requires the originName so that requests can be proxied to the origin if they are not found in the cache.

Caching settings are controlled by the Cache-Control response header.

createEnforcer

Creates a new Enforcer instance. For use inside the compute function.

1createEnforcer() => Enforcer
  • Returns a new Enforcer instance with the configurations provided to the HumanSecurity instance

Enforcer

The entity responsible for performing HUMAN enforcement. A new Enforcer should be created using createEnforcer() inside the function passed to the compute() function.

enforce

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

1enforce(request: Request, response: Response) => Promise<Response | null>
  • Parameters
    • request: Request
    • response: Response
  • Returns a Promise resolving to a Response or null

postEnforce

Performs any post-enforcement processing actions and final modifications to (i.e., setting cookies or headers on) the response if needed.

1postEnforce(response: Response) => Promise<void>
  • Parameters
    • response: Response
  • Returns a Promise resolving to void

The postEnforce function adds a Set-Cookie header to the response, so these responses will not be cached.