-
Notifications
You must be signed in to change notification settings - Fork 9
feat(): add customize boto core config for OSS storage provider #1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
e1fa08c
to
ceb2fff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
|
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot uses AI. Check for mistakes.
customize_boto3_config = None | ||
if ( | ||
self.user_credential.storage_provider is not None | ||
and self.user_credential.storage_provider == "OSS" |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot uses AI. Check for mistakes.
No description provided.