From dbf86de3561d6741201dbf6f49189766f1bf5963 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 11 Apr 2016 20:33:55 +0200 Subject: [PATCH] rgw: switch from RGWSwift to KeystoneService admin_token/url. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_keystone.cc | 4 ++-- src/rgw/rgw_rest_s3.cc | 6 ++---- src/rgw/rgw_swift.cc | 8 ++++---- src/rgw/rgw_swift.h | 3 ++- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index 431c53a209ce8..538a2cbc847d4 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -384,10 +384,10 @@ int RGWKeystoneTokenCache::RevokeThread::check_revoked() bufferlist bl; RGWGetRevokedTokens req(cct, &bl); - if (RGWSwift::get_keystone_admin_token(cct, token) < 0) { + if (KeystoneService::get_keystone_admin_token(cct, token) < 0) { return -EINVAL; } - if (RGWSwift::get_keystone_url(cct, url) < 0) { + if (KeystoneService::get_keystone_url(cct, url) < 0) { return -EINVAL; } req.append_header("X-Auth-Token", token); diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 1f772376835fa..64d56a5f62775 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -21,9 +21,7 @@ #include "rgw_client_io.h" -/* This header consists several Keystone-related primitives - * we want to reuse here. */ -#include "rgw_swift.h" +#include "rgw_keystone.h" #include // for 'typeid' @@ -2949,7 +2947,7 @@ int RGW_Auth_S3_Keystone_ValidateToken::validate_s3token( /* get authentication token for Keystone. */ string admin_token_id; - int r = RGWSwift::get_keystone_admin_token(cct, admin_token_id); + int r = KeystoneService::get_keystone_admin_token(cct, admin_token_id); if (r < 0) { ldout(cct, 2) << "s3 keystone: cannot get token for keystone access" << dendl; return r; diff --git a/src/rgw/rgw_swift.cc b/src/rgw/rgw_swift.cc index cafb26a5ae4e1..b4ed232531664 100644 --- a/src/rgw/rgw_swift.cc +++ b/src/rgw/rgw_swift.cc @@ -229,10 +229,10 @@ int RGWSwift::check_revoked() bufferlist bl; RGWGetRevokedTokens req(cct, &bl); - if (get_keystone_admin_token(token) < 0) { + if (KeystoneService::get_keystone_admin_token(cct, token) < 0) { return -EINVAL; } - if (get_keystone_url(url) < 0) { + if (KeystoneService::get_keystone_url(cct, url) < 0) { return -EINVAL; } req.append_header("X-Auth-Token", token); @@ -448,9 +448,9 @@ int RGWSwift::validate_keystone_token(RGWRados *store, const string& token, if (url[url.size() - 1] != '/') url.append("/"); std::string admin_token; - if (get_keystone_admin_token(admin_token) < 0) + if (KeystoneService::get_keystone_admin_token(cct, admin_token) < 0) return -EINVAL; - if (get_keystone_url(url) < 0) + if (KeystoneService::get_keystone_url(cct, url) < 0) return -EINVAL; validate.append_header("X-Auth-Token", admin_token); diff --git a/src/rgw/rgw_swift.h b/src/rgw/rgw_swift.h index d41d2cecd4e3c..eb9cc4c2ccdf3 100644 --- a/src/rgw/rgw_swift.h +++ b/src/rgw/rgw_swift.h @@ -10,8 +10,9 @@ #include "rgw_common.h" #include "common/Cond.h" +#include "rgw_keystone.h" + class RGWRados; -class KeystoneToken; struct rgw_swift_auth_info { string auth_groups; -- 2.39.5