Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tilsor/ModSecIntl_wace_lib/llms.txt
Use this file to discover all available pages before exploring further.
Analyze fans out an HTTP payload to one or more model plugins of a given type, running them concurrently in the background. CheckTransaction blocks until every outstanding Analyze call for the transaction has completed, then invokes a decision plugin to produce a final allow/block verdict. The two functions work together: you may call Analyze multiple times (once per payload phase) before calling CheckTransaction once at the end.
Analyze
Signature
Parameters
The string representation of the
Passing an unrecognised string returns an error immediately without calling any plugins.
configstore.ModelPluginType that matches
the payload being submitted. Only plugins configured with the matching type
are invoked. Must be one of:| Value | Matches |
|---|---|
"RequestHeaders" | HTTP request headers |
"RequestBody" | HTTP request body |
"AllRequest" | Full request (headers + body) |
"ResponseHeaders" | HTTP response headers |
"ResponseBody" | HTTP response body |
"AllResponse" | Full response (headers + body) |
"Everything" | Any part of request or response |
The transaction identifier previously registered with
InitTransaction.The HTTP data to be scored. Populate only the fields relevant to
modelsTypeAsString; unused fields can remain at their zero values. See the
pluginmanager reference for the full struct definition.Slice of model plugin IDs (as declared in the configuration) to invoke for
this payload. If the slice is empty,
Analyze returns nil immediately
without incrementing the internal counter, so CheckTransaction will not
wait for this call.Return value
Returnsnil if the payload was dispatched successfully or models was empty. Returns an error if modelsTypeAsString is not a valid ModelPluginType string. Plugin-level failures (unknown plugin ID, type mismatch) are logged as errors but do not surface as return values from Analyze — they appear as error entries in ModelStatus and are logged.
CheckTransaction
Signature
Parameters
The transaction identifier previously registered with
InitTransaction.The ID of the decision plugin to invoke, as declared in the configuration.
The plugin receives all model results collected so far for this transaction.
Key-value pairs from the WAF engine passed through to the decision plugin as
DecisionInput.WAFdata. Pass an empty map if no WAF scores are available.
Typical keys used by the built-in simple decision plugin include:Return values
| Value | Description |
|---|---|
bool | true if the decision plugin determined the transaction should be blocked; false to allow. |
error | Non-nil if the transaction ID does not exist in the analysis map, the decision plugin is not found, or the results store has no entry for this transaction. |
true (blocked), WACElib increments the wace.client.request.blocked.total OpenTelemetry counter attributed with the decision plugin name.
Usage examples
Analyzing request headers only
Analyzing request and response in phases
Full WAF params from test suite
CheckTransaction blocks the calling goroutine until every pending Analyze
goroutine for transactionID sends a completion signal. If you called
Analyze three times, CheckTransaction waits for three completion signals
before invoking the decision plugin.