You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/05/12 06:03:24 UTC
(opendal) branch main updated: feat(services/s3): support configuring assume role session tags (#7518)
This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 336d7efdb feat(services/s3): support configuring assume role session tags (#7518)
336d7efdb is described below
commit 336d7efdb085cbcef504dc903707ba3b92ed08d1
Author: Yuang Gao <91...@users.noreply.github.com>
AuthorDate: Mon May 11 23:03:17 2026 -0700
feat(services/s3): support configuring assume role session tags (#7518)
---
core/services/s3/src/backend.rs | 10 ++++++++++
core/services/s3/src/config.rs | 3 +++
2 files changed, 13 insertions(+)
diff --git a/core/services/s3/src/backend.rs b/core/services/s3/src/backend.rs
index 97650ccd0..de04e42e2 100644
--- a/core/services/s3/src/backend.rs
+++ b/core/services/s3/src/backend.rs
@@ -204,6 +204,12 @@ impl S3Builder {
self
}
+ /// Set assume_role_session_tags for this backend.
+ pub fn assume_role_session_tags(mut self, tags: HashMap<String, String>) -> Self {
+ self.config.assume_role_session_tags = Some(tags);
+ self
+ }
+
/// Set default storage_class for this backend.
///
/// Available values:
@@ -859,6 +865,10 @@ impl Builder for S3Builder {
if let Some(duration_seconds) = config.assume_role_duration_seconds {
assume_role_provider = assume_role_provider.with_duration_seconds(duration_seconds);
}
+ if let Some(tags) = &config.assume_role_session_tags {
+ assume_role_provider = assume_role_provider
+ .with_tags(tags.iter().map(|(k, v)| (k.clone(), v.clone())).collect());
+ }
provider = ProvideCredentialChain::new().push(assume_role_provider);
}
diff --git a/core/services/s3/src/config.rs b/core/services/s3/src/config.rs
index a15a2107a..658af8b13 100644
--- a/core/services/s3/src/config.rs
+++ b/core/services/s3/src/config.rs
@@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.
+use std::collections::HashMap;
use std::fmt::Debug;
use opendal_core::Configurator;
@@ -104,6 +105,8 @@ pub struct S3Config {
pub role_session_name: Option<String>,
/// assume_role_duration_seconds for this backend.
pub assume_role_duration_seconds: Option<u32>,
+ /// assume_role_session_tags for this backend.
+ pub assume_role_session_tags: Option<HashMap<String, String>>,
/// Disable config load so that opendal will not load config from
/// environment.
///