Implements object manipulation capabilities for v0.11.0:
- CopyObject: server-side copy within/across buckets with metadata control
- DeleteObjects: batch delete up to 1000 objects in single request
Both operations follow AWS S3 API specification with proper:
- AWS Signature V4 signing
- XML request/response handling
- Content-MD5 and SHA256 headers
- Comprehensive input validation
Fixed DeleteObjects signature mismatch with MinIO by correcting the canonical
query string format for empty query parameter values (delete= instead of delete).
The writeQuery function now properly appends = to keys with empty values per
AWS Signature V4 specification.
CopyObject enables CLI mv commands. DeleteObjects enables efficient
batch operations for CLI sync/rm.
Tests: All CopyObject and DeleteObjects tests passing with MinIO.
"lets work on the object level operations"
Adds bucket management capabilities:
- ListBuckets: list all buckets for AWS account with owner info
- CreateBucket: create bucket with optional region support
- DeleteBucket: delete empty buckets
Includes comprehensive tests and README documentation.
Prompt: "Please review the changes we have made for this bucket api"
"we never used to have like so many emojis earlier and the look of the readme on github was really professional. can you please fix that"
"can you critique the readme"
- Remove emojis from features list and code examples for professional appearance
- Fix error handling in Quick Start example
- Add proper error checks for io.ReadAll
- Fix escaped newlines in printf statements (\\n to \n)
- Remove confusing SetEndpoint line from Quick Start
- Add ROADMAP.md with planned features through v1.0.0
- Update Contributing section to reference ROADMAP.md
- Add List method with ListInput and ListResponse structs following simples3 patterns
- Implement pagination, prefix filtering, and delimiter grouping
- Add comprehensive test suite for List functionality
- Update tests to use environment variables instead of hardcoded values
- Fix deprecated io/ioutil usage throughout codebase
- Add comprehensive README with API documentation and examples
- Add Nix development environment with flake.nix
- Add Justfile for modern command runner
- Add Docker Compose setup for local MinIO testing
- Update GitHub Actions to use Nix and Justfile for CI consistency
- Fix test naming and setup flow issues
New API:
s3.List(ListInput{
Bucket: "my-bucket",
Prefix: "documents/",
MaxKeys: 100,
})
All tests pass with new simplified API design.
Adds renewIAMToken() call in GeneratePresignedURL.
On token expiry, GeneratePresignedURL would not renew it until
other methods that renew tokens are called.
Instead of using the errors to figure out whether IMDSv2 needs to be used,
we return a boolean value for useIMDSv2 from the function itself, and
propagate the error to upstream function calls in the library.
IMDSv2 tokens can be used in all cases, even when IMDSv2 is set to `Optional`
in the EC2 Instance configuration. As such, calls with token will not fail and
we should be able to send IMDSv2 requests with token even when using IMDSv1.
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
Currently, IMDSv2 is not supported by simple-s3's `NewUsingIAM` method, causing it
to fail on EC2 instances with IMDSv2 enabled in the EC2 metadata configuration.
This patch adds a failsafe method that executes PUT request on the IMDSv2 token endpoint,
and based on the response decides whether IMDSv2 support needs to be enabled. Doing so
will not break or require any code-level changes to existing deployments, and allows the
same binaries to run on both IMDSv2 enabled and optional instances.
ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-metadata-v2-how-it-works.html
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit adds a defaultHTTPClient to have a timeout of 10s
instead of the one provided by Go. It introduces a few new methods such
as
- FetchAndSetIAMData which is a helper method to be able to use the
custom http client set by the user.
Closes#19
* feat: Adds support for custom metadata
assigning metadata for files will be beneficial to
find files.
ref: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/add-origin-custom-headers.html
* fix: review suggestions by @rhnvrm
- metadata moved to UploadInput as optional field.
- changed x-amz-meta as constant
- changed sprintf to simple string concat
* FIX: changed amazon meta prefix
changed variable name for amazon meta prefix to the top,
prefix variable is exported.
removed redundant comment for metadata
In local setups, such as a Minio [1] instance in a Docker container,
the protocol may not always be HTTPS (like for public production
endpoints), but instead just plain HTTP.
To support this use-case, the user can specify a protocol at the
beginning of the custom endpoint URI (either http:// or https://).
To maintain backwards compatibility, the protocol defaults to HTTPS.
The patch also includes a test case to assert this behavior.
[1] https://hub.docker.com/r/minio/minio