mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-06 17:08:29 +08:00
springBootVersion =3.3.0
This commit is contained in:
parent
e8057b4661
commit
aed97e114f
@ -27,21 +27,21 @@ jibToAuthPassword =docker registry credential
|
||||
|
||||
#maxkey used jars version
|
||||
#spring
|
||||
springVersion =6.0.19
|
||||
springBootVersion =3.1.11
|
||||
springSecurityVersion =6.1.9
|
||||
springDataVersion =3.1.11
|
||||
springkafkaVersion =3.0.13
|
||||
springVersion =6.1.8
|
||||
springBootVersion =3.3.0
|
||||
springSecurityVersion =6.3.0
|
||||
springDataVersion =3.3.0
|
||||
springkafkaVersion =3.2.0
|
||||
springretryVersion =1.3.3
|
||||
#spring plugin
|
||||
springplugincoreVersion =3.0.0
|
||||
springpluginmetadataVersion =3.0.0
|
||||
#spring cloud
|
||||
springcloudVersion =4.0.4
|
||||
springcloudVersion =4.1.2
|
||||
#spring cloud alibaba
|
||||
springcloudalibabaVersion =2022.0.0.0
|
||||
springcloudalibabaVersion =2023.0.1.0
|
||||
springcloudalibabaspringVersion =1.0.11
|
||||
springcloudalibabacsplVersion =1.8.5
|
||||
springcloudalibabacsplVersion =1.8.7
|
||||
alibabanacosclientVersion =2.2.3
|
||||
#Apache commons
|
||||
commonsbeanutilsVersion =1.9.4
|
||||
@ -51,7 +51,7 @@ commonscollections4Version =4.4
|
||||
commonscompressVersion =1.21
|
||||
commonscsvVersion =1.7
|
||||
commonstextVersion =1.9
|
||||
commonsdbcp2Version =2.9.0
|
||||
commonsdbcp2Version =2.12.0
|
||||
commonsdbutilsVersion =1.7
|
||||
commonsdigester3Version =3.2
|
||||
commonsdigesterVersion =2.1
|
||||
@ -80,7 +80,7 @@ poiVersion =5.2.3
|
||||
tomcatVersion =10.1.23
|
||||
#logs
|
||||
log4jVersion =2.23.1
|
||||
slf4jVersion =2.0.11
|
||||
slf4jVersion =2.0.13
|
||||
jbossloggingVersion =3.5.3.Final
|
||||
#Messaging Kafka & RocketMQ
|
||||
kafkaclientsVersion =3.4.0
|
||||
@ -103,13 +103,13 @@ minidevjsonsmartVersion =2.4.5
|
||||
mysqlconnectorjavaVersion =8.4.0
|
||||
dm8JdbcDriverVersion =8.1.2.192
|
||||
postgresqlVersion =42.4.1
|
||||
druidVersion =1.2.22
|
||||
druidspringbootstarterVersion =1.2.22
|
||||
druidVersion =1.2.23
|
||||
druidspringbootstarterVersion =1.2.23
|
||||
jedisVersion =4.3.2
|
||||
caffeineVersion =3.1.8
|
||||
hibernateVersion =7.0.5.Final
|
||||
mybatisVersion =3.5.16
|
||||
mybatisspringVersion =3.0.2
|
||||
mybatisspringVersion =3.0.3
|
||||
mybatisjpaextraVersion =3.2
|
||||
#saml
|
||||
opensamlVersion =2.6.6
|
||||
|
||||
@ -47,9 +47,9 @@ public class AuthnProviderAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public AbstractAuthenticationProvider authenticationProvider(
|
||||
AbstractAuthenticationProvider normalAuthenticationProvider,
|
||||
AbstractAuthenticationProvider mobileAuthenticationProvider,
|
||||
AbstractAuthenticationProvider trustedAuthenticationProvider
|
||||
NormalAuthenticationProvider normalAuthenticationProvider,
|
||||
MobileAuthenticationProvider mobileAuthenticationProvider,
|
||||
TrustedAuthenticationProvider trustedAuthenticationProvider
|
||||
) {
|
||||
AuthenticationProviderFactory authenticationProvider = new AuthenticationProviderFactory();
|
||||
authenticationProvider.addAuthenticationProvider(normalAuthenticationProvider);
|
||||
@ -60,7 +60,7 @@ public class AuthnProviderAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbstractAuthenticationProvider normalAuthenticationProvider(
|
||||
public NormalAuthenticationProvider normalAuthenticationProvider(
|
||||
AbstractAuthenticationRealm authenticationRealm,
|
||||
ApplicationConfig applicationConfig,
|
||||
SessionManager sessionManager,
|
||||
@ -76,7 +76,7 @@ public class AuthnProviderAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbstractAuthenticationProvider mobileAuthenticationProvider(
|
||||
public MobileAuthenticationProvider mobileAuthenticationProvider(
|
||||
AbstractAuthenticationRealm authenticationRealm,
|
||||
ApplicationConfig applicationConfig,
|
||||
SmsOtpAuthnService smsAuthnService,
|
||||
@ -92,7 +92,7 @@ public class AuthnProviderAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbstractAuthenticationProvider trustedAuthenticationProvider(
|
||||
public TrustedAuthenticationProvider trustedAuthenticationProvider(
|
||||
AbstractAuthenticationRealm authenticationRealm,
|
||||
ApplicationConfig applicationConfig,
|
||||
SessionManager sessionManager
|
||||
|
||||
@ -26,6 +26,7 @@ import org.dromara.maxkey.crypto.jose.keystore.JWKSetKeyStore;
|
||||
import org.dromara.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -58,7 +59,7 @@ public class JwtAuthnAutoConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
public DefaultJwtSigningAndValidationService jwtLoginValidationService(
|
||||
JWKSetKeyStore jwtLoginJwkSetKeyStore)
|
||||
@Qualifier("jwtLoginJwkSetKeyStore") JWKSetKeyStore jwtLoginJwkSetKeyStore)
|
||||
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
||||
DefaultJwtSigningAndValidationService jwtSignerValidationService =
|
||||
new DefaultJwtSigningAndValidationService(jwtLoginJwkSetKeyStore);
|
||||
@ -76,6 +77,7 @@ public class JwtAuthnAutoConfiguration {
|
||||
public JwtLoginService jwtLoginService(
|
||||
@Value("${maxkey.login.jwt.issuer}")
|
||||
String issuer,
|
||||
@Qualifier("jwtLoginValidationService")
|
||||
DefaultJwtSigningAndValidationService jwtLoginValidationService) {
|
||||
JwtLoginService jwtLoginService = new JwtLoginService(
|
||||
jwtLoginValidationService,
|
||||
|
||||
@ -30,6 +30,7 @@ import org.dromara.maxkey.web.WebInstRequestFilter;
|
||||
import org.dromara.maxkey.web.WebXssRequestFilter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.actuate.endpoint.ApiVersion;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
@ -193,6 +194,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
|
||||
*/
|
||||
@Bean (name = "addConverterRequestMappingHandlerAdapter")
|
||||
public RequestMappingHandlerAdapter requestMappingHandlerAdapter(
|
||||
@Qualifier("mappingJacksonHttpMessageConverter")
|
||||
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
|
||||
MarshallingHttpMessageConverter marshallingHttpMessageConverter,
|
||||
StringHttpMessageConverter stringHttpMessageConverter,
|
||||
@ -217,6 +219,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
|
||||
*/
|
||||
@Bean (name = "restTemplate")
|
||||
public RestTemplate restTemplate(
|
||||
@Qualifier("mappingJacksonHttpMessageConverter")
|
||||
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
|
||||
MarshallingHttpMessageConverter marshallingHttpMessageConverter) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
@ -48,6 +48,7 @@ import org.dromara.maxkey.persistence.repository.LoginRepository;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
@ -75,9 +76,9 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(Oauth20AutoConfiguration.class);
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<Filter> TokenEndpointAuthenticationFilter() {
|
||||
public FilterRegistrationBean<Filter> tokenEndpointAuthenticationFilter() {
|
||||
_logger.debug("TokenEndpointAuthenticationFilter init ");
|
||||
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<Filter>();
|
||||
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
|
||||
registration.setFilter(new TokenEndpointAuthenticationFilter());
|
||||
registration.addUrlPatterns(
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_TOKEN + "/*",
|
||||
@ -93,7 +94,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
* http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued
|
||||
*/
|
||||
@Bean(name = "oidcProviderMetadata")
|
||||
public OIDCProviderMetadataDetails OIDCProviderMetadataDetails(
|
||||
public OIDCProviderMetadataDetails oidcProviderMetadata(
|
||||
@Value("${maxkey.oidc.metadata.issuer}")
|
||||
String issuer,
|
||||
@Value("${maxkey.oidc.metadata.authorizationEndpoint}")
|
||||
@ -133,6 +134,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
*/
|
||||
@Bean(name = "jwtSignerValidationService")
|
||||
public DefaultJwtSigningAndValidationService jwtSignerValidationService(
|
||||
@Qualifier("jwkSetKeyStore")
|
||||
JWKSetKeyStore jwkSetKeyStore)
|
||||
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
||||
DefaultJwtSigningAndValidationService jwtSignerValidationService =
|
||||
@ -152,6 +154,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
*/
|
||||
@Bean(name = "jwtEncryptionService")
|
||||
public DefaultJwtEncryptionAndDecryptionService jwtEncryptionService(
|
||||
@Qualifier("jwkSetKeyStore")
|
||||
JWKSetKeyStore jwkSetKeyStore)
|
||||
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
|
||||
DefaultJwtEncryptionAndDecryptionService jwtEncryptionService =
|
||||
@ -224,7 +227,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
* @return oauth20JdbcClientDetailsService
|
||||
*/
|
||||
@Bean(name = "oauth20JdbcClientDetailsService")
|
||||
public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource,PasswordEncoder passwordReciprocal) {
|
||||
public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource,@Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
|
||||
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
|
||||
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
|
||||
_logger.debug("OAuth 2 Jdbc ClientDetails Service init.");
|
||||
@ -301,6 +304,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
*/
|
||||
@Bean(name = "oauth20UserAuthenticationManager")
|
||||
public ProviderManager oauth20UserAuthenticationManager(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
LoginRepository loginRepository
|
||||
) {
|
||||
@ -323,6 +327,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
|
||||
@Bean(name = "oauth20ClientAuthenticationManager")
|
||||
public ProviderManager oauth20ClientAuthenticationManager(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService,
|
||||
@Qualifier("passwordReciprocal")
|
||||
PasswordEncoder passwordReciprocal
|
||||
) {
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ import org.opensaml.xml.parse.BasicParserPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -108,7 +109,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
|
||||
@Bean(name = "authnResponseGenerator")
|
||||
public AuthnResponseGenerator authnResponseGenerator(TimeService timeService,IDService idService,
|
||||
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
|
||||
_logger.debug("issuerEntityName " + issuerEntityName);
|
||||
_logger.debug("issuerEntityName {}" , issuerEntityName);
|
||||
AuthnResponseGenerator generator = new AuthnResponseGenerator(issuerEntityName,timeService,idService);
|
||||
return generator;
|
||||
}
|
||||
@ -279,7 +280,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
|
||||
*/
|
||||
@Bean(name = "extractPostBindingAdapter")
|
||||
public ExtractPostBindingAdapter extractPostBindingAdapter(OpenHTTPPostDecoder openHTTPPostDecoder,
|
||||
KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
|
||||
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
|
||||
ExtractPostBindingAdapter adapter = new ExtractPostBindingAdapter(openHTTPPostDecoder);
|
||||
adapter.setIssueInstantRule(issueInstantRule);
|
||||
adapter.setKeyStoreLoader(keyStoreLoader);
|
||||
@ -293,7 +294,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
|
||||
*/
|
||||
@Bean(name = "extractRedirectBindingAdapter")
|
||||
public ExtractRedirectBindingAdapter extractRedirectBindingAdapter(OpenHTTPRedirectDecoder openHTTPRedirectDecoder,
|
||||
KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
|
||||
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
|
||||
ExtractRedirectBindingAdapter adapter = new ExtractRedirectBindingAdapter(openHTTPRedirectDecoder);
|
||||
adapter.setIssueInstantRule(issueInstantRule);
|
||||
adapter.setKeyStoreLoader(keyStoreLoader);
|
||||
|
||||
@ -45,6 +45,7 @@ import org.dromara.maxkey.persistence.service.LdapContextService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -98,7 +99,7 @@ public class MaxKeyConfig {
|
||||
//可以在此实现其他的登陆认证方式,请实现AbstractAuthenticationRealm
|
||||
@Bean
|
||||
public JdbcAuthenticationRealm authenticationRealm(
|
||||
PasswordEncoder passwordEncoder,
|
||||
@Qualifier("passwordEncoder") PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
LoginRepository loginService,
|
||||
LoginHistoryRepository loginHistoryService,
|
||||
|
||||
@ -27,6 +27,7 @@ import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@ -39,6 +40,7 @@ public class MaxKeyMgtConfig {
|
||||
//authenticationRealm for MaxKeyMgtApplication
|
||||
@Bean
|
||||
public JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
LoginRepository loginRepository,
|
||||
|
||||
@ -28,6 +28,7 @@ import org.dromara.maxkey.authz.oauth2.provider.token.store.RedisTokenStore;
|
||||
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -47,7 +48,7 @@ public class Oauth20ClientAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public JdbcClientDetailsService oauth20JdbcClientDetailsService(
|
||||
DataSource dataSource,PasswordEncoder passwordReciprocal) {
|
||||
DataSource dataSource , @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
|
||||
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
|
||||
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
|
||||
logger.debug("JdbcClientDetailsService inited.");
|
||||
@ -98,6 +99,7 @@ public class Oauth20ClientAutoConfiguration {
|
||||
@Bean
|
||||
public ProviderManager oauth20ClientAuthenticationManager(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService,
|
||||
@Qualifier("passwordReciprocal")
|
||||
PasswordEncoder passwordReciprocal
|
||||
) {
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ import org.dromara.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@ -39,6 +40,7 @@ public class MaxKeyOpenApiConfig{
|
||||
//authenticationRealm for MaxKeyMgtApplication
|
||||
@Bean
|
||||
public JdbcAuthenticationRealm authenticationRealm(
|
||||
@Qualifier("passwordEncoder")
|
||||
PasswordEncoder passwordEncoder,
|
||||
PasswordPolicyValidator passwordPolicyValidator,
|
||||
LoginRepository loginRepository,
|
||||
|
||||
@ -28,6 +28,7 @@ import org.dromara.maxkey.authz.oauth2.provider.token.store.RedisTokenStore;
|
||||
import org.dromara.maxkey.persistence.redis.RedisConnectionFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -47,7 +48,7 @@ public class Oauth20ClientAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public JdbcClientDetailsService oauth20JdbcClientDetailsService(
|
||||
DataSource dataSource,PasswordEncoder passwordReciprocal) {
|
||||
DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
|
||||
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
|
||||
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
|
||||
logger.debug("JdbcClientDetailsService inited.");
|
||||
@ -98,6 +99,7 @@ public class Oauth20ClientAutoConfiguration {
|
||||
@Bean
|
||||
public ProviderManager oauth20ClientAuthenticationManager(
|
||||
JdbcClientDetailsService oauth20JdbcClientDetailsService,
|
||||
@Qualifier("passwordReciprocal")
|
||||
PasswordEncoder passwordReciprocal
|
||||
) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user