summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/rgw_common.cc')
-rw-r--r--src/rgw/rgw_common.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc
index 68fb9a29278..6610538542c 100644
--- a/src/rgw/rgw_common.cc
+++ b/src/rgw/rgw_common.cc
@@ -63,6 +63,7 @@ rgw_http_errors rgw_http_s3_errors({
{ ERR_INVALID_DIGEST, {400, "InvalidDigest" }},
{ ERR_BAD_DIGEST, {400, "BadDigest" }},
{ ERR_INVALID_LOCATION_CONSTRAINT, {400, "InvalidLocationConstraint" }},
+ { ERR_ILLEGAL_LOCATION_CONSTRAINT_EXCEPTION, {400, "IllegalLocationConstraintException" }},
{ ERR_ZONEGROUP_DEFAULT_PLACEMENT_MISCONFIGURATION, {400, "ZonegroupDefaultPlacementMisconfiguration" }},
{ ERR_INVALID_BUCKET_NAME, {400, "InvalidBucketName" }},
{ ERR_INVALID_OBJECT_NAME, {400, "InvalidObjectName" }},
@@ -2994,7 +2995,9 @@ void RGWAccessKey::decode_json(JSONObj *obj) {
subuser = user.substr(pos + 1);
}
}
- JSONDecoder::decode_json("active", active, obj);
+ if (bool tmp = false; JSONDecoder::decode_json("active", tmp, obj)) {
+ active = tmp; // update only if "active" is present
+ }
JSONDecoder::decode_json("create_date", create_date, obj);
}
@@ -3204,3 +3207,14 @@ void RGWObjVersionTracker::generate_new_write_ver(CephContext *cct)
append_rand_alpha(cct, write_version.tag, write_version.tag, TAG_LEN);
}
+boost::optional<rgw::IAM::Policy>
+get_iam_policy_from_attr(CephContext* cct,
+ const std::map<std::string, bufferlist>& attrs,
+ const std::string& tenant)
+{
+ if (auto i = attrs.find(RGW_ATTR_IAM_POLICY); i != attrs.end()) {
+ return Policy(cct, &tenant, i->second.to_str(), false);
+ } else {
+ return boost::none;
+ }
+}