A function that accepts a configuration in the form of a map and returns a PxConfig struct.
map[string]interface{} - A map representing the desired enforcer configuration*PxConfig - A pointer to a HUMAN Security configuration struct required for initializing the enforcererror - An error that occurred, if any, when building the PxConfig structA function that accepts a string representing the path to a JSON file that contains the enforcer configuration and returns a PxConfig struct.
string - The path to the configuration JSON file*PxConfig - A pointer to a HUMAN Security configuration struct required for initializing the enforcererror - An error that occurred, if any, when building the PxConfig structA function that returns a new PXConfigBuilder that can be used to build a new PxConfig struct. Once all the desired configurations are set, call Build() to return a pointer to the created PxConfig struct.
map[string]interface{} - A map containing only the px_app_id, px_auth_token, and px_cookie_secret required to initialize the PXConfigBuilder*PXConfigBuilder - A pointer to a struct with dedicated setter functions for each configuration value and a Build() function that returns the PxConfig structA function that returns a middleware that can be applied to route handlers. The returned function should be used as a wrapper for HTTP handler functions, applying the HUMAN enforcement logic prior to invoking the handler.
*PxConfig - A HUMAN Security configuration struct required for initializing the enforcerRuntime - An implementation of the Runtime interfacefunc (http.HandlerFunc) http.HandlerFunc - A middleware function that accepts a handler function and returns the same handler function with HUMAN enforcement applied to itCreates a new instance of the HumanSecurityEnforcer struct with the provided configuration.
*PxConfig - A pointer to a HUMAN Security configuration struct required for initializing the enforcerRuntime - An implementation of the Runtime interface*HumanSecurityEnforcer - A pointer to a HUMAN Security enforcer struct required for performing enforcementThe entity responsible for performing HUMAN enforcement.
Executes the enforcement functionality. It returns a response, a context, and an error, which dictate how to handle the request.
*http.Request - A pointer to the incoming HTTP request to be evaluatedRuntime - An implementation of the Runtime interface*http.Response - A pointer to an HTTP response that should be returned to the client (may be either a first-party or a block response)*PxContext - A pointer to a context struct that contains metadata pertaining to the request and the HUMAN decision (e.g., Score, DataEnrichment, etc.)error - An error that occurred, if any, while performing HUMAN enforcementParses the response to identify if the login request was successful or not, and sends the additional_s2s activity to HUMAN.
ResponseWriterWrapper - A wrapper for the http.ResponseWriter that saves the response body in memory for parsing*PxContext - A pointer to a context struct that contains metadata pertaining to the request and the HUMAN decision (e.g., Score, DataEnrichment, etc.)Runtime - An implementation of the Runtime interfaceA utility function that indicates whether or not the PXHD cookie should be set on the response.
*PxContext - A pointer to a context struct that contains metadata pertaining to the request and the HUMAN decision (e.g., Score, DataEnrichment, etc.)bool - Whether the PXHD cookie should be added as a Set-Cookie header on the HTTP responseReturns the PXHD cookie that should be added to the HTTP response. Should only be called if ShouldSetPxhd() returns true.
*PxContext - A pointer to a context struct that contains metadata pertaining to the request and the HUMAN decision (e.g., Score, DataEnrichment, etc.)http.Cookie - The PXHD cookie as an http.Cookie structWraps the provided http.ResponseWriter in a struct that stores the response data in-memory so it can be queried by the PostEnforce() function after the response has been returned to the client.
http.ResponseWriter - The entity used by the HTTP handler to construct a responseResponseWriterWrapper - A struct that implements the http.ResponseWriter interface and preserves the response data