larshagencognite commented on code in PR #186:
URL: https://github.com/apache/jclouds/pull/186#discussion_r1365721798


##########
providers/azureblob/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java:
##########
@@ -268,6 +329,51 @@ void appendCanonicalizedResource(HttpRequest request, 
StringBuilder toSign) {
       appendUriPath(request, toSign);
    }
 
+   void appendCanonicalizedResourceForSharedKey(HttpRequest request, 
StringBuilder toSign) {
+      // 1. Beginning with an empty string (""), append a forward slash (/), 
followed by the name of
+      // the identity that owns the resource being accessed.
+      toSign.append("/").append(creds.get().identity);
+      // 2. Append the resource's encoded URI path
+      toSign.append(request.getEndpoint().getRawPath());
+      appendQueryParametersForSharedKey(request, toSign);
+   }
+
+   void appendQueryParametersForSharedKey(HttpRequest request, StringBuilder 
toSign) {
+      // 3. Append each query parameter as a new line
+      Map<String, Multiset<String>> sortedParams = Maps.newTreeMap();
+      if (request.getEndpoint().getQuery() != null) {
+         String[] params = request.getEndpoint().getQuery().split("&");
+         for (String param : params) {

Review Comment:
   The spec says that values should be sorted and joined by `,` if there are 
multiple entries for the same key, how would that work with this splitter?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to