This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new b343355 add cryptor plugin (#282)
b343355 is described below
commit b34335504ca6202b0175b2c05c6128df8db04291
Author: Sinsy <[email protected]>
AuthorDate: Sat Sep 18 10:30:00 2021 +0800
add cryptor plugin (#282)
* add cryptor-request-plugin-zh.md
* update cryptor-request-plugin-zh.md
* update cryptor-request-plugin-zh.md
* update cryptor-request-plugin-zh.md
* add cryptor-response-plugin-zh.md
* update cryptor-response-plugin-zh.md
---
.../cryptor-request-plugin-zh.md | 60 +++++++++++++++++++++
.../cryptor-response-plugin-zh.md | 60 +++++++++++++++++++++
.../cryptor/cryptor-request-rules-config.png | Bin 0 -> 22912 bytes
.../cryptor/cryptor-response-rules-config.png | Bin 0 -> 22483 bytes
.../cryptor/enable-cryptor-request-plugin.png | Bin 0 -> 39442 bytes
.../cryptor/enable-cryptor-response-plugin.png | Bin 0 -> 38986 bytes
6 files changed, 120 insertions(+)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-request-plugin-zh.md
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-request-plugin-zh.md
new file mode 100644
index 0000000..bda67bf
--- /dev/null
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-request-plugin-zh.md
@@ -0,0 +1,60 @@
+---
+title: CryptorRequest 插件
+keywords: ["CryptorRequest"]
+description: CryptorRequest 插件
+---
+
+## 说明
+
+* `cryptorRequest` 插件是通过 `fieldNames` 去匹配 `requestBody` 里面的参数进行 `解密` 处理,替换当前
`requestBody` 内容。
+
+## 插件设置
+
+1. 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `cryptor_request` 设置为开启。
+
+<img src="/img/shenyu/plugin/cryptor/enable-plugin.png" width="80%"
height="80%" />
+
+2. 打开 `selector` 配置需要匹配的流量。
+
+3. 打开 `selector` 对应的 `Rules` 配置。
+
+ <img src="/img/shenyu/plugin/cryptor/cryptor-request-rules-config.png"
width="80%" height="80%" />
+
+ * strategyName: 解密算法名称。当前基于 shenyu 的 SPI 机制,可自定义加解密算法,
+ 需要实现 `org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy` 接口。
+
+ 同时找到 `resources/META-INF/shenyu/` 底下的
`org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy` 文件,
+ 写上算法名称以及实现的 `CryptorStrategy` 接口的 class 的包名。
+
+ * fieldNames: 匹配的参数名,支持解析多层次的 json 格式匹配,使用 `.` 分割,例如 data.id 。
+
+```json5
+ {
+ data: {
+ "id": ""
+ }
+ }
+```
+
+ * key: 秘钥,用于解密数据。
+
+## 插件使用
+
+* 在网关的 `pom.xml` 文件中添加 `cryptorRequest` 的支持。
+
+```xml
+ <!-- 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-->
+```
+
+## 场景
+
+防互联网黑产,恶意获取数据。提高数据安全性。
+
+
+
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-response-plugin-zh.md
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-response-plugin-zh.md
new file mode 100644
index 0000000..d6459e0
--- /dev/null
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/authority-and-certification/cryptor-response-plugin-zh.md
@@ -0,0 +1,60 @@
+---
+title: CryptorResponse 插件
+keywords: ["CryptorResponse"]
+description: CryptorResponse 插件
+---
+
+## 说明
+
+* `CryptorResponse` 插件是通过 `fieldNames` 去匹配 `responseBody` 里面的参数进行 `加密` 处理,替换当前
`fieldNames` 对应内容。
+
+## 插件设置
+
+1. 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `cryptor_response` 设置为开启。
+
+<img src="/img/shenyu/plugin/cryptor/enable-cryptor-response-plugin.png"
width="80%" height="80%" />
+
+2. 打开 `selector` 配置需要匹配的流量。
+
+3. 打开 `selector` 对应的 `Rules` 配置。
+
+<img src="/img/shenyu/plugin/cryptor/cryptor-response-rules-config.png"
width="80%" height="80%" />
+
+* strategyName: 解密算法名称。当前基于 shenyu 的 SPI 机制,可自定义加解密算法,
+ 需要实现 `org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy` 接口。
+
+ 同时找到 `resources/META-INF/shenyu/` 底下的
`org.apache.shenyu.plugin.cryptor.strategy.CryptorStrategy` 文件,
+ 写上算法名称以及实现的 `CryptorStrategy` 接口的 class 的包名。
+
+* fieldNames: 匹配的参数名,支持解析多层次的 json 格式匹配,使用 `.` 分割,例如 data.id 。
+
+```json5
+ {
+ data: {
+ "id": ""
+ }
+ }
+```
+
+* key: 秘钥,用于加密数据。
+
+## 插件使用
+
+* 在网关的 `pom.xml` 文件中添加 `cryptorResponse` 的支持。
+
+```xml
+ <!-- apache shenyu Cryptor Response plugin start-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-plugin-cryptor</artifactId>
+ <version>${project.version}</version>
+</dependency>
+ <!-- apache shenyu Cryptor Response plugin end-->
+```
+
+## 场景
+
+防互联网黑产,恶意获取数据。提高数据安全性。
+
+
+
diff --git a/static/img/shenyu/plugin/cryptor/cryptor-request-rules-config.png
b/static/img/shenyu/plugin/cryptor/cryptor-request-rules-config.png
new file mode 100644
index 0000000..55875fc
Binary files /dev/null and
b/static/img/shenyu/plugin/cryptor/cryptor-request-rules-config.png differ
diff --git a/static/img/shenyu/plugin/cryptor/cryptor-response-rules-config.png
b/static/img/shenyu/plugin/cryptor/cryptor-response-rules-config.png
new file mode 100644
index 0000000..8f88eb1
Binary files /dev/null and
b/static/img/shenyu/plugin/cryptor/cryptor-response-rules-config.png differ
diff --git a/static/img/shenyu/plugin/cryptor/enable-cryptor-request-plugin.png
b/static/img/shenyu/plugin/cryptor/enable-cryptor-request-plugin.png
new file mode 100644
index 0000000..684ef64
Binary files /dev/null and
b/static/img/shenyu/plugin/cryptor/enable-cryptor-request-plugin.png differ
diff --git
a/static/img/shenyu/plugin/cryptor/enable-cryptor-response-plugin.png
b/static/img/shenyu/plugin/cryptor/enable-cryptor-response-plugin.png
new file mode 100644
index 0000000..fea6497
Binary files /dev/null and
b/static/img/shenyu/plugin/cryptor/enable-cryptor-response-plugin.png differ