return match_account_or_tenant(role.account_id, role.tenant,
p.get_account());
} else if (p.is_role()) {
- return p.get_id() == role.name // TODO: match path/name
- && p.get_account() == role.tenant;
+ std::string_view no_subuser;
+ // account roles can match both account- and tenant-based arns
+ return match_account_or_tenant(role.account_id, role.tenant, p.get_account())
+ && match_principal(role.path, role.name, no_subuser, p.get_id());
} else if (p.is_assumed_role()) {
string role_session = role.name + "/" + token_attrs.role_session_name; //role/role-session
return p.get_account() == role.tenant
}
r.id = token.roleId;
r.name = role->get_name();
+ r.path = role->get_path();
r.tenant = role->get_tenant();
r.account_id = role->get_account_id();