@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().removeUser("invalid_name"); return null; } }, UserManagementException.class, "User doesn't exist");
@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(nodeIdx).context().authentication().removeUser("test"); return null; } }, IgniteAccessControlException.class, "Operation not allowed: authorized context is empty");
@Override public void run() { AuthorizationContext.context(actxDflt); String user = "test" + usrCnt.getAndIncrement(); try { for (int i = 0; i < ITERATIONS; ++i) { grid(CLI_NODE).context().authentication().addUser(user, "passwd_" + user); grid(CLI_NODE).context().authentication().removeUser(user); } } catch (Exception e) { e.printStackTrace(); fail("Unexpected exception"); } } }, 10, "user-op");
/** * @throws Exception If failed. */ @Test public void testConcurrentAddUpdateRemoveNodeRestartServer() throws Exception { IgniteInternalFuture restartFut = loopServerRestarts(); AuthorizationContext.context(actxDflt); final AtomicInteger usrCnt = new AtomicInteger(); GridTestUtils.runMultiThreaded(() -> { AuthorizationContext.context(actxDflt); String user = "test" + usrCnt.getAndIncrement(); try { while (!restartFut.isDone()) { grid(CLI_NODE).context().authentication().addUser(user, "init"); grid(CLI_NODE).context().authentication().updateUser(user, "passwd_" + user); grid(CLI_NODE).context().authentication().removeUser(user); } } catch (Exception e) { e.printStackTrace(); fail("Unexpected exception on add / remove"); } }, 10, "user-op"); restartFut.get(); }
authentication.removeUser(req0.user()); break;
grid(CLI_NODE).context().authentication().removeUser(user);
/** * @param createNode Node to execute create operation. * @param authNode Node to execute authentication. * @throws Exception On error. */ private void checkAddUpdateRemoveUser(IgniteEx createNode, IgniteEx authNode) throws Exception { createNode.context().authentication().addUser("test", "test"); AuthorizationContext newActx = authNode.context().authentication().authenticate("test", "test"); assertNotNull(newActx); assertEquals("test", newActx.userName()); createNode.context().authentication().updateUser("test", "newpasswd"); newActx = authNode.context().authentication().authenticate("test", "newpasswd"); assertNotNull(newActx); assertEquals("test", newActx.userName()); createNode.context().authentication().removeUser("test"); }
SqlDropUserCommand dropCmd = (SqlDropUserCommand)cmd; ctx.authentication().removeUser(dropCmd.userName());
authentication.removeUser(req0.user()); break;
SqlDropUserCommand dropCmd = (SqlDropUserCommand)cmd; ctx.authentication().removeUser(dropCmd.userName());