From 77464f96f4d6d9f5a85c5b8c5f1f2fe75016eae8 Mon Sep 17 00:00:00 2001 From: Marko Grujic Date: Thu, 12 Dec 2024 09:50:48 +0100 Subject: [PATCH] Expose disable_config_load opendal S3 option --- crates/iceberg/src/io/storage_s3.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/iceberg/src/io/storage_s3.rs b/crates/iceberg/src/io/storage_s3.rs index 969903b5d7..47893a2a95 100644 --- a/crates/iceberg/src/io/storage_s3.rs +++ b/crates/iceberg/src/io/storage_s3.rs @@ -58,11 +58,17 @@ pub const S3_ASSUME_ROLE_ARN: &str = "client.assume-role.arn"; pub const S3_ASSUME_ROLE_EXTERNAL_ID: &str = "client.assume-role.external-id"; /// Optional session name used to assume an IAM role. pub const S3_ASSUME_ROLE_SESSION_NAME: &str = "client.assume-role.session-name"; -/// Option to skip signing request (e.g. for public buckets/folders) +/// Option to skip signing requests (e.g. for public buckets/folders). pub const S3_ALLOW_ANONYMOUS: &str = "s3.allow-anonymous"; /// Option to skip loading the credential from EC2 metadata (typically used in conjunction with -/// `S3_ALLOW_ANONYMOUS`) +/// `S3_ALLOW_ANONYMOUS`). pub const S3_DISABLE_EC2_METADATA: &str = "s3.disable-ec2-metadata"; +/// Option to skip loading configuration from config file and the env. +pub const S3_DISABLE_CONFIG_LOAD: &str = "s3.disable-config-load"; + +fn is_truthy(value: &str) -> bool { + ["true", "t", "1", "on"].contains(&value) +} /// Parse iceberg props to s3 config. pub(crate) fn s3_config_parse(mut m: HashMap) -> Result { @@ -86,7 +92,7 @@ pub(crate) fn s3_config_parse(mut m: HashMap) -> Result) -> Result