S3: add s3: prefix to x-amz-* condition keys for AWS compatibility (#8765)
AWS S3 policy conditions reference request headers with the s3: namespace prefix (e.g., s3:x-amz-server-side-encryption). The extraction code was storing these headers without the prefix, so bucket policy conditions using the standard AWS key names would never match.
This commit is contained in:
@@ -444,8 +444,8 @@ func TestExtractConditionValuesFromRequest(t *testing.T) {
|
||||
t.Errorf("Expected RequestMethod to be GET, got %v", values["s3:RequestMethod"])
|
||||
}
|
||||
|
||||
if len(values["x-amz-copy-source"]) != 1 || values["x-amz-copy-source"][0] != "source-bucket/source-object" {
|
||||
t.Errorf("Expected X-Amz-Copy-Source header to be extracted, got %v", values["x-amz-copy-source"])
|
||||
if len(values["s3:x-amz-copy-source"]) != 1 || values["s3:x-amz-copy-source"][0] != "source-bucket/source-object" {
|
||||
t.Errorf("Expected X-Amz-Copy-Source header to be extracted with s3: prefix, got %v", values["s3:x-amz-copy-source"])
|
||||
}
|
||||
|
||||
// Check that aws:CurrentTime is properly set
|
||||
|
||||
Reference in New Issue
Block a user