CryptorRequest plugin
#
Description- The
cryptorRequest
plugin usesfieldNames
to match the parameters inrequestBody
fordecryption
processing, replacing the currentrequestBody
content.
#
Plugin Setting- In
shenyu-admin
BasicConfig --> plugin ->cryptor_request
set to enable.
Open
selector
to configure the traffic that needs to be matched.Open the
Rules
configuration corresponding to theselector
.
strategyName: Algorithm name. Currently, based on shenyu's SPI mechanism, the encryption and decryption algorithms can be customized, Need to implement the
org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy
interface.At the same time find the
org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy
file underresources/META-INF/shenyu/
, Write the name of the algorithm, and the package name of the class that implements theCryptorStrategy
interface.fieldNames: Matching parameter name. Support parsing multi-level json format matching, using
.
segmentation, such as data.id.
{ data: { "id": "" } }
- key: Secret key. Used to decrypt data.
#
Plugin Use- Add support for
cryptorRequest
in thepom.xml
file of shenyu-bootstrap.
<!-- apache shenyu Cryptor Request plugin start--><dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-cryptor</artifactId> <version>${project.version}</version></dependency><!-- apache shenyu Cryptor Request plugin end-->
#
SituationPrevent Internet hacking and obtain data maliciously. Improve data security.