@Override public Object call() throws Exception { grid(0).context().authentication().addUser("test", "test"); return null; } }, IgniteException.class,
@Override public Object call() throws Exception { grid(0).context().authentication().authenticate("test", "test"); return null; } }, IgniteException.class,
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().addUser("test", "new_passwd"); return null; } }, UserManagementException.class, "User already exists");
@Override public Object call() throws Exception { grid(CLI_NODE).context().authentication().addUser("test", ""); return null; } }, UserManagementException.class, "Password is empty");
@Override public Object call() throws Exception { grid(0).context().authentication().authenticate("user1", "password1"); return null; } }, IgniteAccessControlException.class, "The user name or password is incorrect");
@Override public Object call() throws Exception { grid(0).context().authentication().updateUser("test", "test"); return null; } }, IgniteException.class,
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().removeUser("test"); return null; } }, IgniteAccessControlException.class, "User management operations are not allowed for user");
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().authenticate("test", "invalid_password"); return null; } }, IgniteAccessControlException.class, "The user name or password is incorrect");
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().updateUser("invalid_name", "test"); return null; } }, UserManagementException.class, "User doesn't exist");
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().removeUser("invalid_name"); return null; } }, UserManagementException.class, "User doesn't exist");
@Override public Object call() throws Exception { grid(CLI_NODE).context().authentication().addUser(null, "test"); return null; } }, UserManagementException.class, "User name is empty");
@Override public Object call() throws Exception { grid(CLI_NODE).context().authentication().addUser("test", null); return null; } }, UserManagementException.class, "Password is empty");
@Override public Object call() throws Exception { grid(CLI_NODE).context().authentication().addUser( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "a"); return null; } }, UserManagementException.class, "User name is too long");
@Override public Object call() throws Exception { grid(0).context().authentication().removeUser("test"); return null; } }, IgniteException.class,
@Override public Object call() throws Exception { grid(nodeIdx).context().authentication().removeUser("ignite"); return null; } }, IgniteAccessControlException.class, "Default user cannot be removed");
@Override public Object call() throws Exception { grid(CLI_NODE).context().authentication().addUser("test", passwd); return null; } }, UserManagementException.class, "Invalid user name");
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(2); grid(0).cluster().active(true); AuthorizationContext.context(grid(0).context().authentication().authenticate("ignite", "ignite")); grid(0).context().authentication().addUser("another_user", "passwd"); AuthorizationContext.clear(); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(NODES_COUNT); grid(0).cluster().active(true); actxDflt = grid(0).context().authentication().authenticate(User.DFAULT_USER_NAME, "ignite"); assertNotNull(actxDflt); }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true); startGrids(NODES_COUNT); grid(0).cluster().active(true); actxDflt = grid(0).context().authentication().authenticate(User.DFAULT_USER_NAME, "ignite"); assertNotNull(actxDflt); }
/** * @param client Is joining node client. * @throws Exception If failed. */ private void checkNodeJoinDisabled(boolean client) throws Exception { startGrid(configuration(0, true, false)); startGrid(configuration(1, false, client)); grid(0).cluster().active(true); AuthorizationContext actx = grid(1).context().authentication().authenticate("ignite", "ignite"); assertNotNull(actx); assertEquals("ignite", actx.userName()); }