From b1d819e0ed45ac0e23cb7ae14b2379aa07d98148 Mon Sep 17 00:00:00 2001 From: Raja Sharma Date: Tue, 30 Sep 2025 21:16:09 +0530 Subject: [PATCH] rgw/sts : get-caller-identity fix#72982 Tracker: https://tracker.ceph.com/issues/72982 Signed-off-by: Raja Sharma --- src/rgw/rgw_auth.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index 0630f36d929e2..ef03956121ac0 100644 --- a/src/rgw/rgw_auth.h +++ b/src/rgw/rgw_auth.h @@ -855,7 +855,12 @@ public: std::optional get_caller_identity() const override { rgw::Partition partition = rgw::Partition::aws; rgw::Service service = rgw::Service::sts; - std::string acct = role.account->id.empty() ? role.tenant : role.account->id; + std::string acct; + if (role.account && !role.account->id.empty()) { + acct = role.account->id; + } else { + acct = role.tenant; + } std::string resource = "assumed-role" + role.path + role.name + "/" + token_attrs.role_session_name; return rgw::ARN(partition, service, "", acct, resource); -- 2.39.5