summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_swift_auth.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-11-26 22:39:38 +0100
committerYehuda Sadeh <yehuda@inktank.com>2014-01-09 23:28:25 +0100
commit0e43ac903d25eaa06669cd84ce5fa7b5dc28b943 (patch)
treedeb68a7b5900eca52e723c1bffa61ef743408e38 /src/rgw/rgw_swift_auth.cc
parentrgw: can set temp url key on user (diff)
downloadceph-0e43ac903d25eaa06669cd84ce5fa7b5dc28b943.tar.xz
ceph-0e43ac903d25eaa06669cd84ce5fa7b5dc28b943.zip
rgw: add optional tenant name for swift urls
In order to maintain compatibility with swift clients that expect the url to also contain a reference to the tenant name, add an optional param (empty by default) that would add it. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Diffstat (limited to 'src/rgw/rgw_swift_auth.cc')
-rw-r--r--src/rgw/rgw_swift_auth.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc
index b42be89b740..9c800c4c2c7 100644
--- a/src/rgw/rgw_swift_auth.cc
+++ b/src/rgw/rgw_swift_auth.cc
@@ -142,6 +142,7 @@ void RGW_SWIFT_Auth_Get::execute()
string swift_url = g_conf->rgw_swift_url;
string swift_prefix = g_conf->rgw_swift_url_prefix;
+ string tenant_path;
if (swift_prefix.size() == 0) {
swift_prefix = DEFAULT_SWIFT_PREFIX;
@@ -199,8 +200,13 @@ void RGW_SWIFT_Auth_Get::execute()
goto done;
}
- s->cio->print("X-Storage-Url: %s/%s/v1\n", swift_url.c_str(),
- swift_prefix.c_str());
+ if (!g_conf->rgw_swift_tenant_name.empty()) {
+ tenant_path = "/AUTH_";
+ tenant_path.append(g_conf->rgw_swift_tenant_name);
+ }
+
+ s->cio->print("X-Storage-Url: %s/%s/v1%s\n", swift_url.c_str(),
+ swift_prefix.c_str(), tenant_path.c_str());
if ((ret = encode_token(s->cct, swift_key->id, swift_key->key, bl)) < 0)
goto done;