]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix: comments from code review 56343/head
authorMarc Singer <marc@singer.services>
Thu, 7 Mar 2024 18:19:11 +0000 (19:19 +0100)
committerCasey Bodley <cbodley@redhat.com>
Wed, 20 Mar 2024 15:03:48 +0000 (11:03 -0400)
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 d6f7a56aba0741f0015b194e9a213272c3fe2836..52e69dae959ca45b6e9621468da278fe07fa78a8 100644 (file)
@@ -895,11 +895,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 df582dd811d29b7d1b8b3c08632753f862a2e724..068dc64114b7a2f35fcb27371c0f2061561bf879 100644 (file)
@@ -5551,19 +5551,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>