]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: REST client, don't sign requests if empty key
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 17 Aug 2016 08:44:02 +0000 (01:44 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 7 Oct 2016 17:31:20 +0000 (10:31 -0700)
If key is not passed in, don't try to sign the request.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_client.cc

index 832bd37a908a46b43582a672a935766d2c47dbc1..24ea21dcdb5a1c8ad535dc9bf40626316da90c4a 100644 (file)
@@ -208,6 +208,11 @@ void RGWRESTSimpleRequest::get_params_str(map<string, string>& extra_args, strin
 
 int RGWRESTSimpleRequest::sign_request(RGWAccessKey& key, RGWEnv& env, req_info& info)
 {
+  /* don't sign if no key is provided */
+  if (key.key.empty()) {
+    return 0;
+  }
+
   map<string, string, ltstr_nocase>& m = env.get_map();
 
   if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) {