]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sts: correct error code to 400 (from 403) 65847/head
authorPritha Srivastava <prsrivas@redhat.com>
Thu, 9 Oct 2025 06:05:13 +0000 (11:35 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Wed, 25 Mar 2026 03:45:48 +0000 (09:15 +0530)
for expires sts credentials.

Fixes: https://tracker.ceph.com/issues/73441
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 7d102224d872530520a9dd8b6722bf96dc4a2165..faf80be64bc149ca056cb8376602301d45d52abe 100644 (file)
@@ -145,6 +145,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_ACLS_NOT_SUPPORTED, {400, "AccessControlListNotSupported"}},
     { ERR_INVALID_BUCKET_ACL, {400, "InvalidBucketAclWithObjectOwnership"}},
     { ERR_NO_SUCH_OWNERSHIP_CONTROLS, {404, "OwnershipControlsNotFoundError"}},
+    { ERR_EXPIRED_TOKEN, {400, "ExpiredToken"}},
 });
 
 rgw_http_errors rgw_http_swift_errors({
index 40ab41c400ffa2e3093ec8417e0da8d522aede14..8f95f4ef6716971ba1228754ca6569231817c09b 100644 (file)
@@ -368,7 +368,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 909246c221f86004065629a5c6cb7d563f0e7a7a..a90346b6886ad56e602f4bfd3a0308ce781e4333 100644 (file)
@@ -7257,7 +7257,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;