Skip to content

rgw: DeleteObject supports sigv4 with Transfer-Encoding: chunked - #64569

Merged
adamemerson merged 1 commit into
ceph:mainfrom
cbodley:wip-71607
Sep 12, 2025
Merged

adamemerson merged 1 commit into
ceph:mainfrom
cbodley:wip-71607

Conversation

@cbodley

@cbodley cbodley commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

we don't expect a request body for DeleteObject, so hadn't implemented its check for the payload hash against the x-amz-content-sha256 header

Fixes: https://tracker.ceph.com/issues/71607

Show available Jenkins commands

@github-actions github-actions Bot added the rgw label Jul 17, 2025
we don't expect a request body for DeleteObject, so hadn't implemented
its check for the payload hash against the x-amz-content-sha256 header

Fixes: https://tracker.ceph.com/issues/71607

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

using a simplified version of the reproducer from swift-server/async-http-client#602 (comment), using --aws-sigv4 to calculate the signature:

curl 'http://localhost:8000/testbucket/keyring' -X DELETE -H 'x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' -H "Transfer-Encoding: chunked" --aws-sigv4 aws:amz:us-east-1:s3 -u '0555b35654ad1656d804:h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==' -v --http1.1

without the fix, this fails with 501 Not Implemented:

* Host localhost:8000 was resolved. 
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8000...
* Connected to localhost (::1) port 8000
* using HTTP/1.x
* Server auth using AWS_SIGV4 with user '0555b35654ad1656d804'
> DELETE /testbucket/keyring HTTP/1.1
> Host: localhost:8000
> Authorization: AWS4-HMAC-SHA256 Credential=0555b35654ad1656d804/20250717/us-east-1/s3/aws4_request, SignedHeaders=host;transfer-encoding;x
-amz-content-sha256;x-amz-date, Signature=7586aaf10c708e580f48eca2c883ba5749b4b15bea54f2d6c5826224fe4a0cb1
> X-Amz-Date: 20250717T175426Z
> User-Agent: curl/8.11.1
> Accept: */*
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Transfer-Encoding: chunked
> 
* upload completely sent off: 5 bytes
< HTTP/1.1 501 Not Implemented
< Content-Length: 206
< x-amz-request-id: tx00000a5852764fba8c92a-00687938d2-4185-default
< Accept-Ranges: bytes
< Content-Type: application/xml
< Server: Ceph Object Gateway (tentacle)
< Date: Thu, 17 Jul 2025 17:54:26 GMT
< Connection: Keep-Alive
< 
* Connection #0 to host localhost left intact
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NotImplemented</Code><Message></Message><RequestId>tx00000a5852764fba8c92a-00687938d2-418
5-default</RequestId><HostId>4185-default-default</HostId></Error>

with the fix, succeeds with 204 No Content:

* Host localhost:8000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8000...
* Connected to localhost (::1) port 8000
* using HTTP/1.x
* Server auth using AWS_SIGV4 with user '0555b35654ad1656d804'
> DELETE /testbucket/keyring HTTP/1.1
> Host: localhost:8000
> Authorization: AWS4-HMAC-SHA256 Credential=0555b35654ad1656d804/20250717/us-east-1/s3/aws4_request, SignedHeaders=host;transfer-encoding;x-amz-content-sha256;x-amz-date, Signature=c79d539da0a84d098fa943b22dc3ed92c6a33a49d13724ae795942215a2f5b3d
> X-Amz-Date: 20250717T174456Z
> User-Agent: curl/8.11.1
> Accept: */*
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Transfer-Encoding: chunked
> 
* upload completely sent off: 5 bytes
< HTTP/1.1 204 No Content
< x-amz-request-id: tx0000023af3068766a1f9b-0068793698-4179-default
< Server: Ceph Object Gateway (tentacle)
< Date: Thu, 17 Jul 2025 17:44:56 GMT
< Connection: Keep-Alive
< 
* Connection #0 to host localhost left intact

@cbodley
cbodley marked this pull request as ready for review July 17, 2025 18:02
@cbodley
cbodley requested a review from a team as a code owner July 17, 2025 18:02
@cbodley
cbodley requested a review from mattbenjamin July 17, 2025 18:05
Comment thread src/rgw/rgw_rest_s3.cc
return 0;
// we're not reading any request body, so this should just match
// the sha256 hash of an empty buffer
return do_aws4_auth_completion();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's fine

@robbat2 robbat2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it; we can extend this to the other operations without payloads easily

@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/17662521875

@anrao19

anrao19 commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants