Transformation Stages

A Lua transformation rule can be configured to trigger at one of various different stages during the request processing.

The request-match configuration entry, within the [http-transformations:<resource-name>] stanza, is used to define when a specific Lua transformation rule is triggered. The first criteria in the request matching is the stage of the request processing at which the rule is to be triggered. Numerous stages are supported, as shown in the following diagram. The required stage differs based on the purpose of the transformation rule.

The following table illustrates the purpose of the different stages and can be used to help determine the correct processing stage for a transformation rule.

Table 1. Stages
Stage Purpose
request
The request trigger point is invoked when the request is initially read from the client. It can be used when you want to perform early validation of the request, and potentially build up a response.
Note: The session information, managed by the Session Lua module, is not available at this stage in the processing.
preazn

The preazn trigger point is invoked after the session information (if available) is retrieved, but before the authorization decision is made. It is designed so that you can implement your own authorization decision logic and can serve as a potential replacement for the XSLT-based authorization rules.

postazn

The postazn trigger point is invoked after the authorization decision is made. It is designed to handle custom authentication logic, allowing you to authenticate a request and generate a new authenticated session. This trigger point can also be used as an alternative to the XSLT-based client certificate user mapping capability.

postauthn The postauthn trigger point is invoked after a user is authenticated and a new session is established. It is designed to allow custom extended attributes to be added to the user credential.
Note: The request match for this stage uses the authentication mechanism name rather than the HTTP request line.
response

The response trigger point is invoked after the HTTP response is read from the junctioned server. It is designed to allow validation to be performed on the response before it is sent to the client.