Package com.kolich.havalo.entities.types

Examples of com.kolich.havalo.entities.types.KeyPair


        // and access secret.  NOTE: Currently key pair identities
        // always associated with "normal" user roles.  The first
        // admin user is created via the Havalo bootstrap process on
        // first boot.  Only the first admin user has the rights
        // to call this specific API function.
        final KeyPair kp = new KeyPair();
        // Create a base repository for the new access key.  All of
        // the resources associated with this access key will sit
        // under this base repository (some directory on disk).
        createRepository(kp.getKey(), kp);
        return kp;
    }
View Full Code Here


                throw new BootstrapException(msg);
            }
            logger__.debug("Admin API account initialized (uuid=" + adminUUID +
                ", secret=" + abbreviate(adminSecret, 8) + ")");
            // Create a new keypair for the default ADMIN level user.
            final KeyPair adminKeyPair = new KeyPair(new HavaloUUID(adminUUID),
                adminSecret, Arrays.asList(new UserRole[]{ADMIN}));
            // Actually attempt to create a new Repository for the Admin user.
            // This should work, if not, bail the whole app.
            repoManager.createRepository(adminKeyPair.getKey(), adminKeyPair);
            return repoManager;
        } catch (RepositoryCreationException e) {
            // Log in TRACE and continue silently.  This is a normal case,
            // when the admin repo has already been created on firstboot
            // but Havalo is being re-started.
View Full Code Here

    repoManager_ = checkNotNull(repoManager, "Repository manager cannot be null.");
  }
 
  public KeyPair loadKeyPairById(final UUID id) {
    try {
      final KeyPair kp = repoManager_.getRepository(
        new HavaloUUID(id)).getKeyPair();
      if(kp.getSecret() == null) {
        throw new NullorEmptySecretException("Oops, KeyPair secret " +
          "for user (" + id + ") was null or unknown.");
      }
      return kp;
    } catch (Exception e) {
View Full Code Here

            //    Content-Type (from 'Content-Type' request header, optional) + "\n" +
            //    CanonicalizedResource (the part of this request's URL from
            //        the protocol name up to the query string in the first line
            //        of the HTTP request)
            // Call the user details service to load the user data for the UUID.
            final KeyPair userKp = userService_.loadKeyPairById(
                UUID.fromString(accessKey));
            if(userKp == null) {
                throw new AuthenticationException("User service returned " +
                    "null, which is an interface contract violation.");
            }
View Full Code Here

TOP

Related Classes of com.kolich.havalo.entities.types.KeyPair

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.