Require signed copy source headers in SigV4 requests - #85
Open
zhijian-pro wants to merge 1 commit into
Open
Conversation
zhijian-pro
requested review from
jiefenghuang
and
a balanced review from Copilot
September 10, 2026 03:26
There was a problem hiding this comment.
🟢 Approval recommended
The focused validation change is correct and comprehensively covered across supported SigV4 request paths.
Pull request overview
Requires all x-amz-copy-source* headers in SigV4 requests to be signed.
Changes:
- Rejects unsigned copy-source headers.
- Adds direct, streaming, presigned, and routed copy tests.
- Updates existing copy tests to sign headers after setting them.
File summaries
| File | Description |
|---|---|
cmd/signature-v4-utils.go |
Enforces signed copy-source headers. |
cmd/signature-v4-copy_test.go |
Adds comprehensive authorization coverage. |
cmd/object-handlers_test.go |
Signs complete copy requests. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| // Copy headers can turn an upload into a read of another object, or change | ||
| // the source range and conditions. Require them to be covered by the signature. | ||
| for header := range reqHeaders { |
There was a problem hiding this comment.
根据sigv4定义, 所有x-amz都需要. 另外这个检测逻辑应该前置, 放到函数host判断之后吧
X-Amz-SignedHeaders
Lists the headers that you used to calculate the signature.
The following headers are required in the signature calculations:
The HTTP host header.
Any x-amz- headers that you plan to add to the request.*
(Note: For added security, you should sign all the request headers that you plan to include in your request.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.