AssumeRoleResponse response;
response.packedPolicySize = 0;
- //Get the role info which is being assumed
- boost::optional<rgw::ARN> r_arn = rgw::ARN::parse(req.getRoleARN());
- if (r_arn == boost::none) {
- ldpp_dout(dpp, 0) << "Error in parsing role arn: " << req.getRoleARN() << dendl;
- response.retCode = -EINVAL;
+ auto [ret, r] = getRoleInfo(dpp, req.getRoleARN(), y);
+ if (ret < 0) {
+ response.retCode = ret;
return response;
}
- string roleId = role->get_id();
- uint64_t roleMaxSessionDuration = role->get_max_session_duration();
+ boost::optional<rgw::ARN> r_arn = rgw::ARN::parse(req.getRoleARN());
+
+ string roleId = r->get_id();
+ uint64_t roleMaxSessionDuration = r->get_max_session_duration();
req.setMaxDuration(roleMaxSessionDuration);
//Validate input