Package org.jclouds.domain

Examples of org.jclouds.domain.Credentials


   /**
    * Test loading the credentials by extracting a pk from a PKCS12 keystore.
    */
   public static FGCPCredentials loadFGCPCredentials(String pathToPem) throws IOException, NoSuchAlgorithmException,
         CertificateException, InvalidKeySpecException {
      FGCPCredentialsSupplier loader = new FGCPCredentialsSupplier(ofInstance(new Credentials("foo",
            toStringAndClose(new FileInputStream(pathToPem)))),
            new FGCPCredentialsForCredentials());
      return loader.get();
   }
View Full Code Here


@Test(groups = "unit")
public class OAuthCredentialsSupplierTest {

   @Test(expectedExceptions = AuthorizationException.class)
   public void testAuthorizationExceptionIsThrownOnBadKeys() {
      OAuthCredentialsSupplier supplier = new OAuthCredentialsSupplier(Suppliers.ofInstance(new Credentials("MOMMA",
              "MIA")), new OAuthCredentialsForCredentials("RS256"), "RS256");
      supplier.get();
   }
View Full Code Here

      supplier.get();
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testGSEChildExceptionsPropagateAsAuthorizationException() {
      OAuthCredentialsSupplier supplier = new OAuthCredentialsSupplier(Suppliers.ofInstance(new Credentials("MOMMA",
              "MIA")), new OAuthCredentialsForCredentials("MOMMA"), "MOMMA");
      supplier.get();
   }
View Full Code Here

      supplier.get();
   }

   public void testCredentialsAreLoadedOnRightAlgoAndCredentials() {
      Properties propertied = OAuthTestUtils.defaultProperties(new Properties());
      Credentials validCredentials = new Credentials(propertied.getProperty("oauth.identity"),
              propertied.getProperty("oauth.credential"));
      OAuthCredentialsSupplier supplier = new OAuthCredentialsSupplier(Suppliers.ofInstance(validCredentials),
              new OAuthCredentialsForCredentials("RS256"), "RS256");
      assertNotNull(supplier.get());
   }
View Full Code Here

@Test(groups = "unit")
public class OAuthCredentialsFromPKTest {

   public static OAuthCredentials loadOAuthCredentials() throws IOException, NoSuchAlgorithmException,
         CertificateException, InvalidKeySpecException {
      OAuthCredentialsSupplier loader = new OAuthCredentialsSupplier(ofInstance(new Credentials("foo",
            toStringAndClose(new FileInputStream("src/test/resources/testpk.pem")))), new OAuthCredentialsForCredentials("RS256"), "RS256");
      return loader.get();
   }
View Full Code Here

  }

  private Cluster createTestCluster(String[] ids, String[] roles) {
    checkArgument(ids.length == roles.length, "each ID should have a role");

    Credentials credentials = new Credentials("dummy", "dummy");
    Set<Cluster.Instance> instances = Sets.newHashSet();

    for(int i = 0; i < ids.length; i++) {
      String ip = "127.0.0." + (i + 1);
      instances.add(new Cluster.Instance(credentials,
View Full Code Here

  }

  private Cluster createTestCluster(String[] ids, String[] roles) {
    checkArgument(ids.length == roles.length, "each ID should have a role");

    Credentials credentials = new Credentials("dummy", "dummy");
    Set<Cluster.Instance> instances = Sets.newHashSet();

    for(int i = 0; i < ids.length; i++) {
      String ip = "127.0.0." + (i + 1);
      instances.add(new Cluster.Instance(credentials,
View Full Code Here

    Payload configureScript = newStringPayload(runUrls(clusterSpec.getRunUrlBase(),
      String.format("apache/zookeeper/post-configure -c %s %s",
          clusterSpec.getProvider(),
          servers)));
    // Use private key to run script
    Credentials credentials = new Credentials(
      Iterables.get(nodes, 0).getCredentials().identity,
      clusterSpec.readPrivateKey());
    try {
      LOG.info("Running configuration script");
      computeService.runScriptOnNodesMatching(NodePredicates.runningWithTag(
View Full Code Here

    Payload configureScript = newStringPayload(runUrls(clusterSpec.getRunUrlBase(),
        String.format("apache/cassandra/post-configure -c %s %s",
            clusterSpec.getProvider(),
            servers)));
    // Use private key to run script
    Credentials credentials = new Credentials(
      Iterables.get(nodes, 0).getCredentials().identity,
      clusterSpec.readPrivateKey());

    try {
      LOG.info("Running configuration script");
View Full Code Here

      for (NodeMetadata node : nodes) {
         assertNotNull(node.getProviderId());
         assertNotNull(node.getGroup());
         assertEquals(node.getGroup(), group);
         assertEquals(node.getStatus(), Status.RUNNING);
         Credentials fromStore = view.utils().credentialStore().get("node#" + node.getId());
         assertEquals(fromStore, node.getCredentials());
         assert node.getPublicAddresses().size() >= 1 || node.getPrivateAddresses().size() >= 1 : "no ips in" + node;
         assertNotNull(node.getCredentials());
         if (node.getCredentials().identity != null) {
            assertNotNull(node.getCredentials().identity);
View Full Code Here

TOP

Related Classes of org.jclouds.domain.Credentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.