mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix S3 client initialization with signature_version and addressing_style (#9911)
### What problem does this PR solve?
Moved `signature_version` and `addressing_style` parameters to a
`Config` object from `botocore.config`
`signature_version` is now passed as `Config(signature_version='v4')`
`addressing_style` is now passed as `Config(s3={'addressing_style':
'path'})`
The `Config` object is then passed to `boto3.client()` via the `config`
parameter
## Changes Made
- Modified `rag/utils/s3_conn.py` in the `__open__()` method
- Updated parameter handling logic to use `config_kwargs` dictionary
- Maintained backward compatibility for configurations without these
parameters
## Related Issue
Fixes #9910
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Co-authored-by: Syed Shahmeer Ali <ashahmeer73@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1ee9c0b8d9
commit
ddaed541ff
@ -80,10 +80,13 @@ class RAGFlowS3:
|
||||
s3_params['region_name'] = self.region_name
|
||||
if self.endpoint_url:
|
||||
s3_params['endpoint_url'] = self.endpoint_url
|
||||
|
||||
# Configure signature_version and addressing_style through Config object
|
||||
if self.signature_version:
|
||||
s3_params['signature_version'] = self.signature_version
|
||||
config_kwargs['signature_version'] = self.signature_version
|
||||
if self.addressing_style:
|
||||
s3_params['addressing_style'] = self.addressing_style
|
||||
config_kwargs['s3'] = {'addressing_style': self.addressing_style}
|
||||
|
||||
if config_kwargs:
|
||||
s3_params['config'] = Config(**config_kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user