]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix http error check in keystone issue_admin_token_request 55229/head
authorTobias Urdin <tobias.urdin@binero.se>
Thu, 18 Jan 2024 08:15:51 +0000 (08:15 +0000)
committerTobias Urdin <tobias.urdin@binero.se>
Thu, 18 Jan 2024 08:15:51 +0000 (08:15 +0000)
This changes so that we don't return before even checking
if the request failed by checking the response code like
was done for other methods in [1].

[1] https://github.com/ceph/ceph/pull/53846

Signed-off-by: Tobias Urdin <tobias.urdin@binero.se>
src/rgw/rgw_keystone.cc

index 7d5264f980eee89a7750274cd1ae1e0b5eecff0d..e6fbeea71b465b467402aff447ce1e54f1513e5b 100644 (file)
@@ -211,9 +211,6 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp,
   token_req.set_url(token_url);
 
   const int ret = token_req.process(y);
-  if (ret < 0) {
-    return ret;
-  }
 
   /* Detect rejection earlier than during the token parsing step. */
   if (token_req.get_http_status() ==
@@ -221,6 +218,11 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp,
     return -EACCES;
   }
 
+  // throw any other http or connection errors
+  if (ret < 0) {
+    return ret;
+  }
+
   if (t.parse(dpp, token_req.get_subject_token(), token_bl,
               keystone_version) != 0) {
     return -EINVAL;