This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 1855469 docs: update hmac-auth.md (#4969)
1855469 is described below
commit 18554691989026f76fc25d47160b1381282187b7
Author: caixiaomao <[email protected]>
AuthorDate: Mon Sep 6 09:56:56 2021 +0800
docs: update hmac-auth.md (#4969)
Fix #4962
---
docs/en/latest/plugins/hmac-auth.md | 2 +-
docs/zh/latest/plugins/hmac-auth.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/en/latest/plugins/hmac-auth.md
b/docs/en/latest/plugins/hmac-auth.md
index 6688ab9..dcf04ac 100644
--- a/docs/en/latest/plugins/hmac-auth.md
+++ b/docs/en/latest/plugins/hmac-auth.md
@@ -101,7 +101,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H
'X-API-KEY: edd1c9f034335f13
### generate signature:
-The calculation formula of the signature is `signature =
HMAC-SHAx-HEX(secret_key, signing_string)`. From the formula, it can be seen
that in order to obtain the signature, two parameters, `SECRET_KEY` and
`signing_STRING`, are required. Where secret_key is configured by the
corresponding consumer, the calculation formula of `signing_STRING` is
`signing_string = signing_string = HTTP Method + \n + HTTP URI + \n +
canonical_query_string + \n + access_key + \n + Date + \n + signed_headers_
[...]
+The calculation formula of the signature is `signature =
HMAC-SHAx-HEX(secret_key, signing_string)`. From the formula, it can be seen
that in order to obtain the signature, two parameters, `SECRET_KEY` and
`signing_STRING`, are required. Where secret_key is configured by the
corresponding consumer, the calculation formula of `signing_string` is
`signing_string = HTTP Method + \n + HTTP URI + \n + canonical_query_string +
\n + access_key + \n + Date + \n + signed_headers_string`. If one o [...]
1. **HTTP Method** : Refers to the GET, PUT, POST and other request methods
defined in the HTTP protocol, and must be in all uppercase.
2. **HTTP URI** : `HTTP URI` requirements must start with "/", those that do
not start with "/" need to be added, and the empty path is "/".
diff --git a/docs/zh/latest/plugins/hmac-auth.md
b/docs/zh/latest/plugins/hmac-auth.md
index 2536b2e..6e0d278 100644
--- a/docs/zh/latest/plugins/hmac-auth.md
+++ b/docs/zh/latest/plugins/hmac-auth.md
@@ -95,7 +95,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H
'X-API-KEY: edd1c9f034335f13
### 签名生成公式
-签名的计算公式为 `signature = HMAC-SHAx-HEX(secret_key,
signing_string)`,从公式可以看出,想要获得签名需要得到 `secret_key` 和 `signing_string` 两个参数。其中
`secret_key` 为对应 consumer 所配置的, `signing_string` 的计算公式为 `signing_string = HTTP
Method + \n + HTTP URI + \n + canonical_query_string + \n + access_key + \n +
Date + \n + signed_headers_string`。
+签名的计算公式为 `signature = HMAC-SHAx-HEX(secret_key,
signing_string)`,从公式可以看出,想要获得签名需要得到 `secret_key` 和 `signing_string` 两个参数。其中
`secret_key` 为对应 consumer 所配置的, `signing_string` 的计算公式为 `signing_string = HTTP
Method + \n + HTTP URI + \n + canonical_query_string + \n + access_key + \n +
Date + \n + signed_headers_string`。如果 signing_string 中的某一项不存在,也需要使用一个空字符串代替。
1. **HTTP Method**:指 HTTP 协议中定义的 GET、PUT、POST 等请求方法,必须使用全大写的形式。
2. **HTTP URI**:要求必须以“/”开头,不以“/”开头的需要补充上,空路径为“/”。