fix(s3): support get-object region override and robust S3 URL parsing#3206
fix(s3): support get-object region override and robust S3 URL parsing#3206waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR enhances S3 get-object functionality with robust URL parsing and region handling. The changes add a dedicated optional region input field in the block UI and implement comprehensive S3 URL parsing that supports multiple URL formats including virtual-hosted style, path-style, dualstack, legacy formats, bucket names with dots, and AWS China ( Key improvements:
The implementation correctly prioritizes region sources and maintains backward compatibility. The regex patterns properly handle edge cases like bucket names containing dots. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant S3Block
participant S3GetObjectTool
participant parseS3Uri
participant S3Service
User->>S3Block: Provides S3 URL & optional region override
S3Block->>S3Block: Validates inputs (accessKeyId, secretAccessKey, s3Uri)
S3Block->>S3GetObjectTool: Passes credentials, s3Uri, region (getObjectRegion || region)
S3GetObjectTool->>parseS3Uri: parseS3Uri(s3Uri, region)
parseS3Uri->>parseS3Uri: Try URL hostname region extraction
parseS3Uri->>parseS3Uri: Supports virtual-hosted & path-style URLs
parseS3Uri->>parseS3Uri: Priority: URL region > fallback region > us-east-1
parseS3Uri-->>S3GetObjectTool: Returns {bucketName, region, objectKey}
S3GetObjectTool->>S3GetObjectTool: Builds request URL with parsed values
S3GetObjectTool->>S3GetObjectTool: Generates AWS Signature V4 headers
S3GetObjectTool->>S3Service: GET request with signed headers
S3Service-->>S3GetObjectTool: Returns object data
S3GetObjectTool->>S3GetObjectTool: Generates pre-signed URL
S3GetObjectTool-->>User: Returns file data & pre-signed URL
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
@greptile |
Summary
Type of Change
Testing
Tested manually
Checklist