This is an automated email from the ASF dual-hosted git repository.
dengliming 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 23277a1 Update custom-sign-algorithm.md (#300)
23277a1 is described below
commit 23277a10854d0e0e312051183756ba7a1e40bfa1
Author: Qicz <[email protected]>
AuthorDate: Wed Sep 29 22:26:16 2021 +0800
Update custom-sign-algorithm.md (#300)
---
.../developer/custom-sign-algorithm.md | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/custom-sign-algorithm.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/custom-sign-algorithm.md
index 0545f0a..adc1d5b 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/custom-sign-algorithm.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/custom-sign-algorithm.md
@@ -39,5 +39,34 @@ public SignService customSignService() {
}
```
+## 其他扩展
+> 当你只希望修改签名算法时可以参考如下。
+* 签名算法,默认使用的 `org.apache.shenyu.common.utils.SignUtils#generateSign`,还可以新增一个类
`CustomSignProvider` 实现 `org.apache.shenyu.plugin.sign.api.SignProvider`.
+
+```java
+/**
+ * The Sign plugin sign provider.
+ */
+public interface SignProvider {
+
+ /**
+ * acquired sign.
+ *
+ * @param signKey sign key
+ * @param params params
+ * @return sign
+ */
+ String generateSign(String signKey, Map<String, String> params);
+}
+```
+
+* 把新增的实现类 `CustomSignProvider` 注入到`Spring IoC`即可,如下
+
+```java
+@Bean
+public SignProvider customSignProvider() {
+ return new CustomSignProvider();
+}
+```