From 8e1048d1427143a377db365ce085ec3f2f68ffdb Mon Sep 17 00:00:00 2001 From: "Javier M. Mellid" Date: Wed, 13 Jan 2016 22:50:33 +0100 Subject: [PATCH] rgw: add AWS4 completion support for RGW_OP_PUT_ACLS Signed-off-by: Javier M. Mellid --- src/rgw/rgw_rest.h | 2 +- src/rgw/rgw_rest_s3.cc | 13 +++++++++++++ src/rgw/rgw_rest_s3.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest.h b/src/rgw/rgw_rest.h index a60d9a7dbc2..e79315f4306 100644 --- a/src/rgw/rgw_rest.h +++ b/src/rgw/rgw_rest.h @@ -245,7 +245,7 @@ public: RGWPutACLs_ObjStore() {} ~RGWPutACLs_ObjStore() {} - int get_params(); + virtual int get_params(); }; class RGWGetCORS_ObjStore : public RGWGetCORS { diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 55ef699b371..ab9f14a5f67 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1713,6 +1713,19 @@ void RGWGetACLs_ObjStore_S3::send_response() s->cio->write(acls.c_str(), acls.size()); } +int RGWPutACLs_ObjStore_S3::get_params() +{ + int ret = RGWPutACLs_ObjStore::get_params(); + if (ret < 0) + s->aws4_auth_needs_complete = false; + if (s->aws4_auth_needs_complete) { + int ret_auth = do_aws4_auth_completion(); + if (ret_auth) + return ret_auth; + } + return ret; +} + int RGWPutACLs_ObjStore_S3::get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss) { RGWAccessControlPolicy_S3 s3policy(s->cct); diff --git a/src/rgw/rgw_rest_s3.h b/src/rgw/rgw_rest_s3.h index e7c500c7451..9fd63b447da 100644 --- a/src/rgw/rgw_rest_s3.h +++ b/src/rgw/rgw_rest_s3.h @@ -226,6 +226,7 @@ public: int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss); void send_response(); + int get_params(); }; class RGWGetCORS_ObjStore_S3 : public RGWGetCORS_ObjStore { -- 2.47.3