Class UserService
java.lang.Object
io.jenkins.plugins.openmfa.service.UserService
Service for managing user MFA operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets all users with their MFA status information.longGets the count of users with MFA enabled.longGets the total number of users.getUserMFAInfo(User user) Gets MFA status information for a specific user.booleanisMFAEnabled(User user) Checks if a user has MFA enabled.voidResets MFA for a user, clearing their secret and disabling MFA.
-
Constructor Details
-
UserService
public UserService()
-
-
Method Details
-
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
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
Checks if a user has MFA enabled.- Parameters:
user- The user to check- Returns:
- true if MFA is enabled, false otherwise
-
resetMFA
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
-