Package org.cyclos.impl.access
Interface PasswordServiceLocal
-
- All Superinterfaces:
PasswordService,Service
public interface PasswordServiceLocal extends PasswordService
Local interface forPasswordService
-
-
Field Summary
-
Fields inherited from interface org.cyclos.services.access.PasswordService
MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddValidations(Property property, BasicUser user, String username, PasswordType passwordType, boolean atRegistration)Adds all password validations according to specified password type.voidblockByTries(Password password)Blocks the given password for exceeding triesPair<String,Password>create(BasicUser user, PasswordType passwordType, String password, PasswordStatus status)Creates a password for the given user and password type.booleanexists(BasicUser user, PasswordType passwordType)Returns whether a valid password exists for the given user / password typeDategetExpirationDate(Password password)Returns the expiration date according to the password's type.Pair<Password,PasswordStatus>getPasswordAndStatus(BasicUser user, PasswordType passwordType)Returns the status and the password record for the given user and password type.PasswordDatagetPasswordData(BasicUser user, PasswordType passwordType)Returns thePasswordDatafor the given user and password type.List<PasswordLog>getPasswordLogs(BasicUser user, PasswordType passwordType)Returns the logs for the passwords of the given type and userPropertyAccessgetPropertyAccess(Property<?,?> property, PasswordType passwordType, String value)Returns aPropertyAccessfor a validation suitable for a specific password typePasswordStatusgetRedundantAccessPasswordStatus(BasicUser user, PasswordType type)Returns the redundant password status for the given type.
The redundant statuses are stored directly in the user entity to make authentication faster.Pair<PasswordStatus,Set<PasswordAction>>getStatusAndActions(BasicUser user, PasswordType passwordType)Similar toPasswordService.getData(org.cyclos.model.users.users.UserLocatorVO), but with fewer data and preventing calculating the status twicebooleanisPendingSecurityQuestion()Returns whether the currently authenticated user needs to set a security questionbooleanisUserCanChangePassword(BasicUser user, PasswordType passwordType)Returns if the given user can change the password for the given typebooleanremove(BasicUser user, PasswordType passwordType)Removes the password of the given user and typevoidsetSecurityQuestion(BasicUser user, SetSecurityQuestionDTO params)Sets the securiy question for the given uservoidupdateUser(BasicUser user)Update the redundant password status information on the user-
Methods inherited from interface org.cyclos.services.access.PasswordService
activate, allowActivation, change, changeForgottenPassword, disable, enable, forgotPasswordRequest, generateNew, getChangeForgottenPasswordData, getChangePasswordData, getData, getPasswordData, getSetSecurityQuestionData, requestNewOTP, requestNewOTPForLoginConfirmation, reset, resetAndSend, resetSecurityQuestion, setSecurityQuestion, unblock
-
-
-
-
Method Detail
-
addValidations
void addValidations(Property property, BasicUser user, String username, PasswordType passwordType, boolean atRegistration)
Adds all password validations according to specified password type.- Throws:
IllegalActionException- When the given password type doesn't apply to the given user
-
blockByTries
void blockByTries(Password password)
Blocks the given password for exceeding tries
-
create
Pair<String,Password> create(BasicUser user, PasswordType passwordType, String password, PasswordStatus status)
Creates a password for the given user and password type. When the given password is null, a value is generated if status isPasswordStatus.ACTIVE,PasswordStatus.EXPIRED,PasswordStatus.RESET.- Returns:
- a pair with the plain password value and the Password entity.
- Throws:
IllegalActionException- When the given password type doesn't apply to the given user or the password should be generated
-
exists
boolean exists(BasicUser user, PasswordType passwordType)
Returns whether a valid password exists for the given user / password type
-
getExpirationDate
Date getExpirationDate(Password password)
Returns the expiration date according to the password's type. Null if the password does not expire.
-
getPasswordAndStatus
Pair<Password,PasswordStatus> getPasswordAndStatus(BasicUser user, PasswordType passwordType)
Returns the status and the password record for the given user and password type. The returned status may be different from the one in the password. For example, the password might have never been created (will be null) or there could be one of the calculated statuses, like blocked or expired.
-
getPasswordData
PasswordData getPasswordData(BasicUser user, PasswordType passwordType)
Returns thePasswordDatafor the given user and password type.
-
getPasswordLogs
List<PasswordLog> getPasswordLogs(BasicUser user, PasswordType passwordType)
Returns the logs for the passwords of the given type and user
-
getPropertyAccess
PropertyAccess getPropertyAccess(Property<?,?> property, PasswordType passwordType, String value)
Returns aPropertyAccessfor a validation suitable for a specific password type
-
getRedundantAccessPasswordStatus
PasswordStatus getRedundantAccessPasswordStatus(BasicUser user, PasswordType type)
Returns the redundant password status for the given type.
The redundant statuses are stored directly in the user entity to make authentication faster.
-
getStatusAndActions
Pair<PasswordStatus,Set<PasswordAction>> getStatusAndActions(BasicUser user, PasswordType passwordType)
Similar toPasswordService.getData(org.cyclos.model.users.users.UserLocatorVO), but with fewer data and preventing calculating the status twice
-
isPendingSecurityQuestion
boolean isPendingSecurityQuestion()
Returns whether the currently authenticated user needs to set a security question
-
isUserCanChangePassword
boolean isUserCanChangePassword(BasicUser user, PasswordType passwordType)
Returns if the given user can change the password for the given type
-
remove
boolean remove(BasicUser user, PasswordType passwordType)
Removes the password of the given user and type
-
setSecurityQuestion
void setSecurityQuestion(BasicUser user, SetSecurityQuestionDTO params)
Sets the securiy question for the given user
-
updateUser
void updateUser(BasicUser user)
Update the redundant password status information on the user
-
-