Skip to content

rgw/sts: GetCallerIdentity API - #63672

Merged
ArbitCode merged 2 commits into
ceph:mainfrom
ArbitCode:wip-raja-get-caller-identity
Jul 19, 2025
Merged

ArbitCode merged 2 commits into
ceph:mainfrom
ArbitCode:wip-raja-get-caller-identity

Conversation

@ArbitCode

@ArbitCode ArbitCode commented Jun 3, 2025 •

Copy link
Copy Markdown
Member

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@ArbitCode
ArbitCode requested a review from a team as a code owner June 3, 2025 09:30
@github-actions github-actions Bot added the rgw label Jun 3, 2025
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 3926115 to bc257a7 Compare June 3, 2025 12:30
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
@pritha-srivastava

Copy link
Copy Markdown
Contributor

@cbodley : we found a test case that creates a role in an account here https://github.com/ceph/s3-tests/blob/master/s3tests_boto3/functional/test_iam.py:test_account_role_create. Is there any test case that tests assume role using cross account access (not tenants).

@cbodley

cbodley commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

@cbodley : we found a test case that creates a role in an account here https://github.com/ceph/s3-tests/blob/master/s3tests_boto3/functional/test_iam.py:test_account_role_create. Is there any test case that tests assume role using cross account access (not tenants).

the examples i found:
test_cross_account_role_policy_allow
test_account_role_policy_allow_create_bucket
test_account_role_policy_allow_get_role

@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from bc257a7 to 893e852 Compare June 6, 2025 07:37
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_sts.cc Resolved
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 893e852 to 74de6af Compare June 13, 2025 19:34
@github-actions github-actions Bot added the tests label Jun 13, 2025
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 74de6af to 17d4cc1 Compare June 16, 2025 04:15
Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_rest_account.cc Resolved
Comment thread src/rgw/rgw_rest_account.cc Resolved
Comment thread src/rgw/rgw_rest_account.cc Resolved
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 17d4cc1 to 405a29d Compare June 16, 2025 06:30
@ArbitCode ArbitCode changed the title rgw/sts: GetCallerIndentity And GetAccountSummary rgw/sts: GetCallerIndentity API Jun 16, 2025
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from a2c84e2 to 570749a Compare June 17, 2025 15:47
@pritha-srivastava

Copy link
Copy Markdown
Contributor

Overall the PR looks fine to me.

@cbodley

cbodley commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Overall the PR looks fine to me.

same! but we should add s3test coverage for this API - at least for LocalApplier and RoleApplier cases

@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 570749a to f7a3b8c Compare June 23, 2025 04:11
Comment thread src/rgw/rgw_auth.cc Outdated
Comment on lines 1046 to 1051

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driver->get_user() just allocates a handle, it doesn't load it from the backend - and we shouldn't try to load it here

RemoteApplier::load_acct_info() will have already loaded this 'shadow user' if it exists, or called RemoteApplier::create_account() to make a new one

if get_caller_identity() needs additional information from the RGWUserInfo, load_acct_info() should stash that in a member variable like we do with the account info:

  // account and policies are loaded by load_acct_info()              
  mutable std::optional<RGWAccountInfo> account;

but if we're just trying to be consistent with what we match in RemoteApplier::is_identity(), this alone should be sufficient:

return rgw::ARN(owner_acct_user.id, "user", owner_acct_user.tenant, true);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, but there was a example where driver->get_user() was used RemoteApplier::create_account().

Yes, Below is sufficient.

return rgw::ARN(owner_acct_user.id, "user", owner_acct_user.tenant, true);

@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch 3 times, most recently from cf785ae to 97b0bf9 Compare June 27, 2025 07:18
@ArbitCode ArbitCode self-assigned this Jun 28, 2025
Comment thread src/rgw/rgw_auth.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't RemoteApplier::get_caller_identity be moved to previous commit?

Comment thread src/rgw/rgw_auth.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley : are keystone/ldap users created under accounts? from the comments I see handling for global tenant/implicit tenants only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are keystone/ldap users created under accounts?

no, RemoteApplier::create_account() only creates the 'shadow user' - no 'shadow accounts'

though once a shadow user exists, it is possible to migrate that into an account via https://docs.ceph.com/en/latest/radosgw/account/#migrate-an-existing-user-into-an-account

@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch 2 times, most recently from 65e38fa to abd127c Compare July 14, 2025 05:47
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from abd127c to 64444ba Compare July 14, 2025 05:51
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from 64444ba to abc3e75 Compare July 16, 2025 14:07
@ArbitCode
ArbitCode force-pushed the wip-raja-get-caller-identity branch from abc3e75 to a6e6885 Compare July 16, 2025 14:09
@ArbitCode ArbitCode closed this Jul 18, 2025
@ArbitCode ArbitCode reopened this Jul 18, 2025
@ArbitCode
ArbitCode merged commit 601989d into ceph:main Jul 19, 2025
@ArbitCode
ArbitCode deleted the wip-raja-get-caller-identity branch July 19, 2025 04:01
@ArbitCode ArbitCode mentioned this pull request Jul 21, 2025
5 of 14 tasks
@ArbitCode ArbitCode mentioned this pull request Sep 30, 2025
5 of 14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants