Routing Request Based on HTTP Headers or Other User Attributes
Sentry allows for client requests to be routed to alternate or specific back end services based on data within the request. This is accomplished primarily by identifying an attribute or document element within the request to use to compare to a known list of values(or range of values) that correspond to specific Remote Network Policies. Each Remote Network Policy represents one of the services the request may be routed to.
1) Create a Remote Network Policy for each of the back end services that the requests may be routed to.
2) Create a Task List corresponding to each Remote Network Policy created in step 1.
- Each task will contain an Identify Document task used to match the request value (eg. http header value, query parameter value, xml content, user attribute, etc..) from the request.
- Each task list will also contain a Remote Routing task which will reference one of the Remote Policies created in step 1.
3) Add the Task Lists created in step 2 to a Task List Group and associate the Task List Group to a content policy.
The logic behind the above steps is that requests will be made to the content policy, trigger one of the Task Lists in the Task Group and will subsequently be routed to the Remote Network Policy defined within the Remote Routing task within that Task List.
Routing based on a range of values for an attribute:
You may need to route a request for an attribute value that falls within a specified range of values instead of just one specific value for the attribute. For instance, an X-Forwarded-For HTTP header can be used to route a specific IP address to a given back end server. However you may have a need to route all IP addresses within a specific network to a certain location. This can also be accomplished using the above steps by using a regular expression in the Identify Document task. The Identify Document Task supports the use of regular expression using the equals (=) comparator with the regular expression.