feat: add ACL and Lifecycle support

Implements ACL and Lifecycle management capabilities (v0.16.0) including:
- Bucket APIs: PutBucketAcl, GetBucketAcl, PutBucketLifecycle, GetBucketLifecycle, DeleteBucketLifecycle
- Object APIs: PutObjectAcl, GetObjectAcl
- Integration: Support for Canned ACLs (private, public-read, etc.) and Full Access Control Policies
- Lifecycle Configuration: Rules, Filters, Expiration, Transitions

Verified integration with MinIO:
- Note: MinIO returns 501 Not Implemented for Canned ACLs via headers, so tests for those are skipped while Custom ACLs (XML) are fully verified.

Includes comprehensive integration tests covering all operations.
Updated ROADMAP.md to mark v0.16.0 as completed.
This commit is contained in:
Rohan Verma
2025-11-27 17:04:27 +05:30
parent 9219b63613
commit b43fd913ed
5 changed files with 1015 additions and 21 deletions
+13 -13
View File
@@ -17,7 +17,7 @@ func TestVersioning(t *testing.T) {
if err != nil {
t.Fatalf("CreateBucket failed: %v", err)
}
// Cleanup function
defer func() {
// List all versions and delete markers to clean up
@@ -52,25 +52,25 @@ func TestVersioning(t *testing.T) {
}
key := "test-object.txt"
// 3. Upload v1
_, err = s3.FilePut(UploadInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
Body: strings.NewReader("v1"),
Body: strings.NewReader("v1"),
})
if err != nil {
t.Fatalf("FilePut v1 failed: %v", err)
}
// Sleep briefly to ensure timestamp difference (MinIO sometimes has granularity issues)
time.Sleep(1 * time.Second)
// 4. Upload v2
_, err = s3.FilePut(UploadInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
Body: strings.NewReader("v2"),
Body: strings.NewReader("v2"),
})
if err != nil {
t.Fatalf("FilePut v2 failed: %v", err)
@@ -106,7 +106,7 @@ func TestVersioning(t *testing.T) {
// 6. Download v1 specific version
rc, err := s3.FileDownload(DownloadInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
VersionId: v1Id,
})
@@ -121,7 +121,7 @@ func TestVersioning(t *testing.T) {
// 7. Download v2 specific version
rc, err = s3.FileDownload(DownloadInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
VersionId: v2Id,
})
@@ -133,10 +133,10 @@ func TestVersioning(t *testing.T) {
if string(content) != "v2" {
t.Errorf("Expected v2 content 'v2', got '%s'", string(content))
}
// 8. Get Details for v1
details, err := s3.FileDetails(DetailsInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
VersionId: v1Id,
})
@@ -149,7 +149,7 @@ func TestVersioning(t *testing.T) {
// 9. Delete v2 (latest)
err = s3.FileDelete(DeleteInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
VersionId: v2Id,
})
@@ -159,7 +159,7 @@ func TestVersioning(t *testing.T) {
// 10. Verify current object is v1
rc, err = s3.FileDownload(DownloadInput{
Bucket: bucket,
Bucket: bucket,
ObjectKey: key,
})
if err != nil {