Skip to content

Default headers not signed for CompleteMultipartUpload #708

@jizezhang

Description

@jizezhang

Describe the bug

When doing a multi-part upload with custom default headers, I got error

<Code>AccessDenied</Code><Message>There were headers present in the request which were not signed</Message><HeadersNotSigned>x-amz-source-arn, x-amz-source-account</HeadersNotSigned>

To Reproduce

use object_store::ClientOptions;
use object_store::HeaderMap;
use object_store::ObjectStoreExt;
use object_store::aws::AmazonS3Builder;
use object_store::path::Path;

#[tokio::main]
async fn main() {
    let mut headers = HeaderMap::new();
    headers.insert("x-amz-source-account", "123456789111".parse().unwrap());
    headers.insert(
        "x-amz-source-arn",
        "arn:aws:s3:::source-bucket"
            .parse()
            .unwrap(),
    );

    let client = AmazonS3Builder::from_env()
        .with_bucket_name("bucket-name")
        .with_region("us-east-1")
        .with_client_options(ClientOptions::new().with_default_headers(headers))
        .build()
        .unwrap();

    let mut upload = client.put_multipart(&Path::from("test-mpu")).await.unwrap();
    let res = upload.complete().await.unwrap();
    println!("Upload complete: {:?}", res);
}

Expected behavior

Headers are signed. No error.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions