Examples of UserInformation


Examples of com.googlecode.memwords.domain.UserInformation

    /**
     * Performs the change
     */
    private void doChange() {
        UserInformation userInformation = getContext().getUserInformation();
        Preferences preferences = userInformation.getPreferences();
        TimeZone timeZone = TimeZone.getTimeZone(this.timeZoneId);
        Preferences newPreferences = preferences.withTimeZone(timeZone);
        accountService.changePreferences(userInformation.getUserId(), newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
        getContext().getMessages().add(new ScopedLocalizableMessage(ChangePreferredTimeZoneActionBean.class,
                                                                    "preferredTimeZoneChanged"));
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.UserInformation

        expect(mockCryptoEngine.decrypt(aryEq(account.getEncryptedSecretKey()), same(wrappingKey), aryEq(iv))).andReturn(encryptionKey);
        expect(mockCryptoEngine.bytesToSecretKey(encryptionKey)).andReturn(secretKey);

        replay(mockCryptoEngine);

        UserInformation loginUserInformation = impl.login(userId, masterPassword);
        assertSame(secretKey, loginUserInformation.getEncryptionKey());

        assertNotNull(implWithRealCryptoEngine.login(userId, masterPassword));
        assertNull(implWithRealCryptoEngine.login("userId2", masterPassword));
        assertNull(implWithRealCryptoEngine.login(userId, "masterPassword2"));
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.UserInformation

    }

    @Test
    public void testChangePreferences() {
        String userId = "userId";
        UserInformation userInfoBeforeChange = implWithRealCryptoEngine.createAccount(userId, "masterPassword");
        assertNull(userInfoBeforeChange.getPreferences().getLocale());
        assertEquals(TimeZone.getTimeZone(MwConstants.GMT), userInfoBeforeChange.getPreferences().getTimeZone());
        assertFalse(userInfoBeforeChange.getPreferences().isPasswordsUnmasked());
        Locale newLocale = new Locale("fr", "FR");
        TimeZone newTimeZone = TimeZone.getTimeZone("Europe/Paris");
        implWithRealCryptoEngine.changePreferences(userId,
                                                   new Preferences(newLocale,
                                                                   newTimeZone,
                                                                   true,
                                                                   new PasswordGenerationPreferences(4, false, true, false, true)));
        UserInformation userInfoAfterChange =
            implWithRealCryptoEngine.login(userId, "masterPassword");
        assertEquals(newLocale, userInfoAfterChange.getPreferences().getLocale());
        assertEquals(newTimeZone, userInfoAfterChange.getPreferences().getTimeZone());
        assertTrue(userInfoAfterChange.getPreferences().isPasswordsUnmasked());
        assertEquals(4, userInfoAfterChange.getPreferences().getPasswordGenerationPreferences().getLength());
        assertFalse(userInfoAfterChange.getPreferences().getPasswordGenerationPreferences().isLowerCaseLettersIncluded());
        assertTrue(userInfoAfterChange.getPreferences().getPasswordGenerationPreferences().isUpperCaseLettersIncluded());
        assertFalse(userInfoAfterChange.getPreferences().getPasswordGenerationPreferences().isDigitsIncluded());
        assertTrue(userInfoAfterChange.getPreferences().getPasswordGenerationPreferences().isSpecialCharactersIncluded());
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.UserInformation

    }

    @Test
    public void testDestroyAccount() {
        String userId = "userId";
        UserInformation userInfo = implWithRealCryptoEngine.createAccount(userId, "masterPassword");

        CardService cardService = new CardServiceImpl(em, new CryptoEngineImpl(), null, null);
        Card card =
            cardService.createCard(userId,
                                   new CardDetails("id",
                                                   "name",
                                                   "login",
                                                   "password",
                                                   null,
                                                   null,
                                                   null),
                                   userInfo.getEncryptionKey());

        implWithRealCryptoEngine.destroyAccount(userId);
        Account account = impl.getAccount(userId);
        assertNull(account);
        card = em.find(Card.class, card.getId());
View Full Code Here

Examples of net.relatedwork.server.userHelper.UserInformation

  @Override
  public UserVerifyActionResult execute(UserVerifyAction action,
      ExecutionContext context) throws ActionException {

    UserInformation UIO = new UserInformation(servletContext);
   
    try {
      return UIO.verifyUser(action);
    } catch (VerificationException e) {
      throw new ActionException(e.getMessage());
    }
  }
View Full Code Here

Examples of net.relatedwork.server.userHelper.UserInformation

    // Check login
    String email = loginAction.getEmail();
    String password = loginAction.getPassword();
    SessionInformation SIO = loginAction.getSession();
   
    UserInformation UIO = new UserInformation(servletContext);
   
    try {
      UIO.loginUser(loginAction);
    } catch (LoginException e) {
      throw new ActionException(e.getMessage());
    }
       
    // return LoginResult object with userdata
    SIO = UIO.updateSIO(SIO);
   
        return new LoginActionResult(SIO);
  }
View Full Code Here

Examples of net.relatedwork.server.userHelper.UserInformation

    ServerSIO session = new ServerSIO(newUserAction.getSession());
    session.save();
   
    // Register new user on server
    try {
      UserInformation UIO = new UserInformation(servletContext);
      UIO.registerNewUser(newUserAction);
    } catch (NewUserError e) {
      // something went wrong
      throw new ActionException(e.getMessage());
    }
   
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation

      UserGroupInformation ugi = null;

      if (!head.hasUserInfo()) {
        return null;
      }
      UserInformation userInfoProto = head.getUserInfo();
      String effectiveUser = null;
      if (userInfoProto.hasEffectiveUser()) {
        effectiveUser = userInfoProto.getEffectiveUser();
      }
      String realUser = null;
      if (userInfoProto.hasRealUser()) {
        realUser = userInfoProto.getRealUser();
      }
      if (effectiveUser != null) {
        if (realUser != null) {
          UserGroupInformation realUserUgi =
              UserGroupInformation.createRemoteUser(realUser);
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation

      reloginMaxBackoff = conf.getInt("hbase.security.relogin.maxbackoff", 5000);
      this.remoteId = remoteId;

      ConnectionHeader.Builder builder = ConnectionHeader.newBuilder();
      builder.setServiceName(remoteId.getServiceName());
      UserInformation userInfoPB;
      if ((userInfoPB = getUserInfo(ticket)) != null) {
        builder.setUserInfo(userInfoPB);
      }
      if (this.codec != null) {
        builder.setCellBlockCodecClass(this.codec.getClass().getCanonicalName());
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation

      reloginMaxBackoff = conf.getInt("hbase.security.relogin.maxbackoff", 5000);
      this.remoteId = remoteId;

      ConnectionHeader.Builder builder = ConnectionHeader.newBuilder();
      builder.setServiceName(remoteId.getServiceName());
      UserInformation userInfoPB;
      if ((userInfoPB = getUserInfo(ticket)) != null) {
        builder.setUserInfo(userInfoPB);
      }
      if (this.codec != null) {
        builder.setCellBlockCodecClass(this.codec.getClass().getCanonicalName());
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.