Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)

2019-02-14 Thread Aliaksandra Kharushka
ak58588 commented on this pull request.



> +  assertEquals(module.authSAS(supplier), true);
+   }
+   
+   @Test 
+   void testAuthSasServiceSAS(){
+  Credentials creds = new Credentials(identity, 
"sp=rl=2019-02-14T08:50:26Z=2019-02-15T08:50:26Z=2018-03-28=Ukow8%2GtpQpAiVZBLcWp1%2RSpFq928MAqzp%2BdrdregaB6%3D=b");
+  Supplier supplier = Suppliers.ofInstance(creds);
+  assertEquals(module.authSAS(supplier), true);
+   }
+   
+   @Test 
+   void testAuthSasEmptyString(){
+  Credentials creds = new Credentials(identity, "");
+  Supplier supplier = Suppliers.ofInstance(creds);
+  assertEquals(module.authSAS(supplier), false);
+   }

Thanks a lot for your suggestions, I have changed 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_r256815498

Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)

2019-02-14 Thread Aliaksandra Kharushka
@ak58588 pushed 1 commit.

6785c4790537e0d48218a9028bc62a3308e4b90a  [JCLOUDS-1428] Support for SAS token 
based Authentication for Azure Blob Storage #1270 - added 
AzureBlobHttpApiModuleTest.java with authSAS unit tests


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1270/files/50c973643076e656c48ac330cd67c7ade10aa53b..6785c4790537e0d48218a9028bc62a3308e4b90a


[jira] [Commented] (JCLOUDS-1426) Jclouds does not return all private ip address of aws ec2 instance

2019-02-14 Thread Ignasi Barrera (JIRA)


[ 
https://issues.apache.org/jira/browse/JCLOUDS-1426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16768116#comment-16768116
 ] 

Ignasi Barrera commented on JCLOUDS-1426:
-

Yes. The {{RunningInstance}} object as returned by the AWS API does not provide 
the complete list of addresses, so at the point I linked there are additional 
API calls to be made to fetch the additional NICs the instance may have and get 
their IP addresses. We'd be happy to provide guidance in the jclouds dev 
mailing list or in the slack channel.

> Jclouds does not return all private ip address of aws ec2 instance
> --
>
> Key: JCLOUDS-1426
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1426
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 2.0.3
> Environment: AWS EC2
>Reporter: Dushyant Gupta
>Assignee: Andrea Turli
>Priority: Major
>
> I have made use of apache jclouds library to fetch ec2 instance details. I 
> have attached 2 network interfaces on a single ec2 instance to provide it 2 
> IPs.
> [!https://i.stack.imgur.com/xSHU3.png!|https://i.stack.imgur.com/xSHU3.png]
> But from the following code of jclouds, I see only one IP (of primary 
> interface [eth0]) getting retrieved.
> {{    ComputeService cs = computeContext.getComputeService(); }}
> {{    for (ComputeMetadata cm : cs.listNodes()){ }}
> {{        NodeMetadata nm = (NodeMetadata) cm; }}
> {{        System.out.println(nm); }}
> {{    }}}
>  
> In the output I can see only one IP address:
> {quote}privateAddresses=[172.26.119.234]
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)

2019-02-14 Thread Ignasi Barrera
nacx commented on this pull request.



> +  assertEquals(module.authSAS(supplier), true);
+   }
+   
+   @Test 
+   void testAuthSasServiceSAS(){
+  Credentials creds = new Credentials(identity, 
"sp=rl=2019-02-14T08:50:26Z=2019-02-15T08:50:26Z=2018-03-28=Ukow8%2GtpQpAiVZBLcWp1%2RSpFq928MAqzp%2BdrdregaB6%3D=b");
+  Supplier supplier = Suppliers.ofInstance(creds);
+  assertEquals(module.authSAS(supplier), true);
+   }
+   
+   @Test 
+   void testAuthSasEmptyString(){
+  Credentials creds = new Credentials(identity, "");
+  Supplier supplier = Suppliers.ofInstance(creds);
+  assertEquals(module.authSAS(supplier), false);
+   }

This class has a lot of repeated code. Put all the tokens in an array and 
better use the TestNG data provider to run all tests:

```java
@DataProvider(name = "sas-tokens")
public static Object[][] tokens() {
   return new Object[][] {
  {false, ""},
  {true, 
"sp=rl=2019-02-14T08:50:26Z=2019-02-15T08:50:26Z=2018-03-28=Ukow8%2GtpQpAiVZBLcWp1%2RSpFq928MAqzp%2BdrdregaB6%3D=b"},
  ...
   };
}

@Test(dataProvider = "sas-tokens")
private void testSASAuthentication(boolean expected, String credential) {
   AzureBlobHttpApiModule module = new AzureBlobHttpApiModule();
   Credentials creds = new Credentials("identity", credential);
   assertEquals(module.authSAS(Suppliers.ofInstance(creds)), expected);
}
```

-- 
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#pullrequestreview-203697598

Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)

2019-02-14 Thread Aliaksandra Kharushka
@ak58588 pushed 1 commit.

50c973643076e656c48ac330cd67c7ade10aa53b  [JCLOUDS-1428] Support for SAS token 
based Authentication for Azure Blob Storage #1270 - added 
AzureBlobHttpApiModuleTest.java with authSAS unit tests


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1270/files/38271ce13c42cc31201d2136059265c0b391d405..50c973643076e656c48ac330cd67c7ade10aa53b


Re: [jclouds/jclouds] [JCLOUDS-1428] Support for SAS token based Authentication for Azure Blob Storage (#1270)

2019-02-14 Thread Aliaksandra Kharushka
@ak58588 pushed 1 commit.

38271ce13c42cc31201d2136059265c0b391d405  [JCLOUDS-1428] Support for SAS token 
based Authentication for Azure Blob Storage #1270 - fixed return


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1270/files/416b2e7bb6454c60435336ea537a0b64a407bc8a..38271ce13c42cc31201d2136059265c0b391d405