aws / aws-sdk-go-v2

AWS SDK for the Go programming language.
https://aws.github.io/aws-sdk-go-v2/docs/
Apache License 2.0
2.68k stars 651 forks source link

operation inputs with streaming blobs are typed as io.Reader but sigv4 requires seekable bodies for payload calculation #2685

Closed lucix-aws closed 5 months ago

lucix-aws commented 5 months ago

AWS APIs are almost always signed with sigv4, which has an optional (but recommended) input of the sha256 of the request body.

For general buffered request/responses, we own the value of the underlying http.Request body and so this always works just fine.

For streaming-blob operations (e.g. PutObject), where the request body is bound to a blob member in the operation input, the SDK will try to calculate this automatically for you but will fail to do so (and fail the overall operation with an error) if the body you gave it does not implement io.Seeker. This is a sharp edge for users because we expose these blob inputs as just io.Reader.

lucix-aws commented 5 months ago

Reinvestigated and the behavior seems different now and broken in a different way. Closing.

github-actions[bot] commented 5 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.