Currently, this option is not honored and the default (3600s) is used
regardless of whether this option is provided when creating a role:
$ radosgw-admin role create --role-name=myrole --max-session-duration=43200 ...
$ radosgw-admin role get --role-name=myrole | jq '.MaxSessionDuration'
3600
With this commit, the value given by the --max-session-duration is
considered when creating the role. This would reduce the need for
updating the role's max-session-duration using a separate "role update"
radosgw-admin command call after the role is created:
$ radosgw-admin role create --role-name=myrole --max-session-duration=43200 ...
$ radosgw-admin role get --role-name=myrole | jq '.MaxSessionDuration'
43200
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
cerr << "failed to parse policy: " << e.what() << std::endl;
return -EINVAL;
}
- std::unique_ptr<rgw::sal::RGWRole> role = driver->get_role(role_name, tenant, path, assume_role_doc);
+ std::unique_ptr<rgw::sal::RGWRole> role = driver->get_role(role_name, tenant, path,
+ assume_role_doc, max_session_duration);
ret = role->create(dpp(), true, "", null_yield);
if (ret < 0) {
return -ret;