You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/30 11:14:16 UTC

[GitHub] [arrow-rs] crepererum commented on a diff in pull request #2610: Add IMDSv1 fallback (#2609)

crepererum commented on code in PR #2610:
URL: https://github.com/apache/arrow-rs/pull/2610#discussion_r958345053


##########
object_store/src/aws/credential.rs:
##########
@@ -365,31 +366,39 @@ async fn instance_creds(
     const AWS_EC2_METADATA_TOKEN_HEADER: &str = "X-aws-ec2-metadata-token";
 
     let token_url = format!("{}/latest/api/token", endpoint);
-    let token = client
+
+    let token_result = client
         .request(Method::PUT, token_url)
         .header("X-aws-ec2-metadata-token-ttl-seconds", "600") // 10 minute TTL
         .send_retry(retry_config)
-        .await?
-        .text()
-        .await?;
+        .await;
+
+    let token = match token_result {
+        Ok(t) => Some(t.text().await?),
+        Err(e) if matches!(e.status(), Some(StatusCode::FORBIDDEN)) => {

Review Comment:
   If I understand this correctly, this means a sligthly lower security level. Maybe allowing this should be a client option?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org