From b57d56533aee18cf37e8334207fc8dcd90d455db 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 --- qa/rgw/s3tests-branch.yaml | 4 ++-- src/rgw/rgw_auth.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qa/rgw/s3tests-branch.yaml b/qa/rgw/s3tests-branch.yaml index 8710ce35893..6010312aae9 100644 --- a/qa/rgw/s3tests-branch.yaml +++ b/qa/rgw/s3tests-branch.yaml @@ -1,4 +1,4 @@ overrides: s3tests: - force-branch: ceph-master - # git_remote: https://github.com/ceph/ + force-branch: wip-raja-get-caller-identity-issue + git_remote: https://github.com/ArbitCode/ diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index 0630f36d929..ef03956121a 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