ifs-data-layer/ifs-data-service/src/main/java/org/innovateuk/ifs/authentication/validator/PasswordPolicyValidator.java
/**
     * Validate the password for organisationId, returning a list of errors if one or more exclusions were found
     *
     * @param password
     * @param userResource
     * @return
     */
Validate the password for organisationId, returning a list of errors if one or more exclusions were found
@param password
@param userResource
@return
Validate the password for organisationId returning a list of errors if one or more exclusions were found @param password @param userResource @return
public ServiceResult<Void> validatePassword(String password, UserResource userResource, Long organisationId) {
        List<ServiceResult<Void>> exclusionResults = flattenLists(simpleMap(exclusionRules, rule ->
                simpleMap(exclusionRulePatternGenerators, patternGenerator -> {
                    List<String> excludedWords = rule.exclusionSupplier.apply(new ExclusionRuleTarget(userResource, organisationId));
                    if (rule.mustContainAllExcludedWords) {
                        return checkForExclusionWordsWithinPassword(password, rule, patternGenerator, excludedWords);
                    } else {
                        List<ServiceResult<Void>> results = simpleMap(excludedWords, excludedWord -> checkForExclusionWordsWithinPassword(password, rule, patternGenerator, singletonList(excludedWord)));
                        return returnSuccessOrCollateFailures(results);
                    }
                })
        ));
        return returnSuccessOrCollateFailures(exclusionResults);
    }
public ServiceResult < Void > validatePassword ( String password , UserResource userResource , Long organisationId ) { List < ServiceResult < Void > > exclusionResults = flattenLists ( simpleMap ( exclusionRules , rule -> simpleMap ( exclusionRulePatternGenerators , patternGenerator -> { List < String > excludedWords = rule . exclusionSupplier . apply ( new ExclusionRuleTarget ( userResource , organisationId ) ) ; if ( rule . mustContainAllExcludedWords ) { return checkForExclusionWordsWithinPassword ( password , rule , patternGenerator , excludedWords ) ; } else { List < ServiceResult < Void > > results = simpleMap ( excludedWords , excludedWord -> checkForExclusionWordsWithinPassword ( password , rule , patternGenerator , singletonList ( excludedWord ) ) ) ; return returnSuccessOrCollateFailures ( results ) ; } } ) ) ) ; return returnSuccessOrCollateFailures ( exclusionResults ) ; }
Validate the password for organisationId, returning a list of errors if one or more exclusions were found
 @param password
 @param userResource
 @return
Validate the password for organisationId returning a list of errors if one or more exclusions were found @param password @param userResource @return