Package org.jclouds.domain

Examples of org.jclouds.domain.Credentials


      builder.publicAddresses(filter(addresses, not(IsPrivateIPAddress.INSTANCE)));
      builder.privateAddresses(filter(addresses, IsPrivateIPAddress.INSTANCE));

      // normally, we don't affect the credential store when reading vApps.
      // However, login user, etc, is actually in the metadata, so lets see
      Credentials fromApi = getCredentialsFrom(from);
      if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString()))
         credentialStore.put("node#" + from.getHref().toASCIIString(), fromApi);
      return builder.build();
   }
View Full Code Here


                    if (!credentialsMap.containsKey(stripedKey)) {
                        String identityKey = stripedKey + "/identity";
                        String credentialKey = stripedKey + "/credential";
                        String identity = (String) properties.get(identityKey);
                        String credential = (String) properties.get(credentialKey);
                        Credentials credentials = new Credentials(identity, credential);
                        credentialsMap.put(stripedKey, credentials);
                    }
                }
            }
            save();
View Full Code Here

        }

        public void putAll(Map<? extends String, ? extends Credentials> map) {
            for (Entry<? extends String, ? extends Credentials> entry : map.entrySet()) {
                String s = entry.getKey();
                Credentials credential = entry.getValue();
                put(s, credential);
            }
        }
View Full Code Here

                        if (!credentialsMap.containsKey(stripedKey)) {
                            String identityKey = stripedKey + "/identity";
                            String credentialKey = stripedKey + "/credential";
                            String identity = (String) dictionary.get(identityKey);
                            String credential = (String) dictionary.get(credentialKey);
                            Credentials credentials = new Credentials(identity, credential);
                            credentialsMap.put(stripedKey, credentials);
                        }
                    }
                }
                configuration.update(dictionary);
View Full Code Here

        }

        public void putAll(Map<? extends String, ? extends Credentials> map) {
            for (Map.Entry<? extends String, ? extends Credentials> entry : map.entrySet()) {
                String s = entry.getKey();
                Credentials credential = entry.getValue();
                put(s,credential);
            }
        }
View Full Code Here

      this.creds = checkNotNull(creds, "creds");
   }

   @Override
   public HttpRequest filter(HttpRequest request) throws HttpException {
      Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null");
      if (currentCreds.identity.indexOf(':') == -1) {
         throw new AuthorizationException(String.format("Identity %s does not match format tenantId:username",
               currentCreds.identity), null);
      }
      String tenantId = currentCreds.identity.substring(0, currentCreds.identity.indexOf(':'));
View Full Code Here

      this.creds = creds;
   }

   @Override
   public KeyStore get() {
      Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null");
      String cert = checkNotNull(currentCreds.identity, "credential supplier returned null identity (should be cert)");
      String keyStorePassword = checkNotNull(currentCreds.credential,
            "credential supplier returned null credential (should be keyStorePassword)");
      try {
         KeyStore keyStore = KeyStore.getInstance("PKCS12");
View Full Code Here

      Supplier<PrivateKey> privateKey = injector.getInstance(Key.get(new TypeLiteral<Supplier<PrivateKey>>() {
      }));

      signing_obj = new SignedHeaderAuth(new SignatureWire(),
            Suppliers.ofInstance(new Credentials(USER_ID, PRIVATE_KEY)), privateKey, new Provider<String>() {

               @Override
               public String get() {
                  return TIMESTAMP_ISO8601;
               }
View Full Code Here

         this.authorizeAdminPublicKey = authorizeAdminPublicKey;
         this.installAdminPrivateKey = installAdminPrivateKey;
         this.resetLoginPassword = resetLoginPassword;
         this.cryptFunction = cryptFunction;
         if (adminUsername != null && authorizeAdminPublicKey && adminPrivateKey != null)
            this.adminCredentials = new Credentials(adminUsername, adminPrivateKey);
         else if (adminUsername != null && adminPassword != null) {
            this.adminCredentials = new Credentials(adminUsername, adminPassword);
            // if we're using password make sure we don't auth pubkey and that we don't lock ssh
            this.authorizeAdminPublicKey = false;
            this.lockSsh = false;
         }
         else
View Full Code Here

      this.utils = utils;
   }

   public HttpRequest filter(HttpRequest request) throws HttpException {
      request = replaceDateHeader(request);
      Credentials current = creds.get();
      if (current instanceof SessionCredentials) {
         request = replaceSecurityTokenHeader(request, SessionCredentials.class.cast(current));
      }
      String signature = calculateSignature(createStringToSign(request));
      request = replaceAuthorizationHeader(request, signature);
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.