代码整合优化
This commit is contained in:
+3
-3
@@ -43,9 +43,9 @@ import org.dromara.maxkey.password.onetimepwd.impl.TimeBasedOtpAuthn;
|
||||
import org.dromara.maxkey.password.onetimepwd.token.RedisOtpTokenStore;
|
||||
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
|
||||
import org.dromara.maxkey.persistence.repository.LoginRepository;
|
||||
import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.CnfLdapContextService;
|
||||
import org.dromara.maxkey.persistence.service.HistoryLoginService;
|
||||
import org.dromara.maxkey.persistence.service.PasswordPolicyValidatorService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.dromara.maxkey.schedule.ScheduleAdapterBuilder;
|
||||
import org.quartz.Scheduler;
|
||||
@@ -88,7 +88,7 @@ public class MaxKeyConfig {
|
||||
@Bean
|
||||
JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder") PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
PasswordPolicyValidatorService passwordPolicyValidatorService,
|
||||
LoginRepository loginService,
|
||||
HistoryLoginService historyLoginService,
|
||||
UserInfoService userInfoService,
|
||||
@@ -99,7 +99,7 @@ public class MaxKeyConfig {
|
||||
LdapAuthenticationRealmService ldapRealmService = new LdapAuthenticationRealmService(ldapContextService);
|
||||
return new JdbcAuthenticationRealm(
|
||||
passwordEncoder,
|
||||
passwordPolicyValidator,
|
||||
passwordPolicyValidatorService,
|
||||
loginService,
|
||||
historyLoginService,
|
||||
userInfoService,
|
||||
|
||||
+2
-2
@@ -26,10 +26,10 @@ import org.dromara.maxkey.entity.ChangePassword;
|
||||
import org.dromara.maxkey.entity.Message;
|
||||
import org.dromara.maxkey.entity.cnf.CnfPasswordPolicy;
|
||||
import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.HistorySystemLogsService;
|
||||
import org.dromara.maxkey.persistence.service.CnfPasswordPolicyService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.dromara.maxkey.persistence.service.impl.PasswordPolicyValidatorServiceImpl;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -78,7 +78,7 @@ public class ChangePasswodController {
|
||||
currentUser);
|
||||
return new Message<>();
|
||||
}else {
|
||||
String message = (String) WebContext.getAttribute(PasswordPolicyValidator.PASSWORD_POLICY_VALIDATE_RESULT);
|
||||
String message = (String) WebContext.getAttribute(PasswordPolicyValidatorServiceImpl.PASSWORD_POLICY_VALIDATE_RESULT);
|
||||
logger.info("-message: {}",message);
|
||||
return new Message<>(Message.ERROR,message);
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,8 +22,8 @@ import org.dromara.maxkey.ip2location.IpLocationParser;
|
||||
import org.dromara.maxkey.password.onetimepwd.AbstractOtpAuthn;
|
||||
import org.dromara.maxkey.password.onetimepwd.impl.TimeBasedOtpAuthn;
|
||||
import org.dromara.maxkey.persistence.repository.LoginRepository;
|
||||
import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.HistoryLoginService;
|
||||
import org.dromara.maxkey.persistence.service.PasswordPolicyValidatorService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -42,7 +42,7 @@ public class MaxKeyMgtConfig {
|
||||
JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
PasswordPolicyValidatorService passwordPolicyValidatorService,
|
||||
LoginRepository loginRepository,
|
||||
HistoryLoginService historyLoginService,
|
||||
UserInfoService userInfoService,
|
||||
@@ -51,7 +51,7 @@ public class MaxKeyMgtConfig {
|
||||
|
||||
JdbcAuthenticationRealm authenticationRealm = new JdbcAuthenticationRealm(
|
||||
passwordEncoder,
|
||||
passwordPolicyValidator,
|
||||
passwordPolicyValidatorService,
|
||||
loginRepository,
|
||||
historyLoginService,
|
||||
userInfoService,
|
||||
|
||||
+3
-3
@@ -22,8 +22,8 @@ import org.dromara.maxkey.ip2location.IpLocationParser;
|
||||
import org.dromara.maxkey.password.onetimepwd.AbstractOtpAuthn;
|
||||
import org.dromara.maxkey.password.onetimepwd.impl.TimeBasedOtpAuthn;
|
||||
import org.dromara.maxkey.persistence.repository.LoginRepository;
|
||||
import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.HistoryLoginService;
|
||||
import org.dromara.maxkey.persistence.service.PasswordPolicyValidatorService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -42,7 +42,7 @@ public class MaxKeyOpenApiConfig{
|
||||
JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
PasswordPolicyValidatorService passwordPolicyValidatorService,
|
||||
LoginRepository loginRepository,
|
||||
HistoryLoginService historyLoginService,
|
||||
UserInfoService userInfoService,
|
||||
@@ -51,7 +51,7 @@ public class MaxKeyOpenApiConfig{
|
||||
|
||||
JdbcAuthenticationRealm authenticationRealm = new JdbcAuthenticationRealm(
|
||||
passwordEncoder,
|
||||
passwordPolicyValidator,
|
||||
passwordPolicyValidatorService,
|
||||
loginRepository,
|
||||
historyLoginService,
|
||||
userInfoService,
|
||||
|
||||
Reference in New Issue
Block a user