nic-chen commented on a change in pull request #2301: URL: https://github.com/apache/apisix/pull/2301#discussion_r495427596
########## File path: doc/plugins/hmac-auth.md ########## @@ -128,7 +129,35 @@ Accept-Ranges: bytes * The signature information is separately placed in the request header: ```shell -$ curl http://127.0.0.1:9080/index.html -H 'X-HMAC-SIGNATURE: base64_encode(SIGNATURE)' -H 'X-HMAC-ALGORITHM: ALGORITHM' -H 'X-HMAC-TIMESTAMP: TIMESTAMP' -H 'X-HMAC-ACCESS-KEY: ACCESS_KEY' -H 'X-HMAC-SIGNED-HEADERS: SIGNED_HEADERS' -i +$ curl http://127.0.0.1:9080/index.html -H 'X-HMAC-SIGNATURE: base64_encode(SIGNATURE)' -H 'X-HMAC-ALGORITHM: ALGORITHM' -H 'Date: DATE' -H 'X-HMAC-ACCESS-KEY: ACCESS_KEY' -H 'X-HMAC-SIGNED-HEADERS: SIGNED_HEADERS' -i +HTTP/1.1 200 OK +Content-Type: text/html +Content-Length: 13175 +... +Accept-Ranges: bytes + +<!DOCTYPE html> +<html lang="cn"> +``` + +## Custom header key + +We can customize header key for auth parameters by adding the attribute configuration of the plugin under `plugin_attr` in `conf / config.yaml`. + +```yaml +plugin_attr: + hmac-auth: + signature_key: X-APISIX-HMAC-SIGNATURE + algorithm_key: X-APISIX-HMAC-ALGORITHM + http_date_key: X-APISIX-DATE Review comment: fixed. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
