summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ionkin <mionkin@mirantis.com>2016-03-10 20:32:35 +0300
committerMichael Ionkin <mionkin@mirantis.com>2016-03-11 17:59:48 +0300
commita1e4d4ebbe324a12551474195cd6bfb21fc321ad (patch)
tree842ecc2dc62ab6f73776a81f63d35094163fb525
parent69a30cd3b2101881c518c420d8019c89ff61e93f (diff)
Fix sending domain name in swift-client4.0.0.0rc1
This patch fixes the domain_name parameter which is sent incorrectly when using Identity API V3 for swift authentication Change-Id: Ide155d425216a08c1c4d23af7f7bb5496ef4edd3 Closes-Bug: #1540274
Notes
Notes (review): Code-Review+1: lu huichun <huichun.lu@intel.com> Code-Review+2: Vitaly Gridnev <vgridnev@mirantis.com> Code-Review+2: Sergey Reshetnyak <sreshetniak@mirantis.com> Code-Review+2: Trevor McKay <tmckay@redhat.com> Workflow+1: Vitaly Gridnev <vgridnev@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 15 Mar 2016 20:56:55 +0000 Reviewed-on: https://review.openstack.org/291323 Project: openstack/sahara-extra Branch: refs/heads/master
-rw-r--r--hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/auth/PasswordAuthenticationRequestV3.java7
-rw-r--r--hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java2
2 files changed, 4 insertions, 5 deletions
diff --git a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/auth/PasswordAuthenticationRequestV3.java b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/auth/PasswordAuthenticationRequestV3.java
index 5f1d0c9..a84d6ab 100644
--- a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/auth/PasswordAuthenticationRequestV3.java
+++ b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/auth/PasswordAuthenticationRequestV3.java
@@ -47,7 +47,7 @@ public class PasswordAuthenticationRequestV3 extends AuthenticationRequestV3 {
47 public PasswordAuthenticationRequestV3(String projectName, 47 public PasswordAuthenticationRequestV3(String projectName,
48 PasswordCredentialsV3 passwordCreds) { 48 PasswordCredentialsV3 passwordCreds) {
49 this(projectName == null ? null : 49 this(projectName == null ? null :
50 new ScopeWrapper(new ProjectWrapper(projectName)), 50 new ScopeWrapper(new ProjectWrapper(projectName, passwordCreds.domain)),
51 passwordCreds); 51 passwordCreds);
52 } 52 }
53 53
@@ -135,9 +135,8 @@ public class PasswordAuthenticationRequestV3 extends AuthenticationRequestV3 {
135 private final String name; 135 private final String name;
136 private final Map<String, String> domain; 136 private final Map<String, String> domain;
137 137
138 public ProjectWrapper(String projectName) { 138 public ProjectWrapper(String projectName, Map<String, String> domain) {
139 this.domain = new HashMap(); 139 this.domain = domain;
140 this.domain.put("id", "default");
141 this.name = projectName; 140 this.name = projectName;
142 } 141 }
143 142
diff --git a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
index 9c2d0a1..44e44da 100644
--- a/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
+++ b/hadoop-swiftfs/src/main/java/org/apache/hadoop/fs/swift/http/SwiftRestClient.java
@@ -515,7 +515,7 @@ public final class SwiftRestClient {
515 if (trust_id == null) { 515 if (trust_id == null) {
516 if (password != null) { 516 if (password != null) {
517 authRequest = new PasswordAuthenticationRequestV3(tenant, 517 authRequest = new PasswordAuthenticationRequestV3(tenant,
518 new PasswordCredentialsV3(username, password, null)); 518 new PasswordCredentialsV3(username, password, domain_name));
519 } else { 519 } else {
520 authRequest = new TokenAuthenticationRequestV3(apiKey); 520 authRequest = new TokenAuthenticationRequestV3(apiKey);
521 } 521 }