feat(): add customize boto core config for OSS storage provider#1173
feat(): add customize boto core config for OSS storage provider#1173JunchengXue wants to merge 1 commit intomainfrom
Conversation
e1fa08c to
ceb2fff
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for customizing boto3 core configuration specifically for OSS (Object Storage Service) storage providers. The changes enable proper integration with OSS by handling OSS-specific requirements and endpoint configurations.
- Add optional endpoint and storage provider fields to user credentials
- Implement OSS-specific boto3 configuration with checksum validation settings
- Add endpoint URL configuration support for alternative storage providers
|
|
||
| if Env.current.s3_endpoint_url is not None: | ||
| kwargs["endpoint_url"] = Env.current.s3_endpoint_url | ||
|
|
There was a problem hiding this comment.
The endpoint URL assignment logic has a potential issue. If both self.user_credential.endpoint and Env.current.s3_endpoint_url are set, the environment variable will overwrite the user credential endpoint without any indication. Consider either documenting this precedence or adding a warning when both are present.
| if self.user_credential.endpoint is not None: | |
| log.warning( | |
| "Both user credential endpoint (%s) and environment S3 endpoint (%s) are set. " | |
| "Environment S3 endpoint will take precedence.", | |
| self.user_credential.endpoint, | |
| Env.current.s3_endpoint_url, | |
| ) | |
| kwargs["endpoint_url"] = Env.current.s3_endpoint_url |
| customize_boto3_config = None | ||
| if ( | ||
| self.user_credential.storage_provider is not None | ||
| and self.user_credential.storage_provider == "OSS" |
There was a problem hiding this comment.
The hardcoded string "OSS" should be defined as a constant to improve maintainability and prevent typos. Consider defining OSS_STORAGE_PROVIDER = "OSS" at the module level.
| and self.user_credential.storage_provider == "OSS" | |
| and self.user_credential.storage_provider == OSS_STORAGE_PROVIDER |
No description provided.