starsz commented on a change in pull request #6127:
URL: https://github.com/apache/apisix/pull/6127#discussion_r820579384



##########
File path: docs/zh/latest/plugins/jwt-auth.md
##########
@@ -107,6 +115,76 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f13
 }'
 ```
 
+### Vault 与 APISIX jwt-auth 插件集成的不同用例
+
+Apache APISIX `jwt-auth` 插件可以被配置为从 Vault 存储中获取简单的文本密钥以及 RS256 公私密钥对。
+
+**注意**:对于该集成支持的早期版本,该插件期望存储在 Vault 
路径中的密钥名称为「`secret`,`public_key`,`private_key`」其中之一,方可成功使用该密钥。
+
+要启用 Vault 的兼容性,只需要在 `jwt-auth` 插件内添加空的 Vault 对象。
+
+1. 用在 Vault 储存的 HS256 签名密钥来进行 jwt 签名和认证。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "username": "jack",
+    "plugins": {
+        "jwt-auth": {
+            "key": "key-1",
+            "vault": {}
+        }
+    }
+}'
+```
+
+在这里,插件在 Consumer 配置中提到的 Consumer 用户 `jack` 的 Vault 路径(`<vault.prefix from 
conf.yaml>/consumer/jack/jwt-auth`)中查找密钥 `secret`,并使用它进行后续的签名和 jwt 
验证。如果在同一路径中没有找到密钥,该插件将记录一个错误,并且无法执行 JWT 验证。

Review comment:
       ```suggestion
   在这里,插件在 Consumer 配置中提到的 Consumer 用户 `jack` 的 Vault 路径(`<vault.prefix from 
conf.yaml>/consumer/jack/jwt-auth`)中查找密钥 `secret`,并使用它进行后续的签名和 jwt 
验证。如果在该路径中没有找到密钥,该插件将记录一个错误,并且无法执行 JWT 验证。
   ```

##########
File path: docs/zh/latest/plugins/jwt-auth.md
##########
@@ -107,6 +115,76 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335f13
 }'
 ```
 
+### Vault 与 APISIX jwt-auth 插件集成的不同用例
+
+Apache APISIX `jwt-auth` 插件可以被配置为从 Vault 存储中获取简单的文本密钥以及 RS256 公私密钥对。
+
+**注意**:对于该集成支持的早期版本,该插件期望存储在 Vault 
路径中的密钥名称为「`secret`,`public_key`,`private_key`」其中之一,方可成功使用该密钥。

Review comment:
       ```suggestion
   **注意**:对于该集成支持的早期版本,该插件期望存储在 Vault 
路径中的密钥名称为「`secret`,`public_key`,`private_key`」其中之一。
   ```
   
   
   Looks missing some details, the EN doc has follow: 
   
   > In future releases, we are going to add the support of referencing custom 
named keys.

##########
File path: docs/zh/latest/plugins/jwt-auth.md
##########
@@ -48,6 +53,9 @@ title: jwt-auth
 | algorithm     | string  | 可选   | "HS256" | ["HS256", "HS512", "RS256"] | 
加密算法                                                                            
                          |
 | exp           | integer | 可选   | 86400   | [1,...]                     | 
token 的超时时间                                                                     
                         |
 | base64_secret | boolean | 可选   | false   |                             | 
密钥是否为 base64 编码                                                                 
                       |
+| vault         | object  | 可选   |         |                             | 
是否使用 Vault 作为存储和检索密钥(HS256/HS512 的密钥或 RS256 的公钥和私钥)的方式。该插件默认使用 
`kv/apisix/consumer/<consumer name>/jwt-auth` 路径进行密钥检索 |
+
+**注意**: 要启用 Vault 集成,首先访问 
[config.yaml](https://github.com/apache/apisix/blob/master/conf/config.yaml),更新您的
 Vault 服务器配置、主机地址和访问令牌。您可以在 vault 属性下的 
[config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml)
 中查看 APISIX 的预期配置。

Review comment:
       ```suggestion
   **注意**: 要启用 Vault 集成,首先访问 
[config.yaml](https://github.com/apache/apisix/blob/master/conf/config.yaml),更新您的
 Vault 服务器配置、主机地址和访问令牌。您可以在 
[config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml)
 中 vault 属性下查看 APISIX 的默认配置。
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to