-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(s3): support get-object region override and robust S3 URL parsing #3206
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, no comments
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.
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 |
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.
3 files reviewed, no comments
Summary
Type of Change
Testing
Tested manually
Checklist