From: Raja Sharma Date: Tue, 30 Sep 2025 15:46:09 +0000 (+0530) Subject: rgw/sts : get-caller-identity fix#72982 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b1d819e0ed45ac0e23cb7ae14b2379aa07d98148;p=ceph.git rgw/sts : get-caller-identity fix#72982 Tracker: https://tracker.ceph.com/issues/72982 Signed-off-by: Raja Sharma --- 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);