From: Casey Bodley Date: Wed, 26 Jul 2017 20:24:13 +0000 (-0400) Subject: rgw: add skip_decrypt to RGWRESTConn::get_obj() X-Git-Tag: v12.2.1~61^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b13a1d5ffa00030170bfb0bb944d94f1b011afb3;p=ceph.git rgw: add skip_decrypt to RGWRESTConn::get_obj() this adds a rgwx-skip-decrypt header to requests from RGWRados::fetch_remote_obj() Signed-off-by: Casey Bodley (cherry picked from commit 2a7a5be4b41641cb17fb9127b84ce717ca55d3fe) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index c225046561ca..dd1f5f5244f5 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7583,10 +7583,11 @@ int RGWRados::stat_remote_obj(RGWObjectCtx& obj_ctx, constexpr bool get_op = true; constexpr bool rgwx_stat = true; constexpr bool sync_manifest = true; + constexpr bool skip_decrypt = true; int ret = conn->get_obj(user_id, info, src_obj, pmod, unmod_ptr, dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver, prepend_meta, get_op, rgwx_stat, - sync_manifest, &cb, &in_stream_req); + sync_manifest, skip_decrypt, &cb, &in_stream_req); if (ret < 0) { return ret; } @@ -7758,10 +7759,11 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, static constexpr bool get_op = true; static constexpr bool rgwx_stat = false; static constexpr bool sync_manifest = true; + static constexpr bool skip_decrypt = true; ret = conn->get_obj(user_id, info, src_obj, pmod, unmod_ptr, dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver, prepend_meta, get_op, rgwx_stat, - sync_manifest, &cb, &in_stream_req); + sync_manifest, skip_decrypt, &cb, &in_stream_req); if (ret < 0) { goto set_err_state; } diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index aa3e0c8881f3..d94a5643f340 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -156,7 +156,7 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw const real_time *mod_ptr, const real_time *unmod_ptr, uint32_t mod_zone_id, uint64_t mod_pg_ver, bool prepend_metadata, bool get_op, bool rgwx_stat, - bool sync_manifest, RGWGetDataCB *cb, + bool sync_manifest, bool skip_decrypt, RGWGetDataCB *cb, RGWRESTStreamRWRequest **req) { string url; @@ -175,6 +175,9 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw if (sync_manifest) { params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "sync-manifest", "")); } + if (skip_decrypt) { + params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "skip-decrypt", "")); + } if (!obj.key.instance.empty()) { const string& instance = obj.key.instance; params.push_back(param_pair_t("versionId", instance)); diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index f4a1005b6a3d..e9941856f577 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -94,7 +94,7 @@ public: const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr, uint32_t mod_zone_id, uint64_t mod_pg_ver, bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest, - RGWGetDataCB *cb, RGWRESTStreamRWRequest **req); + bool skip_decrypt, RGWGetDataCB *cb, RGWRESTStreamRWRequest **req); int complete_request(RGWRESTStreamRWRequest *req, string& etag, ceph::real_time *mtime, uint64_t *psize, map& attrs); int get_resource(const string& resource,