Skip to content

Send the DeleteObjects body to the S3 REST signer - #4039

Open
smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:fix/s3-remote-signing-delete-body
Open

smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:fix/s3-remote-signing-delete-body

Conversation

@smaheshwar-pltr

@smaheshwar-pltr smaheshwar-pltr commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

Iceberg Java sends the DeleteObjects body to the S3 signing service, as the REST spec says to. PyIceberg doesn't. The body is the only place the keys being deleted appear, so REST catalogs like Lakekeeper reject DeleteObjects sign requests without it.

Since FsspecFileIO.delete sends DeleteObjects even for a single file, PyIceberg can't delete files through remote signing with these catalogs today.

Are these changes tested?

Yes. A new s3 test writes, reads, and deletes a file through S3V4RestSigner against the S3 container that the integration-test-s3 CI job runs. A requests_mock signing endpoint SigV4-signs each request with the container's credentials. The test checks that only the DeleteObjects sign request carries a body, and it fails without the fix.

Are there any user-facing changes?

Sign requests for DeleteObjects now include the request body.

AI Disclosure: This PR was authored by Claude Code (Opus 5.5) but directed and overseen by me.

smaheshwar-pltr

This comment was marked as outdated.

@Fokko

Fokko commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for raising this @smaheshwar-pltr. I know pre-signed URLs conceptually, but not the details. Maybe @danielcweeks has a free cycle to take a look at this. Can I ask if you have tested this against a S3 instance? One issue we have with the pre-signed url code is that it doesn't run any integration tests again MinIO.

@smaheshwar-pltr
smaheshwar-pltr force-pushed the fix/s3-remote-signing-delete-body branch from 5d96c0e to cd46cb3 Compare October 15, 2026 20:11
@danielcweeks
danielcweeks self-requested a review October 18, 2026 14:26
s3fs deletes files with DeleteObjects, which lists the object keys in the
request body. S3V4RestSigner never forwarded the body, so a signing
service could not authorize the keys before signing.

Also add an S3 test that writes, reads, and deletes through the REST
signer, which previously had only mocked unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@smaheshwar-pltr
smaheshwar-pltr force-pushed the fix/s3-remote-signing-delete-body branch from cd46cb3 to 2a008e3 Compare October 18, 2026 15:22
@smaheshwar-pltr smaheshwar-pltr changed the title Fix REST signing for S3 bulk deletes Send the DeleteObjects body to the S3 REST signer Oct 18, 2026
Comment thread pyiceberg/io/fsspec.py
"headers": {key: [val] for key, val in request.headers.items()},
}
# The signing service needs the DeleteObjects body to authorize the keys being deleted
if operation_name == "DeleteObjects":

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mirroring Iceberg Java, which sends the DeleteObjects body here. See the PR description for motivation.

Java identifies DeleteObjects from the URL (POST with a delete query parameter). botocore already passes operation_name to every before-sign handler, so the signer now accepts it and checks it directly, with no URL parsing.

@smaheshwar-pltr
smaheshwar-pltr marked this pull request as ready for review October 18, 2026 15:29
@smaheshwar-pltr

Copy link
Copy Markdown
Contributor Author

Hey @Fokko, good to see you again! Thanks for taking a look, I've now opened this PR up for review so things should be clearer.

In response to #4039 (comment), we're dealing with remote signing here not pre-signed URLs, and I've since added an integration test against RustFS where the signing endpoint is a mock that lets us verify the the body is as expected. To me, this seems sufficient.

I've also updated the PR description to better describe the problem we're seeing currently 🙏

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants