S3: add context aware action resolution (#7479)
* add context aware action resolution * isAnonymous * add s3 action resolver * refactor * correct action name * no need for action copy object * Simplify by removing the method-action mismatch path * use PUT instead of DELETE action * refactor * constants * versionId vs versions * address comments * comment * adjust messages * ResolveS3Action * address comments * refactor * simplify * more checks * not needed * simplify
This commit is contained in:
@@ -294,7 +294,7 @@ func TestDetermineGranularS3Action(t *testing.T) {
|
||||
objectKey: "",
|
||||
queryParams: map[string]string{"uploads": ""},
|
||||
fallbackAction: s3_constants.ACTION_LIST,
|
||||
expected: "s3:ListMultipartUploads",
|
||||
expected: "s3:ListBucketMultipartUploads",
|
||||
description: "List multipart uploads in bucket",
|
||||
},
|
||||
|
||||
@@ -336,8 +336,8 @@ func TestDetermineGranularS3Action(t *testing.T) {
|
||||
}
|
||||
req.URL.RawQuery = query.Encode()
|
||||
|
||||
// Test the granular action determination
|
||||
result := determineGranularS3Action(req, tt.fallbackAction, tt.bucket, tt.objectKey)
|
||||
// Test the action determination
|
||||
result := ResolveS3Action(req, string(tt.fallbackAction), tt.bucket, tt.objectKey)
|
||||
|
||||
assert.Equal(t, tt.expected, result,
|
||||
"Test %s failed: %s. Expected %s but got %s",
|
||||
|
||||
Reference in New Issue
Block a user