Class UserService

java.lang.Object
io.jenkins.plugins.openmfa.service.UserService

public class UserService extends Object
Service for managing user MFA operations.
  • Constructor Details

    • UserService

      public UserService()
  • Method Details

    • getAllUsersWithMFAStatus

      public Collection<UserInfo> getAllUsersWithMFAStatus()
      Gets all users with their MFA status information.
      Returns:
      Collection of UserMFAInfo objects for all users
    • getEnabledMFACount

      public long getEnabledMFACount()
      Gets the count of users with MFA enabled.
      Returns:
      Number of users with MFA enabled
    • getTotalUserCount

      public long getTotalUserCount()
      Gets the total number of users.
      Returns:
      Total user count
    • getUserMFAInfo

      public UserInfo getUserMFAInfo(User user)
      Gets MFA status information for a specific user.
      Parameters:
      user - The user to get MFA info for
      Returns:
      UserMFAInfo containing the user's MFA status
    • isMFAEnabled

      public boolean isMFAEnabled(User user)
      Checks if a user has MFA enabled.
      Parameters:
      user - The user to check
      Returns:
      true if MFA is enabled, false otherwise
    • resetMFA

      public void resetMFA(User user) throws IOException
      Resets MFA for a user, clearing their secret and disabling MFA.
      Parameters:
      user - The user to reset MFA for
      Throws:
      IOException - if saving the user fails