Request Modification

Before processing the request, you can add your modifications to it, refer to the Ceptor Gateway pages related to configuration: Config - Locations for full details.

General

CookieSnapper

Cookies to snap

Pattern defining which cookies to remove from the response and place into the session. Any cookies matching this pattern will be moved from the response to the session, and added on future requests.

Classifier

Classifier to use - here you can use %{} variables, such as %{HTTP_HOST} or %{script:xxxx} to specify the classifier or scope to restrict these cookies too.
The classifier can ensure that the cookies are not forwarded on all requests, but only where the next request has the same classifier - so if it is e.g. set to %{HTTP_HOST} then the cookie will only be added to future requests, if these requests have the exact same hostname as this one.
If the classifier is left as "default" then if the next request has a different hostname, e.g. app2.mydomain.com then the cookie will be added to the request again, which is usually what you want. 

Plugins

Plugins are java or script code that can process request or response bodies - they can e.g. transform contents from one format to another, e.g. add encryption, verify signatures etc.

Request wrapper java class

Java class implementing ConduitWrapper<StreamSourceConduit> to process request body - see Plugins#JavaRequestWrapper for more information.

Response wrapper java class

Java class implementing ConduitWrapper<StreamSinkConduit> to process response body - see Plugins#JavaResponseWrapper for more information.

Request wrapper script

Script that processes request body - see Plugins#ScriptRequestWrapper for more information.

Response wrapper script

Script that processes response body see Plugins#ScriptResponseWrapper for more information.

URL Rewrite

URL Rewrite allows you to rewrite URLs and change them.

URL Rewrite configuration is stored in a JSON object called urlrewrite within the location. This is an array of multiple JSON object, where each rule is its own object.


You can add, remove and reorder the rewrite rules.

When you press "Add" you get this screen where you can fill out the values.

When later editing the values, the screen looks like this:

URL Rewrite configuration

Name

Name of URL rewrite rule.

Regex pattern

Regular expression pattern.

Regex flags

Flags are one or more regular expression flags separated by comma, semicolon or pipe sign.
The flags can be UNIX_LINES, CASE_INSENSITIVE, COMMENTS, LITERAL, MULTILINE, DOTALL, UNICODE_CASE, CANON_EQ,UNICODE_CHARACTER_CLASS - see javadoc for java.util.regex.Pattern for details.

New URL

New URL to rewrite to - URL can include $<n> where <n> is the number matching the regular expression group in the pattern - e.g. /abc/(.*)/def/(.*) can be rewritten to /ABC123/$1/DEF123/$2 where $1 and 2 are replaced with the value in the appropriate group.

Decode URL before matching

If set, URL will be decoded before matching - if not, URL will encoded be exactly as received from client.

Remove all query params from request

If set, all query parameters will be removed from the request, if rewriting the URL - if false, query parameters are kept.

Redirect

If set, redirect immediately (HTTP 302) to the new URL instead of continuing processing the next locations with the rewritten URL.

Last rule

If pattern matches and URL is rewritten, no more rewrite rules for this location will be executed - remaining ones will be skipped.

Conditions

Like a location has conditions, the URL Rewrite rule also has conditions for when it will be triggered. You can add the same kind of conditions with the same rules as for locations.

See conditions in Config - Locations for details about each field.

Request Attributes

This allows you to modify request attributes - see Config - Locations for details - attributes are request-specific variables that can be reused in e.g. Pipelines and Tasks during request processing. They are local for each API call, and are discarded when the call completes.

Request Headers

This allows you to modify the request HTTP headers before they are proxied to a destination server - see see Config - Locations for details.

Request Cookies

Like request headers, this allows you to modify the request cookies before implementation.

Response Headers

This allows you to add or modify any HTTP response headers - useful for transforming information sent by proxied APIs - and can be used to delete HTTP headers you do not want to expose to your clients.

Response Cookies

Like with response headers, this allows you to add, delete or modify response cookies before they are sent back to your clients.


© Ceptor ApS. All Rights Reserved.