From: Javier M. Mellid Date: Sun, 14 Feb 2016 12:26:02 +0000 (+0100) Subject: rgw: catch up aws4 with the new features X-Git-Tag: v10.1.0~351^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce421725cd323439f3aa03e3bf68ff0eb6c3eb67;p=ceph.git rgw: catch up aws4 with the new features Fix pending conflicts after massive merging. It catches up with SLO, bucket website, bulk deletes and payment request features. Signed-off-by: Javier M. Mellid --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 6f28bb166027..f94c0a485ee2 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -381,6 +381,8 @@ enum RGWOpType { RGW_OP_GET_BUCKET_LOGGING, RGW_OP_GET_BUCKET_VERSIONING, RGW_OP_SET_BUCKET_VERSIONING, + RGW_OP_GET_BUCKET_WEBSITE, + RGW_OP_SET_BUCKET_WEBSITE, RGW_OP_STAT_BUCKET, RGW_OP_CREATE_BUCKET, RGW_OP_DELETE_BUCKET, @@ -398,15 +400,18 @@ enum RGWOpType { RGW_OP_PUT_CORS, RGW_OP_DELETE_CORS, RGW_OP_OPTIONS_CORS, + RGW_OP_GET_REQUEST_PAYMENT, + RGW_OP_SET_REQUEST_PAYMENT, RGW_OP_INIT_MULTIPART, RGW_OP_COMPLETE_MULTIPART, RGW_OP_ABORT_MULTIPART, RGW_OP_LIST_MULTIPART, RGW_OP_LIST_BUCKET_MULTIPARTS, RGW_OP_DELETE_MULTI_OBJ, + RGW_OP_BULK_DELETE, /* rgw specific */ - RGW_OP_ADMIN_SET_METADATA, + RGW_OP_ADMIN_SET_METADATA }; class RGWAccessControlPolicy; @@ -1771,7 +1776,7 @@ extern bool verify_object_permission(struct req_state *s, int perm); * by converting %-escaped strings into characters, etc*/ extern void rgw_uri_escape_char(char c, string& dst); extern bool url_decode(const string& src_str, string& dest_str, bool in_query = false); -extern void url_encode(const string& src, string& dst, bool in_query = false); +extern void url_encode(const string& src, string& dst); /* destination should be CEPH_CRYPTO_HMACSHA1_DIGESTSIZE bytes long */ extern void calc_hmac_sha1(const char *key, int key_len, diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 49cfc4dab89e..4ff45120076c 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2361,7 +2361,7 @@ void RGWPutObj::execute() /* verify signature */ - if (s->aws4_auth_signature != s->aws4_auth_new_signature) { + if (s->aws4_auth->signature != s->aws4_auth->new_signature) { op_ret = -ERR_SIGNATURE_NO_MATCH; ldout(s->cct, 20) << "delayed aws4 auth failed" << dendl; goto done; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index e977166e47f8..72afee8800c1 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3291,7 +3291,8 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s) s->system_request = true; dout(20) << "system request" << dendl; s->info.args.set_system(); - string effective_uid = s->info.args.get(RGW_SYS_PARAM_PREFIX "uid"); + string euid = s->info.args.get(RGW_SYS_PARAM_PREFIX "uid"); + rgw_user effective_uid(euid); RGWUserInfo effective_user; if (!effective_uid.empty()) { int ret = rgw_get_user_info_by_uid(store, effective_uid, effective_user);