|
@ -6,6 +6,7 @@ import ( |
|
|
"github.com/aws/aws-sdk-go/service/s3" |
|
|
"github.com/aws/aws-sdk-go/service/s3" |
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" |
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" |
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" |
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" |
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3account" |
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err" |
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err" |
|
|
"reflect" |
|
|
"reflect" |
|
|
"sync" |
|
|
"sync" |
|
@ -27,8 +28,8 @@ var ( |
|
|
//good entry
|
|
|
//good entry
|
|
|
goodEntryAcp, _ = jsonutil.BuildJSON(&s3.AccessControlPolicy{ |
|
|
goodEntryAcp, _ = jsonutil.BuildJSON(&s3.AccessControlPolicy{ |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Grants: s3_constants.PublicRead, |
|
|
Grants: s3_constants.PublicRead, |
|
|
}) |
|
|
}) |
|
@ -99,8 +100,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: badEntry.Name, |
|
|
Name: badEntry.Name, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: nil, |
|
|
Acl: nil, |
|
|
}, |
|
|
}, |
|
@ -110,8 +111,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: goodEntry.Name, |
|
|
Name: goodEntry.Name, |
|
|
ObjectOwnership: s3_constants.OwnershipBucketOwnerEnforced, |
|
|
ObjectOwnership: s3_constants.OwnershipBucketOwnerEnforced, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: s3_constants.PublicRead, |
|
|
Acl: s3_constants.PublicRead, |
|
|
}, |
|
|
}, |
|
@ -121,8 +122,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: ownershipEmptyStr.Name, |
|
|
Name: ownershipEmptyStr.Name, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: nil, |
|
|
Acl: nil, |
|
|
}, |
|
|
}, |
|
@ -132,8 +133,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: ownershipValid.Name, |
|
|
Name: ownershipValid.Name, |
|
|
ObjectOwnership: s3_constants.OwnershipBucketOwnerEnforced, |
|
|
ObjectOwnership: s3_constants.OwnershipBucketOwnerEnforced, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: nil, |
|
|
Acl: nil, |
|
|
}, |
|
|
}, |
|
@ -143,8 +144,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: acpEmptyStr.Name, |
|
|
Name: acpEmptyStr.Name, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: nil, |
|
|
Acl: nil, |
|
|
}, |
|
|
}, |
|
@ -154,8 +155,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: acpEmptyObject.Name, |
|
|
Name: acpEmptyObject.Name, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: nil, |
|
|
Acl: nil, |
|
|
}, |
|
|
}, |
|
@ -165,8 +166,8 @@ var tcs = []*BucketMetadataTestCase{ |
|
|
Name: acpOwnerNil.Name, |
|
|
Name: acpOwnerNil.Name, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
ObjectOwnership: s3_constants.DefaultOwnershipForExists, |
|
|
Owner: &s3.Owner{ |
|
|
Owner: &s3.Owner{ |
|
|
DisplayName: &AccountAdmin.Name, |
|
|
|
|
|
ID: &AccountAdmin.Id, |
|
|
|
|
|
|
|
|
DisplayName: &s3account.AccountAdmin.Name, |
|
|
|
|
|
ID: &s3account.AccountAdmin.Id, |
|
|
}, |
|
|
}, |
|
|
Acl: make([]*s3.Grant, 0), |
|
|
Acl: make([]*s3.Grant, 0), |
|
|
}, |
|
|
}, |
|
|