Package org.jclouds.sts.domain

Examples of org.jclouds.sts.domain.UserAndSessionCredentials


      //            .credentialsSupplier(Supplier.<Credentials> of(creds)).modules(setupModules()).build();
   }

   @Test
   protected void testCreateFederatedUser() {
      UserAndSessionCredentials user = api.createFederatedUser("Bob", new FederatedUserOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(user.getCredentials());
      assertTrue(user.getUser().getId().contains("Bob"), user + " id incorrect");
      assertTrue(user.getUser().getArn().contains("Bob"), user + " arn incorrect");
      assertTrue(user.getPackedPolicySize() >= 0, user + " policy size negative");
   }
View Full Code Here


   }

   @Test
   protected void testAssumeRole() {
      String arnToAssume = getTestArn();
      UserAndSessionCredentials role = api.assumeRole(arnToAssume, "session",
            new AssumeRoleOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(role.getCredentials());
      assertTrue(role.getUser().getId().contains("session"), role + " id incorrect");
      assertTrue(role.getUser().getArn().contains("session"), role + " arn incorrect");
      assertTrue(role.getPackedPolicySize() >= 0, role + " policy size negative");
   }
View Full Code Here

public class AssumeRoleResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/assume_role.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

public class GetFederationTokenResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/federation_token.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

public class GetFederationTokenResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/federation_token.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

      //            .credentialsSupplier(Supplier.<Credentials> of(creds)).modules(setupModules()).build();
   }

   @Test
   protected void testCreateFederatedUser() {
      UserAndSessionCredentials user = api.createFederatedUser("Bob", new FederatedUserOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(user.getCredentials());
      assertTrue(user.getUser().getId().contains("Bob"), user + " id incorrect");
      assertTrue(user.getUser().getArn().contains("Bob"), user + " arn incorrect");
      assertTrue(user.getPackedPolicySize() >= 0, user + " policy size negative");
   }
View Full Code Here

   }

   @Test
   protected void testAssumeRole() {
      String arnToAssume = getTestArn();
      UserAndSessionCredentials role = api.assumeRole(arnToAssume, "session",
            new AssumeRoleOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(role.getCredentials());
      assertTrue(role.getUser().getId().contains("session"), role + " id incorrect");
      assertTrue(role.getUser().getArn().contains("session"), role + " arn incorrect");
      assertTrue(role.getPackedPolicySize() >= 0, role + " policy size negative");
   }
View Full Code Here

public class AssumeRoleResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/assume_role.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

public class GetFederationTokenResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/federation_token.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

      //            .credentialsSupplier(Supplier.<Credentials> of(creds)).modules(setupModules()).build();
   }

   @Test
   protected void testCreateFederatedUser() {
      UserAndSessionCredentials user = api.createFederatedUser("Bob", new FederatedUserOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(user.getCredentials());
      assertTrue(user.getUser().getId().contains("Bob"), user + " id incorrect");
      assertTrue(user.getUser().getArn().contains("Bob"), user + " arn incorrect");
      assertTrue(user.getPackedPolicySize() >= 0, user + " policy size negative");
   }
View Full Code Here

TOP

Related Classes of org.jclouds.sts.domain.UserAndSessionCredentials

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.