Skip to content

Commit 868a8eb

Browse files
authored
Merge pull request ceph#55229 from tobias-urdin/http-error-keystone-issue-admin-token-request
rgw: fix http error check in keystone issue_admin_token_request Reviewed-by: Casey Bodley <[email protected]>
2 parents 3cb0412 + 7edfa3f commit 868a8eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rgw/rgw_keystone.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,18 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp,
211211
token_req.set_url(token_url);
212212

213213
const int ret = token_req.process(y);
214-
if (ret < 0) {
215-
return ret;
216-
}
217214

218215
/* Detect rejection earlier than during the token parsing step. */
219216
if (token_req.get_http_status() ==
220217
RGWGetKeystoneAdminToken::HTTP_STATUS_UNAUTHORIZED) {
221218
return -EACCES;
222219
}
223220

221+
// throw any other http or connection errors
222+
if (ret < 0) {
223+
return ret;
224+
}
225+
224226
if (t.parse(dpp, token_req.get_subject_token(), token_bl,
225227
keystone_version) != 0) {
226228
return -EINVAL;

0 commit comments

Comments
 (0)