]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw/auth: Fix the return code returned by AuthStrategy,"
authorPritha Srivastava <prsrivas@redhat.com>
Tue, 19 Nov 2024 16:20:58 +0000 (21:50 +0530)
committerJ. Eric Ivancich <ivancich@redhat.com>
Mon, 16 Jun 2025 19:40:54 +0000 (15:40 -0400)
This reverts commit 6f7ef8620e52be776ef633bb962a4309996529df.

the above fix introduced regression for ec2 auth when rgw_s3_auth_order
has local before external.

fixes: https://tracker.ceph.com/issues/68393

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 543fd1041f5684bcf2a68b691f32096bea47c5f3)

src/rgw/rgw_auth.cc
src/rgw/rgw_rest_s3.cc

index 875f65ee915c37b966bf29352034e1e9728e3a47..95d3a39359207b1c9e108002e299c2d4341a5511 100644 (file)
@@ -370,7 +370,7 @@ strategy_handle_rejected(rgw::auth::Engine::result_t&& engine_result,
 
     case Control::FALLBACK:
       /* Don't try next. */
-      return std::make_pair(false, std::move(engine_result));
+      return std::make_pair(false, std::move(strategy_result));
 
     default:
       /* Huh, memory corruption? */
index e0d52a680b6e9f0417cae92b770fae16105bbfcd..ac9ce25a954672cfc88025bebe2dd8b353aca289 100644 (file)
@@ -6281,7 +6281,7 @@ rgw::auth::s3::LocalEngine::authenticate(
   if (driver->get_user_by_access_key(dpp, access_key_id, y, &user) < 0) {
       ldpp_dout(dpp, 5) << "error reading user info, uid=" << access_key_id
               << " can't authenticate" << dendl;
-      return result_t::reject(-ERR_INVALID_ACCESS_KEY);
+      return result_t::deny(-ERR_INVALID_ACCESS_KEY);
   }
   //TODO: Uncomment, when we have a migration plan in place.
   /*else {
@@ -6303,7 +6303,7 @@ rgw::auth::s3::LocalEngine::authenticate(
   const auto iter = user->get_info().access_keys.find(access_key_id);
   if (iter == std::end(user->get_info().access_keys)) {
     ldpp_dout(dpp, 0) << "ERROR: access key not encoded in user info" << dendl;
-    return result_t::reject(-EPERM);
+    return result_t::deny(-EPERM);
   }
   const RGWAccessKey& k = iter->second;
 
@@ -6327,7 +6327,7 @@ rgw::auth::s3::LocalEngine::authenticate(
   ldpp_dout(dpp, 15) << "compare=" << compare << dendl;
 
   if (compare != 0) {
-    return result_t::reject(-ERR_SIGNATURE_NO_MATCH);
+    return result_t::deny(-ERR_SIGNATURE_NO_MATCH);
   }
 
   auto apl = apl_factory->create_apl_local(