leno23 opened a new pull request, #13396:
URL: https://github.com/apache/apisix/pull/13396
### Description
Update the `hmac-auth` body-validation example so the generated HMAC
signature also covers the `Digest` header:
- compute the request body digest before building the signing string
- add `digest: ...` to the signing string
- include `digest` in `headers="@request-target date digest"`
- refresh the printed header, curl, and response examples
- add a short note explaining that `validate_request_body` validates the
body against `Digest`, and signing `digest` binds that digest to the HMAC
signature
Fixes #13395
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not,
please discuss on the APISIX mailing list first)
### Validation
- `git diff --check`
- extracted the documented Python snippet, fixed the timestamp to the sample
output value, and verified it prints:
- `Digest: SHA-256=78qzJuLwSpZ8HacsTdFCQJWxzPMOf8bYctRk2ySLpS8=`
- `headers="@request-target date digest"`
- `signature="LGBTz7bVQQWlkijeyDpEwJWo+ppwX735uRZk5F8KhmU="`
--
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]