1
0
mirror of https://github.com/ceph/ceph synced 2024-12-24 20:33:27 +00:00

Merge pull request from cbodley/wip-64189

rgw/rest: fix url decode of post params for iam/sts/sns

Reviewed-by: Pritha Srivastava <prsrivas@redhat.com>
This commit is contained in:
Casey Bodley 2024-01-29 16:11:52 +00:00 committed by GitHub
commit d7407c4ccb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View File

@ -152,7 +152,7 @@ class RGWPSCreateTopicOp : public RGWOp {
return -EINVAL;
}
// Store topic Policy.
policy_text = url_decode(s->info.args.get("Policy"), true);
policy_text = s->info.args.get("Policy");
if (!policy_text.empty() && !get_policy_from_text(s, policy_text)) {
return -ERR_MALFORMED_DOC;
}
@ -562,7 +562,7 @@ class RGWPSSetTopicAttributesOp : public RGWOp {
return -EINVAL;
}
} else if (attribute_name == "Policy") {
policy_text = url_decode(s->info.args.get("AttributeValue"), true);
policy_text = s->info.args.get("AttributeValue");
if (!policy_text.empty() && !get_policy_from_text(s, policy_text)) {
return -ERR_MALFORMED_DOC;
}

View File

@ -5198,8 +5198,9 @@ void parse_post_action(const std::string& post_body, req_state* s)
if (boost::starts_with(key, "Attributes.")) {
update_attribute_map(t, map);
} else {
constexpr bool in_query = true; // replace '+' with ' '
s->info.args.append(t.substr(0, pos),
url_decode(t.substr(pos+1, t.size() -1)));
url_decode(t.substr(pos+1, t.size() -1), in_query));
}
}
}

View File

@ -92,9 +92,9 @@ uint64_t RGWPutUserPolicy::get_op()
int RGWPutUserPolicy::get_params()
{
policy_name = url_decode(s->info.args.get("PolicyName"), true);
user_name = url_decode(s->info.args.get("UserName"), true);
policy = url_decode(s->info.args.get("PolicyDocument"), true);
policy_name = s->info.args.get("PolicyName");
user_name = s->info.args.get("UserName");
policy = s->info.args.get("PolicyDocument");
if (policy_name.empty() || user_name.empty() || policy.empty()) {
ldpp_dout(this, 20) << "ERROR: one of policy name, user name or policy document is empty"