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 08:05:43 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()));

Thanks, could you please clarify, which header do you mean? Authorisation or Date? 
When it comes to Authorisation header, we don't need it at all for SAS Authentication.  That
is why I remove it here. 
Apart from this change, my method does not differ from the original one...
So I think I don't get the point...


-- 
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_r253371770
Mime
View raw message