mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 11:56:38 +00:00
fix(admin): authorize cross-user ListServiceAccount with ListServiceAccount (#2640)
This commit is contained in:
@@ -925,11 +925,13 @@ impl Operation for ListServiceAccount {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let target_account = if query.user.as_ref().is_some_and(|v| v != &cred.access_key) {
|
let target_account = if query.user.as_ref().is_some_and(|v| v != &cred.access_key) {
|
||||||
|
// Cross-user listing must be authorized by ListServiceAccounts, matching the
|
||||||
|
// sibling InfoServiceAccount/InfoAccessKey/ListAccessKeysBulk handlers.
|
||||||
if !iam_store
|
if !iam_store
|
||||||
.is_allowed(&Args {
|
.is_allowed(&Args {
|
||||||
account: &cred.access_key,
|
account: &cred.access_key,
|
||||||
groups: &cred.groups,
|
groups: &cred.groups,
|
||||||
action: Action::AdminAction(AdminAction::UpdateServiceAccountAdminAction),
|
action: Action::AdminAction(AdminAction::ListServiceAccountsAdminAction),
|
||||||
bucket: "",
|
bucket: "",
|
||||||
conditions: &get_condition_values(
|
conditions: &get_condition_values(
|
||||||
&req.headers,
|
&req.headers,
|
||||||
|
|||||||
Reference in New Issue
Block a user