Tabnine Logo
IgniteAuthenticationProcessor.updateUser
Code IndexAdd Tabnine to your IDE (free)

How to use
updateUser
method
in
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor

Best Java code snippets using org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor.updateUser (Showing top 15 results out of 315)

origin: apache/ignite

  @Override public Object call() throws Exception {
    grid(0).context().authentication().updateUser("test", "test");
    return null;
  }
}, IgniteException.class,
origin: apache/ignite

  @Override public Object call() throws Exception {
    grid(nodeIdx).context().authentication().updateUser("invalid_name", "test");
    return null;
  }
}, UserManagementException.class, "User doesn't exist");
origin: apache/ignite

grid(0).context().authentication().updateUser(user, "passwd_" + user);
origin: apache/ignite

  /**
   * @param actx Authorization context.
   * @param updNode Node to execute update operation.
   * @param authNode Node to execute authentication.
   * @throws Exception On error.
   */
  private void checkUpdateUser(AuthorizationContext actx, IgniteEx updNode, IgniteEx authNode) throws Exception {
    String newPasswd = randomString(16);

    updNode.context().authentication().updateUser("test", newPasswd);

    AuthorizationContext actxNew = authNode.context().authentication().authenticate("test", newPasswd);

    assertNotNull(actxNew);
    assertEquals("test", actxNew.userName());
  }
}
origin: apache/ignite

/**
 * @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();
}
origin: apache/ignite

authenticationProcessor.updateUser("test"  + i, "passwd_" + i);
origin: apache/ignite

authentication.updateUser(req0.user(), req0.password());
break;
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testDefaultUserUpdate() throws Exception {
  AuthorizationContext.context(actxDflt);
  try {
    // Change from all nodes
    for (int nodeIdx = 0; nodeIdx < NODES_COUNT; ++nodeIdx) {
      grid(nodeIdx).context().authentication().updateUser("ignite", "ignite" + nodeIdx);
      // Check each change from all nodes
      for (int i = 0; i < NODES_COUNT; ++i) {
        AuthorizationContext actx = grid(i).context().authentication().authenticate("ignite", "ignite" + nodeIdx);
        assertNotNull(actx);
        assertEquals("ignite", actx.userName());
      }
    }
  }
  finally {
    AuthorizationContext.clear();
  }
}
origin: apache/ignite

grid(nodeIdx).context().authentication().updateUser("test", "new_password");
grid(nodeIdx).context().authentication().updateUser("test", "test");
origin: apache/ignite

grid(CLI_NODE).context().authentication().updateUser(user, "new_passwd_" + user);
origin: apache/ignite

/**
 * @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");
}
origin: apache/ignite

SqlAlterUserCommand altCmd = (SqlAlterUserCommand)cmd;
ctx.authentication().updateUser(altCmd.userName(), altCmd.password());
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testUserPersistence() throws Exception {
  AuthorizationContext.context(actxDflt);
  try {
    for (int i = 0; i < NODES_COUNT; ++i)
      grid(i).context().authentication().addUser("test" + i , "passwd" + i);
    grid(CLI_NODE).context().authentication().updateUser("ignite", "new_passwd");
    stopAllGrids();
    startGrids(NODES_COUNT);
    for (int i = 0; i < NODES_COUNT; ++i) {
      for (int usrIdx = 0; usrIdx < NODES_COUNT; ++usrIdx) {
        AuthorizationContext actx0 = grid(i).context().authentication()
          .authenticate("test" + usrIdx, "passwd" + usrIdx);
        assertNotNull(actx0);
        assertEquals("test" + usrIdx, actx0.userName());
      }
      AuthorizationContext actx = grid(i).context().authentication()
        .authenticate("ignite", "new_passwd");
      assertNotNull(actx);
      assertEquals("ignite", actx.userName());
    }
  }
  finally {
    AuthorizationContext.clear();
  }
}
origin: org.apache.ignite/ignite-core

authentication.updateUser(req0.user(), req0.password());
break;
origin: org.apache.ignite/ignite-indexing

SqlAlterUserCommand altCmd = (SqlAlterUserCommand)cmd;
ctx.authentication().updateUser(altCmd.userName(), altCmd.password());
org.apache.ignite.internal.processors.authenticationIgniteAuthenticationProcessorupdateUser

Popular methods of IgniteAuthenticationProcessor

  • addUser
    Adds new user.
  • authenticate
    Authenticate user.
  • removeUser
  • addDefaultUser
  • addUserLocal
    Adds new user locally.
  • authenticateOnServer
    Authenticate user.
  • cacheProcessorStarted
    On cache processor started.
  • cancelFutures
  • checkActivate
    Check cluster state.
  • checkEnabled
  • coordinator
    Get current coordinator node.
  • enabled
  • coordinator,
  • enabled,
  • execUserOperation,
  • isLocalNodeCoordinator,
  • isNodeHoldsUsers,
  • onActivate,
  • onAuthenticateRequestMessage,
  • onAuthenticateResponseMessage,
  • onFinishMessage

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now