Class LockEvents

java.lang.Object
com.iizix.server.user.LockEvents

public final class LockEvents extends Object
The start and the early end of a lock of an account (AccountHold), told ONCE whatever the path it came by (CC-FIX-LOCK-PATHS-AND-RESET, rulings LH-D-6, LH-D-8 and LG-D-4).

The start. The place that counts a wrong password - UserAuthentication.validateUser and validatePasswordSignIn - answers the length of the lock its counted failure started (UserAuthenticationInfo.getHoldMillis(); an attempt during a lock is not counted, so it starts none). Every caller that can start a lock hands that answer to this class:

Until this order a lock started by one of the last three mailed nobody, and the Push API's logged no security event of it at all (IIZI-SRV-LOCK-STARTED-WITHOUT-ATTEMPT-ROW-UNTOLD).

The early end. A completed password reset clears the failed sign-ins with the password it writes (BasicUserInfo.resetPasswordTo, since r20302), which ends a lock: endByReset(BasicUserInfo, boolean, int, SecurityEventLog.Context) logs that as an administrator's Unlock logs it (AdminAccountChanges.endHold); so does an administrator's "Reset & mail password", which ends a lock since CC-FIX-LOCK-SMALLS: endByAdministratorReset(BasicUserInfo, boolean, int).

Nothing here throws to its caller, and nothing changes the answer to the client.

Author:
Christopher Mindus
  • Method Details

    • isStart

      public static boolean isStart(UserAuthenticationInfo info)
      Checks if the answer of a password check says that its counted failure started a lock.
      Parameters:
      info - The answer of the password check, null for none.
      Returns:
      true when a lock started.
    • start

      public static void start(String path, UserAuthenticationInfo info, SecurityEventLog.Context where)
      Logs the security event of a lock that started: one WARNING ACCOUNT_HELD with the account - which the session does not have at this point, so it is put into the context here - and the client's address and place of where. The text says how long the lock lasts and when it ends. Nothing is logged when the answer started no lock. Never throws.
      Parameters:
      path - The path the wrong password came by, for the text: the calling method, or the label of a FailedSignInMails.LockPath.
      info - The answer of the password check, null for none.
      where - Where the attempt came from: its application, device, address and place; null for nothing known.
    • startWithoutAttempt

      public static void startWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, IClientSessionGyro clientGyro)
      Tells the lock a wrong password started on a path of a client session that keeps no failed sign-in for it: the security event now - the session knows its address and place - and the lock mail off the path. Nothing when the answer started no lock. Never throws.
      Parameters:
      path - The path.
      info - The answer of the password check, null for none.
      clientGyro - The client session the wrong password came from, null for none.
    • startWithoutAttempt

      public static void startWithoutAttempt(FailedSignInMails.LockPath path, UserAuthenticationInfo info, InetAddress address)
      Tells the lock a wrong password started on a path WITHOUT a client session - the Push API's HTTP Basic sign-in - that keeps no failed sign-in for it: the security event and the lock mail, both off the path, where the place of the address is looked up. Nothing when the answer started no lock. Never throws.
      Parameters:
      path - The path.
      info - The answer of the password check, null for none.
      address - The client address the wrong password came from, null when unknown.
    • endByReset

      public static void endByReset(BasicUserInfo user, boolean held, int failures, SecurityEventLog.Context where)
      Logs that a completed password reset cleared the failed sign-ins of an account, as an administrator's Unlock logs it: one INFO with the failures cleared, and - when the account was locked - one WARNING security event ACCOUNT_HOLD_ENDED with the account and the client's address and place. Nothing when there were no failures. Never throws.
      Parameters:
      user - The user whose password was reset.
      held - true when the account was locked right before the reset.
      failures - The failed sign-ins the account had right before the reset.
      where - Where the reset was completed from; null for nothing known.
    • endByAdministratorReset

      public static void endByAdministratorReset(BasicUserInfo user, boolean held, int failures)
      Logs that an administrator's "Reset & mail password" (ServerAdmin; PasswordResetMail.resetAndMail with BasicUserInfo.resetPassword(Connection,StringBuilder)) cleared the failed sign-ins of an account with the generated password it wrote, as endByReset(BasicUserInfo, boolean, int, SecurityEventLog.Context) logs it for a completed reset: one INFO with the failures cleared, and - when the account was locked - one WARNING security event ACCOUNT_HOLD_ENDED with the account (CC-FIX-LOCK-SMALLS, ruling LK-D-1). Called once the reset is committed. Nothing when there were no failures. Never throws.
      Parameters:
      user - The user whose password was reset.
      held - true when the account was locked right before the reset.
      failures - The failed sign-ins the account had right before the reset.