kylebarron commented on PR #6768:
URL: https://github.com/apache/arrow-rs/pull/6768#issuecomment-2491128100
I also ran some manual testing locally to ensure it works end-to-end, but
not sure if there's any place for them here
```rs
#[tokio::test]
async fn test_get_request_payer() {
let client = AmazonS3Builder::new()
.with_access_key_id("REDACTED")
.with_secret_access_key("REDACTED")
.with_bucket_name("naip-visualization")
.with_region("us-west-2")
.with_request_payer(true)
.build()
.unwrap();
let resp = client.get(&"readme.txt".into()).await.unwrap();
let buf = resp.bytes().await.unwrap();
let s = String::from_utf8(buf.into()).unwrap();
dbg!(s);
}
```
ran successfully and gave:
```
successes:
---- aws::client::tests::test_get_request_payer stdout ----
[src/aws/client.rs:908:9] s = "Visualization NAIP on AWS\n\nThe National
Agriculture Imagery Program (NAIP) acquires aerial imagery during the
agricultural growing seasons in the continental United States. This leaf-on
imagery typically ranges from 60 centimeters to 100 centimeters in resolution.
In the naip-visualization Amazon S3 bucket, you’ll find GeoTIFF 3-band RGB
imagery at source resolution, which has been compressed, tiled, and
cloud-optimized. This data is useful as source for background imagery, or to
use to download a subsampled version of the original.\n\nNAIP is administered
by t
...
```
and
```rs
#[tokio::test]
async fn test_signed_get_request_payer() {
let client = AmazonS3Builder::new()
.with_access_key_id("REDACTED")
.with_secret_access_key("REDACTED")
.with_bucket_name("naip-visualization")
.with_region("us-west-2")
.with_request_payer(true)
.build()
.unwrap();
let url = client
.signed_url(Method::GET, &"readme.txt".into(),
Duration::from_secs(60))
.await
.unwrap();
dbg!(url.to_string());
}
```
gave
https://s3.us-west-2.amazonaws.com/naip-visualization/readme.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=REDACTED%2F20241121%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20241121T131723Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host&x-amz-request-payer=requester&X-Amz-Signature=8b9b548bd41b24a0cdf8eacfbccb3364472efdf5ebf5d9cf943e7c6c23e1d3be
which also worked:
<img width="618" alt="image"
src="https://github.com/user-attachments/assets/ecd4242e-3ae0-4315-a92a-e98b221d3324">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]