jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksandra Kharushka <notificati...@github.com>
Subject Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)
Date Mon, 04 Feb 2019 09:26:28 GMT
ak58588 commented on this pull request.



> +   /** 
+   * this filter method is applied only for the cases with SAS Authentication. 
+   * 
+   */
+   public HttpRequest filterSAS(HttpRequest request, String credential) throws HttpException
{
+      String containerName = null;
+      String blobName = null;
+      URI requestUri = request.getEndpoint();
+      try {
+         String[] parametersArray = cutUri(requestUri); 
+         containerName = parametersArray[1];
+         if (parametersArray.length == 3) {
+            blobName = parametersArray[2];
+            return removeAuthorizationHeader(replaceDateHeader(request.toBuilder().endpoint(Uris.uriBuilder(storageUrl).appendPath(containerName).appendPath(blobName).query(credential).build()).build()));
+         } 
+         return removeAuthorizationHeader(replaceDateHeader(request.toBuilder().endpoint(Uris.uriBuilder(storageUrl).appendPath(containerName).query("restype=container&"
+ credential).build()).addHeader("x-ms-version", "2018-03-28").build()));

If you mean **_x-ms-version_** header: I have just tested once again - container manipulations
work fine without this explicit header declaration in this place.
I will just remove it. 

-- 
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/1270#discussion_r253392533
Mime
View raw message