I am trying to connect to my R2 bucket with the rust_s3 package. However, the presigned put and get URLs come up as “Unauthorized” when using then. Is there something wrong with my setup:
let credentials = Credentials::new(
Option::from(<Cloudflare R2 Access Key Id>), // access_key
Option::from(<Cloudflare R2 Secret Access Key>), // secret_key
None,
None,
None,
)
.unwrap();
let region = Region::Custom {
region: "us-east-1",
endpoint: "https://<accountid>.r2.cloudflarestorage.com",
};
Bucket::new(<bucket_name>, region, credentials)
.unwrap()
.with_path_style()