jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-1220 : Managing the header name in the TempAuth (Identity Protocol v1) (#1046)
Date Wed, 04 Jan 2017 22:25:09 GMT
nacx requested changes on this pull request.

Thanks! Looks much better. Just a couple final comments!

> +
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
+/**
+ * Binder to the tempAuthAuthentication
+ *
+ */
+public final class TempAuthBinder implements Binder{
+   @Inject
+   @Named(TEMP_AUTH_HEADER_USER)
+   private String identityHeaderNameUser;
+
+   @Inject
+   @Named(TEMP_AUTH_HEADER_PASS)
+   private String identityHeaderNamePass;

Declare the variables final and use [constructor injection](https://github.com/google/guice/wiki/Injections#constructor-injection).

>     }
 
    static final class AdaptTempAuthResponseToAccess
          implements Function<HttpResponse, Access>, InvocationContext<AdaptTempAuthResponseToAccess>
{
 
+      @Inject
+      @Named(TEMP_AUTH_HEADER_USER)
+      private String identityHeaderNameUser;

Add it to the constructor and declare it final to use constructor injection too.

> @@ -153,7 +156,7 @@ private URI getURI(String headerValue) {
       public AdaptTempAuthResponseToAccess setContext(HttpRequest request) {
          String host = request.getEndpoint().getHost();
          this.host = host;
-         this.username = request.getFirstHeaderOrNull(STORAGE_USER);
+	 this.username = request.getFirstHeaderOrNull(identityHeaderNameUser);

[minor] Fix indentation

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1046#pullrequestreview-15211240
Mime
View raw message