public class EncodeQuery extends Object implements Operation
Operation that encodes any or many Address query-parameters into a single parameter using the
given ChecksumStrategy and EncodingStrategy. This can be used to effectively encrypt or obfuscate
inbound and outbound query-parameters. Additionally, encoded parameters contain a checksum which can be used to
reveal tampering, allowing for appropriate action to be taken on checksum verification failure.
For example:
?c=LTg1NDM0OTA1OSM&lang=en_US
The above query string contains multiple parameters. The value of parameter 'c' has been encoded using
to(String) and has specified that lang be excluded via excluding(String...).
| Modifier and Type | Method and Description |
|---|---|
EncodeQuery |
excluding(String... params)
Exclude the given query-parameter names from encoding.
|
EncodeQuery |
onChecksumFailure(Operation operation)
Operation to be performed when the current ChecksumStrategy detects an inbound checksum failure. |
static EncodeQuery |
params(String... params)
Create a new
EncodeQuery operation for the given query-parameter names. |
void |
perform(Rewrite event,
EvaluationContext context) |
EncodeQuery |
to(String param)
The name of the composite query-parameter to hold the encoded parameters.
|
String |
toString() |
EncodeQuery |
withChecksumStrategy(ChecksumStrategy strategy)
Use the given
ChecksumStrategy when verifying and embedding checksums. |
EncodeQuery |
withEncodingStrategy(EncodingStrategy strategy)
Use the given
EncodingStrategy when performing encoding. |
EncodeQuery |
withInboundCorrection(boolean enable)
Redirect inbound requests to an
Address containing matching query-parameters to the encoded
Address. |
public static EncodeQuery params(String... params)
EncodeQuery operation for the given query-parameter names. Only encode those given
parameters. If no parameter names are supplied, this will encode all query-parameters found in the Address
.public EncodeQuery excluding(String... params)
public EncodeQuery withEncodingStrategy(EncodingStrategy strategy)
EncodingStrategy when performing encoding.public EncodeQuery withChecksumStrategy(ChecksumStrategy strategy)
ChecksumStrategy when verifying and embedding checksums.public EncodeQuery withInboundCorrection(boolean enable)
Address containing matching query-parameters to the encoded
Address.public EncodeQuery onChecksumFailure(Operation operation)
Operation to be performed when the current ChecksumStrategy detects an inbound checksum failure.public EncodeQuery to(String param)
public void perform(Rewrite event, EvaluationContext context)
Copyright © 2023 OCPsoft. All rights reserved.