feat(s3): support credential-scoped endpoint and OSS storage provider#2019
Merged
Conversation
Add `endpoint` and `storageProvider` fields to `_UserCredential` so the STS response can point the S3 client at alternative backends. When `storageProvider == OSS`, disable AWS checksum headers and switch to virtual-hosted addressing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Coverage report (flow360)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
angranl-flex
approved these changes
Apr 24, 2026
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.
Summary
endpointandstorageProviderfields to_UserCredential, letting the STS response redirect the S3 client to a non-AWS backend.storageProvider == OSS, disable AWS integrity-check headers and switch to virtual-hosted addressing; preserves existing path-style behavior for other S3-compatible stores (s3proxy, MinIO) viaEnv.current.s3_endpoint_url.user_credential.endpointto the boto3 client;Env.current.s3_endpoint_urlstill takes precedence when set.Test plan
storageProvider, noendpoint) still builds client unchanged.storageProvider=OSSpath: virtual-hosted addressing + checksums disabled.Env.current.s3_endpoint_urlset, nostorageProvider): path-style + checksums disabled.user_credential.endpointset: client uses thatendpoint_url.🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes how the boto3 S3 client is configured (endpoint selection, checksum behavior, and addressing style), which can impact all uploads/downloads and compatibility with different S3 backends.
Overview
Adds optional
endpointandstorageProviderfields to the STSuserCredentialspayload (_UserCredential) and threads them into S3 client construction.When
storageProviderisOSS, the client now disables AWS checksum/integrity behavior and switches to virtual-hosted bucket addressing; other S3-compatible endpoints configured viaEnv.current.s3_endpoint_urlkeep the existing path-style + checksum-disabled behavior.If a credential-scoped
endpointis provided, it is used as the boto3endpoint_urlunlessEnv.current.s3_endpoint_urlis set (which still overrides).Reviewed by Cursor Bugbot for commit 26fc6aa. Bugbot is set up for automated code reviews on this repo. Configure here.