Class EncodeQuery
java.lang.Object
org.ocpsoft.rewrite.servlet.config.EncodeQuery
- All Implemented Interfaces:
Operation
An
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...).
- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionExclude the given query-parameter names from encoding.onChecksumFailure(Operation operation) Operationto be performed when the currentChecksumStrategydetects an inbound checksum failure.static EncodeQueryCreate a newEncodeQueryoperation for the given query-parameter names.voidperform(Rewrite event, EvaluationContext context) The name of the composite query-parameter to hold the encoded parameters.toString()withChecksumStrategy(ChecksumStrategy strategy) Use the givenChecksumStrategywhen verifying and embedding checksums.withEncodingStrategy(EncodingStrategy strategy) Use the givenEncodingStrategywhen performing encoding.withInboundCorrection(boolean enable) Redirect inbound requests to anAddresscontaining matching query-parameters to the encodedAddress.
-
Method Details
-
params
Create a newEncodeQueryoperation 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 theAddress. -
excluding
Exclude the given query-parameter names from encoding. -
withEncodingStrategy
Use the givenEncodingStrategywhen performing encoding. -
withChecksumStrategy
Use the givenChecksumStrategywhen verifying and embedding checksums. -
withInboundCorrection
Redirect inbound requests to anAddresscontaining matching query-parameters to the encodedAddress. -
onChecksumFailure
Operationto be performed when the currentChecksumStrategydetects an inbound checksum failure. -
to
The name of the composite query-parameter to hold the encoded parameters. -
perform
-
toString
-