@Override public String generate(final List<PasswordPolicy> policies) throws InvalidPasswordRuleConf { List<DefaultPasswordRuleConf> defaultRuleConfs = new ArrayList<>(); policies.stream().forEach(policy -> policy.getRules().forEach(impl -> { try { ImplementationManager.buildPasswordRule(impl).ifPresent(rule -> { if (rule.getConf() instanceof DefaultPasswordRuleConf) { defaultRuleConfs.add((DefaultPasswordRuleConf) rule.getConf()); } }); } catch (Exception e) { LOG.error("Invalid {}, ignoring...", impl, e); } })); DefaultPasswordRuleConf ruleConf = merge(defaultRuleConfs); check(ruleConf); return generate(ruleConf); }
@Override public String generate(final List<PasswordPolicy> policies) throws InvalidPasswordRuleConf { List<DefaultPasswordRuleConf> defaultRuleConfs = new ArrayList<>(); policies.stream().forEach(policy -> policy.getRules().forEach(impl -> { try { ImplementationManager.buildPasswordRule(impl).ifPresent(rule -> { if (rule.getConf() instanceof DefaultPasswordRuleConf) { defaultRuleConfs.add((DefaultPasswordRuleConf) rule.getConf()); } }); } catch (Exception e) { LOG.error("Invalid {}, ignoring...", impl, e); } })); DefaultPasswordRuleConf ruleConf = merge(defaultRuleConfs); check(ruleConf); return generate(ruleConf); }
passwordPolicy.getRules().stream().map(Entity::getKey).collect(Collectors.toList())); } else if (policy instanceof AccountPolicy) { AccountPolicy accountPolicy = AccountPolicy.class.cast(policy);
for (Implementation impl : policy.getRules()) { ImplementationManager.buildPasswordRule(impl).ifPresent(rule -> rule.enforce(user));
passwordPolicy.getRules(). removeIf(implementation -> !passwordPolicyTO.getRules().contains(implementation.getKey())); } else if (policyTO instanceof AccountPolicyTO) {