Skip to content

docs: sign digest header in hmac-auth example#13396

Open
leno23 wants to merge 1 commit into
apache:masterfrom
leno23:docs/hmac-auth-sign-digest
Open

docs: sign digest header in hmac-auth example#13396
leno23 wants to merge 1 commit into
apache:masterfrom
leno23:docs/hmac-auth-sign-digest

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 20, 2026

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

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • 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

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="

Signed-off-by: wuyangfan <yangfan.wu@succaiss.com>
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. doc Documentation things labels May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: hmac-auth body validation example should sign the Digest header

1 participant