-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add AK/SK(HMAC) auth plugin. #2192
Conversation
doc/zh-cn/plugins/hmac-auth.md
Outdated
|
||
### 签名生成公式 | ||
|
||
签名的计算公式为 `signature = HMAC-SHAx-HEX(secret_key, signning_string)`,从公式可以看出,想要获得签名需要得到 `secret_key` 和 `signning_string` 两个参数。其中 `secret_key` 为对应 consumer 所配置的, `signning_string` 的计算公式为: `signning_string = HTTP Method + HTTP URI + canonical_query_string + HTTP BODY + access_key + timestamp + secret_key` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- I think the HTTP body is optional.
- For the
signning_string
, we should add a space when we concat different values, eg:HTTP METHOD
+ " " +HTTP URI
, it is more easier for understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding HTTP body
is safer, that a signature just can put or post a same body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the HTTP body is optional.
this way is better, the request body maybe large.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another way to do both, that is, we can put the body hash in request header which could be put in the signning_string
. what do you think ? @membphis
What this PR does / why we need it:
add AK/SK auth plugin
Pre-submission checklist: