Examples of asHuman()


Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

    AccountStore accountStore = newAccountStore();
   
    accountStore.putAccount(
        new HumanAccountDataImpl(HUMAN_ID, new PasswordDigest("internet".toCharArray())));
    AccountData retrievedAccount = accountStore.getAccount(HUMAN_ID);
    assertTrue(retrievedAccount.asHuman().getPasswordDigest().verify("internet".toCharArray()));
  }

  public final void testRoundtripRobotAccount() throws Exception {
    AccountStore accountStore = newAccountStore();
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

    verify(resp).setStatus(HttpServletResponse.SC_OK);
    ParticipantId participantId = ParticipantId.ofUnsafe("foo@example.com");
    AccountData account = store.getAccount(participantId);
    assertNotNull(account);
    assertTrue(account.asHuman().getPasswordDigest().verify("internet".toCharArray()));
    verify(welcomeBot).greet(eq(participantId));
  }

  public void testRegisterNewUserDisabled() throws Exception {
    attemptToRegister(req, resp, "foo@example.com", "internet", true);
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

    attemptToRegister(req, resp, "zd@example.com", null, false);

    verify(resp).setStatus(HttpServletResponse.SC_OK);
    AccountData account = store.getAccount(ParticipantId.ofUnsafe("zd@example.com"));
    assertNotNull(account);
    assertTrue(account.asHuman().getPasswordDigest().verify("".toCharArray()));
  }

  public void attemptToRegister(
      HttpServletRequest req, HttpServletResponse resp, String address,
      String password, boolean disabledRegistration) throws IOException {
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

        // The account is owned by a robot. Auth failed.
        success = false;
      } else if (password == null) {
        // Null password provided by callback. We require a password (even an empty one).
        success = false;
      } else if (!account.asHuman().getPasswordDigest().verify(password)) {
        // The supplied password doesn't match. Auth failed.
        success = false;
      } else {
        success = true;
      }
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

      return;
    }

    AccountData account = sessionManager.getLoggedInAccount(request.getSession(false));
    if (account != null) {
      String locale = account.asHuman().getLocale();
      if (locale != null) {
        String requestLocale = UrlParameters.getParameters(request.getQueryString()).get("locale");
        if (requestLocale == null) {
          response.sendRedirect(UrlParameters.addParameter(request.getRequestURL().toString(), "locale", locale));
          return;
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

      }
      String locale = URLDecoder.decode(req.getParameter("locale"), "UTF-8");
      AccountData account = accountStore.getAccount(participant);
      HumanAccountData humanAccount;
      if (account != null) {
        humanAccount = account.asHuman();
      } else {
        humanAccount = new HumanAccountDataImpl(participant);
      }
      humanAccount.setLocale(locale);
      accountStore.putAccount(humanAccount);
View Full Code Here

Examples of org.waveprotocol.box.server.account.AccountData.asHuman()

        // The account is owned by a robot. Auth failed.
        success = false;
      } else if (password == null) {
        // Null password provided by callback. We require a password (even an empty one).
        success = false;
      } else if (!account.asHuman().getPasswordDigest().verify(password)) {
        // The supplied password doesn't match. Auth failed.
        success = false;
      } else {
        success = true;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.