]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix: comments from code review 56447/head
authorMarc Singer <marc@singer.services>
Thu, 7 Mar 2024 18:19:11 +0000 (19:19 +0100)
committerMarc Singer <marc@singer.gg>
Sun, 21 Jul 2024 08:08:13 +0000 (10:08 +0200)
Signed-off-by: Marc Singer <marc@singer.services>
(cherry picked from commit b6df68210850a93196d21b926509df53721e17dc)

src/common/options/rgw.yaml.in
src/rgw/rgw_rest_s3.cc

index b908b7bd8a05aed0b5c30a351e1c3969bbb5d4de..f8bb8c343f748dfba100f04e9d20ec1c013668fd 100644 (file)
@@ -874,11 +874,12 @@ options:
 - name: rgw_s3_auth_disable_signature_url
   type: bool
   level: advanced
-  desc: Should authentification with presigned URLs be disabled
+  desc: Should authentication with presigned URLs be disabled
   long_desc: 'If enabled, any request that is presigned with either V2 or V4 signature will be denied'
   default: false
   services:
   - rgw
+  with_legacy: true
 - name: rgw_barbican_url
   type: str
   level: advanced
index c019f0607e713598c89214189fa5a49689d4c464..87410c7b7d45aec5e20466e924d355a4d07c3dd2 100644 (file)
@@ -5439,19 +5439,20 @@ AWSGeneralAbstractor::get_auth_data(const req_state* const s) const
   AwsRoute route;
   std::tie(version, route) = discover_aws_flavour(s->info);
 
-  if (! s->cct->_conf->rgw_s3_auth_disable_signature_url) {
-    if (version == AwsVersion::V2) {
-      return get_auth_data_v2(s);
-    } else if (version == AwsVersion::V4) {
-      return get_auth_data_v4(s, route == AwsRoute::QUERY_STRING);
-    } else {
-      /* FIXME(rzarzynski): handle anon user. */
-      throw -EINVAL;
-    }
-  } else {
-    ldpp_dout(s, 0) << "Presigned URLs are disabled by admin" << dendl;
+  if (s->cct->_conf->rgw_s3_auth_disable_signature_url) {
+    ldpp_dout(s, 10) << "Presigned URLs are disabled by admin" << dendl;
     throw -ERR_PRESIGNED_URL_DISABLED;
   }
+  
+  if (version == AwsVersion::V2) {
+    return get_auth_data_v2(s);
+  } else if (version == AwsVersion::V4) {
+    return get_auth_data_v4(s, route == AwsRoute::QUERY_STRING);
+  } else {
+    /* FIXME(rzarzynski): handle anon user. */
+    throw -EINVAL;
+  }
+
 }
 
 boost::optional<std::string>