]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/sts: correct error code to 400 (from 403)
authorPritha Srivastava <prsrivas@redhat.com>
Thu, 9 Oct 2025 06:05:13 +0000 (11:35 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Fri, 14 Nov 2025 06:20:55 +0000 (11:50 +0530)
for expires sts credentials.

Fixes: https://tracker.ceph.com/issues/73441
Resolves: rhbz#2402526

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_rest_s3.cc

index 728eb36db001c5371f8846607a7e939bdb217536..fa46beea26e920c7e2c8002fd7099ed61fe9dcfe 100644 (file)
@@ -144,6 +144,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ECANCELED, {409, "ConcurrentModification"}},
     { EDQUOT, {507, "InsufficientCapacity"}},
     { ENOSPC, {507, "InsufficientCapacity"}},
+    { ERR_EXPIRED_TOKEN, {400, "ExpiredToken"}},
 });
 
 rgw_http_errors rgw_http_swift_errors({
index 0f7043a7bbe2bff8beb87f0b2d9ca4ad32b65dd4..3367a5739c1280443dde7a5ab8e069f834978600 100644 (file)
@@ -362,7 +362,8 @@ inline constexpr const char* RGW_REST_STS_XMLNS =
 #define ERR_ACCOUNT_EXISTS 2403
 
 #define ERR_RESTORE_ALREADY_IN_PROGRESS 2500
-    
+#define ERR_EXPIRED_TOKEN 2501
+
 #ifndef UINT32_MAX
 #define UINT32_MAX (0xffffffffu)
 #endif
index a6ecb68c7a4b36a0b11f983c8de15331f05ae098..f129b3bbbd5e888d149bb7f0ba9264cb0fcfc8fe 100644 (file)
@@ -7136,7 +7136,7 @@ rgw::auth::s3::STSEngine::authenticate(
         real_clock::time_point now = real_clock::now();
         if (now >= *exp) {
           ldpp_dout(dpp, 0) << "ERROR: Token expired" << dendl;
-          return result_t::reject(-EPERM);
+          return result_t::reject(-ERR_EXPIRED_TOKEN);
         }
       } else {
         ldpp_dout(dpp, 0) << "ERROR: Invalid expiration: " << expiration << dendl;