@Bean public to default

This commit is contained in:
shimingxy 2024-08-19 16:24:47 +08:00
parent b7b0cd21c6
commit b6f9828ff7
24 changed files with 291 additions and 291 deletions

View File

@ -40,7 +40,7 @@ public class MvcCurrentUserAutoConfiguration implements WebMvcConfigurer {
}
@Bean
public CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver() {
CurrentUserMethodArgumentResolver currentUserMethodArgumentResolver() {
return new CurrentUserMethodArgumentResolver();
}

View File

@ -37,13 +37,13 @@ public class SessionAutoConfiguration {
@Bean(name = "savedRequestSuccessHandler")
public SavedRequestAwareAuthenticationSuccessHandler
SavedRequestAwareAuthenticationSuccessHandler
savedRequestAwareAuthenticationSuccessHandler() {
return new SavedRequestAwareAuthenticationSuccessHandler();
}
@Bean
public SessionManager sessionManager(
SessionManager sessionManager(
@Value("${maxkey.server.persistence}") int persistence,
JdbcTemplate jdbcTemplate,
RedisConnectionFactory redisConnFactory,
@ -55,7 +55,7 @@ public class SessionAutoConfiguration {
}
@Bean
public HttpSessionListenerAdapter httpSessionListenerAdapter() {
HttpSessionListenerAdapter httpSessionListenerAdapter() {
return new HttpSessionListenerAdapter();
}

View File

@ -40,7 +40,7 @@ public class TokenAutoConfiguration{
LoggerFactory.getLogger(TokenAutoConfiguration.class);
@Bean
public AuthTokenService authTokenService(
AuthTokenService authTokenService(
AuthJwkConfig authJwkConfig,
RedisConnectionFactory redisConnFactory,
MomentaryService momentaryService,
@ -63,7 +63,7 @@ public class TokenAutoConfiguration{
}
@Bean
public AuthRefreshTokenService refreshTokenService(AuthJwkConfig authJwkConfig) throws JOSEException {
AuthRefreshTokenService refreshTokenService(AuthJwkConfig authJwkConfig) throws JOSEException {
return new AuthRefreshTokenService(authJwkConfig);
}

View File

@ -12,7 +12,6 @@ import org.dromara.maxkey.authn.session.SessionManager;
import org.dromara.maxkey.constants.ConstsLoginType;
import org.dromara.maxkey.crypto.password.PasswordReciprocal;
import org.dromara.maxkey.entity.idm.UserInfo;
;
import org.dromara.maxkey.web.WebConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -47,7 +47,7 @@ public class AuthnProviderAutoConfiguration {
static final Logger _logger = LoggerFactory.getLogger(AuthnProviderAutoConfiguration.class);
@Bean
public AbstractAuthenticationProvider authenticationProvider(
AbstractAuthenticationProvider authenticationProvider(
NormalAuthenticationProvider normalAuthenticationProvider,
MobileAuthenticationProvider mobileAuthenticationProvider,
TrustedAuthenticationProvider trustedAuthenticationProvider,
@ -63,7 +63,7 @@ public class AuthnProviderAutoConfiguration {
}
@Bean
public NormalAuthenticationProvider normalAuthenticationProvider(
NormalAuthenticationProvider normalAuthenticationProvider(
AbstractAuthenticationRealm authenticationRealm,
ApplicationConfig applicationConfig,
SessionManager sessionManager,

View File

@ -42,7 +42,7 @@ public class JwtAuthnAutoConfiguration {
* @return
*/
@Bean
public JWKSetKeyStore jwtLoginJwkSetKeyStore() {
JWKSetKeyStore jwtLoginJwkSetKeyStore() {
JWKSetKeyStore jwkSetKeyStore = new JWKSetKeyStore();
ClassPathResource classPathResource = new ClassPathResource("/config/loginjwkkeystore.jwks");
jwkSetKeyStore.setLocation(classPathResource);
@ -58,7 +58,7 @@ public class JwtAuthnAutoConfiguration {
* @throws NoSuchAlgorithmException
*/
@Bean
public DefaultJwtSigningAndValidationService jwtLoginValidationService(
DefaultJwtSigningAndValidationService jwtLoginValidationService(
@Qualifier("jwtLoginJwkSetKeyStore") JWKSetKeyStore jwtLoginJwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
DefaultJwtSigningAndValidationService jwtSignerValidationService =
@ -74,7 +74,7 @@ public class JwtAuthnAutoConfiguration {
* @return
*/
@Bean
public JwtLoginService jwtLoginService(
JwtLoginService jwtLoginService(
@Value("${maxkey.login.jwt.issuer}")
String issuer,
@Qualifier("jwtLoginValidationService")

View File

@ -45,7 +45,7 @@ public class CasAutoConfiguration implements InitializingBean {
* @return casTicketServices
*/
@Bean(name = "casTicketServices")
public TicketServices casTicketServices(
TicketServices casTicketServices(
@Value("${maxkey.server.persistence}") int persistence,
@Value("${maxkey.login.remeberme.validity}") int validity,
JdbcTemplate jdbcTemplate,
@ -61,7 +61,7 @@ public class CasAutoConfiguration implements InitializingBean {
* @return casTicketServices
*/
@Bean(name = "casTicketGrantingTicketServices")
public TicketServices casTicketGrantingTicketServices(
TicketServices casTicketGrantingTicketServices(
@Value("${maxkey.server.persistence}") int persistence,
@Value("${maxkey.login.remeberme.validity}") int validity,
JdbcTemplate jdbcTemplate,
@ -71,7 +71,7 @@ public class CasAutoConfiguration implements InitializingBean {
}
@Bean(name = "casProxyGrantingTicketServices")
public TicketServices casProxyGrantingTicketServices(
TicketServices casProxyGrantingTicketServices(
@Value("${maxkey.server.persistence}") int persistence,
@Value("${maxkey.login.remeberme.validity}") int validity,
JdbcTemplate jdbcTemplate,

View File

@ -76,7 +76,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
private static final Logger _logger = LoggerFactory.getLogger(Oauth20AutoConfiguration.class);
@Bean
public FilterRegistrationBean<Filter> tokenEndpointAuthenticationFilter() {
FilterRegistrationBean<Filter> tokenEndpointAuthenticationFilter() {
_logger.debug("TokenEndpointAuthenticationFilter init ");
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
registration.setFilter(new TokenEndpointAuthenticationFilter());
@ -94,7 +94,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* http://openid.net/specs/openid-connect-core-1_0.html#SelfIssued
*/
@Bean(name = "oidcProviderMetadata")
public OIDCProviderMetadataDetails oidcProviderMetadata(
OIDCProviderMetadataDetails oidcProviderMetadata(
@Value("${maxkey.oidc.metadata.issuer}")
String issuer,
@Value("${maxkey.oidc.metadata.authorizationEndpoint}")
@ -117,7 +117,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return
*/
@Bean(name = "jwkSetKeyStore")
public JWKSetKeyStore jwkSetKeyStore() {
JWKSetKeyStore jwkSetKeyStore() {
JWKSetKeyStore jwkSetKeyStore = new JWKSetKeyStore();
ClassPathResource classPathResource = new ClassPathResource("/config/keystore.jwks");
jwkSetKeyStore.setLocation(classPathResource);
@ -133,7 +133,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @throws NoSuchAlgorithmException
*/
@Bean(name = "jwtSignerValidationService")
public DefaultJwtSigningAndValidationService jwtSignerValidationService(
DefaultJwtSigningAndValidationService jwtSignerValidationService(
@Qualifier("jwkSetKeyStore")
JWKSetKeyStore jwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
@ -153,7 +153,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @throws NoSuchAlgorithmException
*/
@Bean(name = "jwtEncryptionService")
public DefaultJwtEncryptionAndDecryptionService jwtEncryptionService(
DefaultJwtEncryptionAndDecryptionService jwtEncryptionService(
@Qualifier("jwkSetKeyStore")
JWKSetKeyStore jwkSetKeyStore)
throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException {
@ -171,7 +171,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return
*/
@Bean(name = "tokenEnhancer")
public OIDCIdTokenEnhancer tokenEnhancer(
OIDCIdTokenEnhancer tokenEnhancer(
OIDCProviderMetadataDetails oidcProviderMetadata,
ClientDetailsService oauth20JdbcClientDetailsService) {
OIDCIdTokenEnhancer tokenEnhancer = new OIDCIdTokenEnhancer();
@ -180,6 +180,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
_logger.debug("OIDC IdToken Enhancer init.");
return tokenEnhancer;
}
//以上部分为了支持OpenID Connect 1.0
@ -189,7 +190,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20AuthorizationCodeServices
*/
@Bean(name = "oauth20AuthorizationCodeServices")
public AuthorizationCodeServices oauth20AuthorizationCodeServices(
AuthorizationCodeServices oauth20AuthorizationCodeServices(
@Value("${maxkey.server.persistence}") int persistence,
JdbcTemplate jdbcTemplate,
RedisConnectionFactory redisConnFactory) {
@ -203,7 +204,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20TokenStore
*/
@Bean(name = "oauth20TokenStore")
public TokenStore oauth20TokenStore(
TokenStore oauth20TokenStore(
@Value("${maxkey.server.persistence}") int persistence,
JdbcTemplate jdbcTemplate,
RedisConnectionFactory redisConnFactory) {
@ -216,7 +217,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return converter
*/
@Bean(name = "converter")
public JwtAccessTokenConverter jwtAccessTokenConverter() {
JwtAccessTokenConverter jwtAccessTokenConverter() {
JwtAccessTokenConverter jwtAccessTokenConverter = new JwtAccessTokenConverter();
_logger.debug("OAuth 2 Jwt AccessToken Converter init.");
return jwtAccessTokenConverter;
@ -227,7 +228,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20JdbcClientDetailsService
*/
@Bean(name = "oauth20JdbcClientDetailsService")
public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource,@Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
_logger.debug("OAuth 2 Jdbc ClientDetails Service init.");
@ -239,7 +240,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20TokenServices
*/
@Bean(name = "oauth20TokenServices")
public DefaultTokenServices defaultTokenServices(
DefaultTokenServices defaultTokenServices(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
TokenStore oauth20TokenStore,
OIDCIdTokenEnhancer tokenEnhancer) {
@ -258,7 +259,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20ApprovalStore
*/
@Bean(name = "oauth20ApprovalStore")
public TokenApprovalStore tokenApprovalStore(
TokenApprovalStore tokenApprovalStore(
TokenStore oauth20TokenStore) {
TokenApprovalStore tokenApprovalStore = new TokenApprovalStore();
tokenApprovalStore.setTokenStore(oauth20TokenStore);
@ -272,7 +273,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oAuth2RequestFactory
*/
@Bean(name = "oAuth2RequestFactory")
public DefaultOAuth2RequestFactory oauth2RequestFactory(
DefaultOAuth2RequestFactory oauth2RequestFactory(
JdbcClientDetailsService oauth20JdbcClientDetailsService) {
DefaultOAuth2RequestFactory oauth2RequestFactory =
new DefaultOAuth2RequestFactory(oauth20JdbcClientDetailsService);
@ -285,7 +286,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20UserApprovalHandler
*/
@Bean(name = "oauth20UserApprovalHandler")
public OAuth20UserApprovalHandler oauth20UserApprovalHandler(
OAuth20UserApprovalHandler oauth20UserApprovalHandler(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
DefaultOAuth2RequestFactory oAuth2RequestFactory,
TokenApprovalStore oauth20ApprovalStore
@ -303,7 +304,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20UserAuthenticationManager
*/
@Bean(name = "oauth20UserAuthenticationManager")
public ProviderManager oauth20UserAuthenticationManager(
ProviderManager oauth20UserAuthenticationManager(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder,
LoginRepository loginRepository
@ -325,7 +326,7 @@ public class Oauth20AutoConfiguration implements InitializingBean {
* @return oauth20ClientAuthenticationManager
*/
@Bean(name = "oauth20ClientAuthenticationManager")
public ProviderManager oauth20ClientAuthenticationManager(
ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal

View File

@ -67,7 +67,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @throws ConfigurationException
*/
@Bean(name = "samlBootstrapInitializer")
public String samlBootstrapInitializer() throws ConfigurationException {
String samlBootstrapInitializer() throws ConfigurationException {
org.opensaml.DefaultBootstrap.bootstrap();
return "";
}
@ -77,7 +77,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return timeService
*/
@Bean(name = "timeService")
public TimeService TimeService() {
TimeService TimeService() {
TimeService timeService = new TimeService();
return timeService;
}
@ -87,7 +87,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return idService
*/
@Bean(name = "idService")
public IDService idService() {
IDService idService() {
IDService idService = new IDService();
return idService;
}
@ -97,7 +97,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return endpointGenerator
*/
@Bean(name = "endpointGenerator")
public EndpointGenerator endpointGenerator() {
EndpointGenerator endpointGenerator() {
EndpointGenerator generator = new EndpointGenerator();
return generator;
}
@ -107,7 +107,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return authnResponseGenerator
*/
@Bean(name = "authnResponseGenerator")
public AuthnResponseGenerator authnResponseGenerator(TimeService timeService,IDService idService,
AuthnResponseGenerator authnResponseGenerator(TimeService timeService, IDService idService,
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
_logger.debug("issuerEntityName {}" , issuerEntityName);
AuthnResponseGenerator generator = new AuthnResponseGenerator(issuerEntityName,timeService,idService);
@ -119,7 +119,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return issuerEntityName
*/
@Bean(name = "issuerEntityName")
public String issuerEntityName(
String issuerEntityName(
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
return issuerEntityName;
}
@ -129,7 +129,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return saml20Metadata
*/
@Bean(name = "saml20Metadata")
public Saml20Metadata saml20Metadata(
Saml20Metadata saml20Metadata(
@Value("${maxkey.saml.v20.metadata.orgName}") String orgName,
@Value("${maxkey.saml.v20.metadata.orgDisplayName}") String orgDisplayName,
@Value("${maxkey.saml.v20.metadata.orgURL}") String orgURL,
@ -157,7 +157,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return samlValidaotrSuite
*/
@Bean(name = "samlValidaotrSuite")
public SAML2ValidatorSuite validatorSuite() {
SAML2ValidatorSuite validatorSuite() {
SAML2ValidatorSuite validatorSuite = new SAML2ValidatorSuite();
return validatorSuite;
}
@ -168,7 +168,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
*/
@SuppressWarnings("rawtypes")
@Bean(name = "mapBasedStorageService")
public MapBasedStorageService mapBasedStorageService() {
MapBasedStorageService mapBasedStorageService() {
MapBasedStorageService mapBasedStorageService = new MapBasedStorageService();
return mapBasedStorageService;
}
@ -179,9 +179,9 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @throws IOException
* @throws VelocityException
*/
@SuppressWarnings({ "deprecation"})
@SuppressWarnings({"deprecation"})
@Bean(name = "velocityEngine")
public VelocityEngine velocityEngine() throws VelocityException, IOException {
VelocityEngine velocityEngine() throws VelocityException, IOException {
VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
factory.setPreferFileSystemAccess(false);
Properties velocityProperties = new Properties();
@ -197,7 +197,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return replayCache
*/
@Bean(name = "replayCache")
public ReplayCache replayCache(MapBasedStorageService<String, ReplayCacheEntry> mapBasedStorageService,
ReplayCache replayCache(MapBasedStorageService<String, ReplayCacheEntry> mapBasedStorageService,
@Value("${maxkey.saml.v20.replay.cache.life.in.millis}") long duration) {
ReplayCache replayCache = new ReplayCache(mapBasedStorageService,duration);
return replayCache;
@ -208,7 +208,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return messageReplayRule
*/
@Bean(name = "messageReplayRule")
public MessageReplayRule messageReplayRule(ReplayCache replayCache) {
MessageReplayRule messageReplayRule(ReplayCache replayCache) {
MessageReplayRule messageReplayRule = new MessageReplayRule(replayCache);
return messageReplayRule;
}
@ -218,7 +218,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return samlParserPool
*/
@Bean(name = "samlParserPool")
public BasicParserPool samlParserPool(
BasicParserPool samlParserPool(
@Value("${maxkey.saml.v20.max.parser.pool.size}") int maxPoolSize) {
BasicParserPool samlParserPool = new BasicParserPool();
samlParserPool.setMaxPoolSize(maxPoolSize);
@ -230,7 +230,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return issueInstantRule
*/
@Bean(name = "issueInstantRule")
public IssueInstantRule issueInstantRule(
IssueInstantRule issueInstantRule(
@Value("${maxkey.saml.v20.issue.instant.check.clock.skew.in.seconds}") int newClockSkew,
@Value("${maxkey.saml.v20.issue.instant.check.validity.time.in.seconds}") int newExpires) {
IssueInstantRule decoder = new IssueInstantRule(newClockSkew,newExpires);
@ -243,7 +243,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return openHTTPPostSimpleSignDecoder
*/
@Bean(name = "openHTTPPostSimpleSignDecoder")
public OpenHTTPPostSimpleSignDecoder openHTTPPostSimpleSignDecoder(BasicParserPool samlParserPool,
OpenHTTPPostSimpleSignDecoder openHTTPPostSimpleSignDecoder(BasicParserPool samlParserPool,
@Value("${maxkey.saml.v20.idp.receiver.endpoint}") String receiverEndpoint) {
OpenHTTPPostSimpleSignDecoder decoder = new OpenHTTPPostSimpleSignDecoder(samlParserPool);
decoder.setReceiverEndpoint(receiverEndpoint);
@ -255,7 +255,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return openHTTPPostDecoder
*/
@Bean(name = "openHTTPPostDecoder")
public OpenHTTPPostDecoder openHTTPPostDecoder(BasicParserPool samlParserPool,
OpenHTTPPostDecoder openHTTPPostDecoder(BasicParserPool samlParserPool,
@Value("${maxkey.saml.v20.idp.receiver.endpoint}") String receiverEndpoint) {
OpenHTTPPostDecoder decoder = new OpenHTTPPostDecoder(samlParserPool);
decoder.setReceiverEndpoint(receiverEndpoint);
@ -267,7 +267,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return openHTTPRedirectDecoder
*/
@Bean(name = "openHTTPRedirectDecoder")
public OpenHTTPRedirectDecoder openHTTPRedirectDecoder(BasicParserPool samlParserPool,
OpenHTTPRedirectDecoder openHTTPRedirectDecoder(BasicParserPool samlParserPool,
@Value("${maxkey.saml.v20.idp.receiver.endpoint}") String receiverEndpoint) {
OpenHTTPRedirectDecoder decoder = new OpenHTTPRedirectDecoder(samlParserPool);
decoder.setReceiverEndpoint(receiverEndpoint);
@ -279,8 +279,8 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return extractPostBindingAdapter
*/
@Bean(name = "extractPostBindingAdapter")
public ExtractPostBindingAdapter extractPostBindingAdapter(OpenHTTPPostDecoder openHTTPPostDecoder,
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
ExtractPostBindingAdapter extractPostBindingAdapter(OpenHTTPPostDecoder openHTTPPostDecoder,
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader, IssueInstantRule issueInstantRule, MessageReplayRule messageReplayRule) {
ExtractPostBindingAdapter adapter = new ExtractPostBindingAdapter(openHTTPPostDecoder);
adapter.setIssueInstantRule(issueInstantRule);
adapter.setKeyStoreLoader(keyStoreLoader);
@ -293,8 +293,8 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return extractRedirectBindingAdapter
*/
@Bean(name = "extractRedirectBindingAdapter")
public ExtractRedirectBindingAdapter extractRedirectBindingAdapter(OpenHTTPRedirectDecoder openHTTPRedirectDecoder,
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader,IssueInstantRule issueInstantRule,MessageReplayRule messageReplayRule) {
ExtractRedirectBindingAdapter extractRedirectBindingAdapter(OpenHTTPRedirectDecoder openHTTPRedirectDecoder,
@Qualifier("keyStoreLoader") KeyStoreLoader keyStoreLoader, IssueInstantRule issueInstantRule, MessageReplayRule messageReplayRule) {
ExtractRedirectBindingAdapter adapter = new ExtractRedirectBindingAdapter(openHTTPRedirectDecoder);
adapter.setIssueInstantRule(issueInstantRule);
adapter.setKeyStoreLoader(keyStoreLoader);
@ -308,7 +308,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return postSimpleSignBindingAdapter
*/
@Bean(name = "postSimpleSignBindingAdapter")
public PostSimpleSignBindingAdapter postSimpleSignBindingAdapter(VelocityEngine velocityEngine,
PostSimpleSignBindingAdapter postSimpleSignBindingAdapter(VelocityEngine velocityEngine,
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
PostSimpleSignBindingAdapter adapter = new PostSimpleSignBindingAdapter();
adapter.setVelocityEngine(velocityEngine);
@ -321,7 +321,7 @@ public class Saml20AutoConfiguration implements InitializingBean {
* @return postBindingAdapter
*/
@Bean(name = "postBindingAdapter")
public PostBindingAdapter postBindingAdapter(VelocityEngine velocityEngine,
PostBindingAdapter postBindingAdapter(VelocityEngine velocityEngine,
@Value("${maxkey.saml.v20.idp.issuer}") String issuerEntityName) {
PostBindingAdapter adapter = new PostBindingAdapter();
adapter.setVelocityEngine(velocityEngine);

View File

@ -121,7 +121,7 @@ public class IpLocationAutoConfiguration {
* @throws Exception
*/
@Bean
public IpLocationParser ipLocationParser(
IpLocationParser ipLocationParser(
@Value("${maxkey.login.iplocation:true}") boolean isIplocation,
@Value("${maxkey.login.iplocation.online.provider:none}") String onlineProvider,
@Value("${maxkey.login.iplocation.offline.provider:Ip2Region}") String offlineProvider) throws Exception {

View File

@ -36,7 +36,7 @@ public class OneTimePasswordAutoConfiguration {
@Bean(name = "mailOtpAuthnService")
public MailOtpAuthnService mailOtpAuthnService(
MailOtpAuthnService mailOtpAuthnService(
@Value("${maxkey.server.persistence}") int persistence,
CnfEmailSendersService emailSendersService,
RedisConnectionFactory redisConnFactory) {

View File

@ -36,7 +36,7 @@ public class SmsAutoConfiguration {
@Bean(name = "smsOtpAuthnService")
public SmsOtpAuthnService smsOtpAuthnService(
SmsOtpAuthnService smsOtpAuthnService(
@Value("${maxkey.server.persistence}") int persistence,
CnfSmsProviderService smsProviderService,
CnfEmailSendersService emailSendersService,

View File

@ -58,17 +58,17 @@ public class ApplicationAutoConfiguration {
static final Logger _logger = LoggerFactory.getLogger(ApplicationAutoConfiguration.class);
@Bean
public PasswordReciprocal passwordReciprocal() {
PasswordReciprocal passwordReciprocal() {
return new PasswordReciprocal();
}
@Bean
public DataSourceTransactionManager transactionManager(DataSource dataSource) {
DataSourceTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public InstitutionsRepository institutionsRepository(JdbcTemplate jdbcTemplate) {
InstitutionsRepository institutionsRepository(JdbcTemplate jdbcTemplate) {
return new InstitutionsRepository(jdbcTemplate);
}
@ -77,7 +77,7 @@ public class ApplicationAutoConfiguration {
* @return
*/
@Bean
public PasswordEncoder passwordEncoder(
PasswordEncoder passwordEncoder(
@Value("${maxkey.crypto.password.encoder:bcrypt}") String idForEncode) {
Map<String ,PasswordEncoder > encoders = new HashMap<>();
encoders.put("bcrypt", new BCryptPasswordEncoder());
@ -117,7 +117,7 @@ public class ApplicationAutoConfiguration {
* @return
*/
@Bean
public KeyStoreLoader keyStoreLoader(
KeyStoreLoader keyStoreLoader(
@Value("${maxkey.saml.v20.idp.issuing.entity.id}") String entityName,
@Value("${maxkey.saml.v20.idp.keystore.password}") String keystorePassword,
@Value("${maxkey.saml.v20.idp.keystore}") Resource keystoreFile) {
@ -133,7 +133,7 @@ public class ApplicationAutoConfiguration {
* @return
*/
@Bean
public KeyStoreLoader serviceProviderKeyStoreLoader(
KeyStoreLoader serviceProviderKeyStoreLoader(
@Value("${maxkey.saml.v20.sp.issuing.entity.id}") String entityName,
@Value("${maxkey.saml.v20.sp.keystore.password}") String keystorePassword,
@Value("${maxkey.saml.v20.sp.keystore}") Resource keystoreFile) {
@ -149,7 +149,7 @@ public class ApplicationAutoConfiguration {
* @return
*/
@Bean
public String spIssuingEntityName(
String spIssuingEntityName(
@Value("${maxkey.saml.v20.sp.issuing.entity.id}") String spIssuingEntityName) {
return spIssuingEntityName;
}
@ -159,7 +159,7 @@ public class ApplicationAutoConfiguration {
* @return
*/
@Bean
public IdGenerator idGenerator(
IdGenerator idGenerator(
@Value("${maxkey.id.strategy:SnowFlake}") String strategy,
@Value("${maxkey.id.datacenterId:0}") int datacenterId,
@Value("${maxkey.id.machineId:0}") int machineId) {
@ -172,7 +172,7 @@ public class ApplicationAutoConfiguration {
@Bean
public MomentaryService momentaryService(
MomentaryService momentaryService(
RedisConnectionFactory redisConnFactory,
@Value("${maxkey.server.persistence}") int persistence) {
MomentaryService momentaryService;

View File

@ -79,8 +79,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* messageSource .
* @return messageSource
*/
@Bean (name = "messageSource")
public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource(
@Bean(name = "messageSource")
ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource(
@Value("${spring.messages.basename:classpath:messages/message}")
String messagesBasename) {
_logger.debug("Basename {}" , messagesBasename);
@ -97,8 +97,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* @return localeChangeInterceptor
*/
//@Primary
@Bean (name = "localeChangeInterceptor")
public LocaleChangeInterceptor localeChangeInterceptor() {
@Bean(name = "localeChangeInterceptor")
LocaleChangeInterceptor localeChangeInterceptor() {
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
return localeChangeInterceptor;
@ -108,8 +108,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* handlerMapping .
* @return handlerMapping
*/
@Bean (name = "handlerMapping")
public RequestMappingHandlerMapping requestMappingHandlerMapping(
@Bean(name = "handlerMapping")
RequestMappingHandlerMapping requestMappingHandlerMapping(
LocaleChangeInterceptor localeChangeInterceptor) {
RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
requestMappingHandlerMapping.setInterceptors(localeChangeInterceptor);
@ -120,8 +120,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* jaxb2Marshaller .
* @return jaxb2Marshaller
*/
@Bean (name = "jaxb2Marshaller")
public Jaxb2Marshaller jaxb2Marshaller() {
@Bean(name = "jaxb2Marshaller")
Jaxb2Marshaller jaxb2Marshaller() {
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(org.dromara.maxkey.entity.xml.UserInfoXML.class);;
return jaxb2Marshaller;
@ -131,8 +131,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* marshallingHttpMessageConverter .
* @return marshallingHttpMessageConverter
*/
@Bean (name = "marshallingHttpMessageConverter")
public MarshallingHttpMessageConverter marshallingHttpMessageConverter(
@Bean(name = "marshallingHttpMessageConverter")
MarshallingHttpMessageConverter marshallingHttpMessageConverter(
Jaxb2Marshaller jaxb2Marshaller) {
MarshallingHttpMessageConverter marshallingHttpMessageConverter = new MarshallingHttpMessageConverter();
marshallingHttpMessageConverter.setMarshaller(jaxb2Marshaller);
@ -150,8 +150,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* mappingJacksonHttpMessageConverter .
* @return mappingJacksonHttpMessageConverter
*/
@Bean (name = "mappingJacksonHttpMessageConverter")
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
@Bean(name = "mappingJacksonHttpMessageConverter")
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter = new MappingJackson2HttpMessageConverter();
ArrayList<MediaType> mediaTypesList = new ArrayList<>();
mediaTypesList.add(MediaType.APPLICATION_JSON);
@ -176,7 +176,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
*/
@Bean(name = "cookieLocaleResolver")
public LocaleResolver cookieLocaleResolver(
LocaleResolver cookieLocaleResolver(
@Value("${maxkey.server.domain:maxkey.top}")
String domainName
) {
@ -192,8 +192,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* requestMappingHandlerAdapter .
* @return requestMappingHandlerAdapter
*/
@Bean (name = "addConverterRequestMappingHandlerAdapter")
public RequestMappingHandlerAdapter requestMappingHandlerAdapter(
@Bean(name = "addConverterRequestMappingHandlerAdapter")
RequestMappingHandlerAdapter requestMappingHandlerAdapter(
@Qualifier("mappingJacksonHttpMessageConverter")
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
MarshallingHttpMessageConverter marshallingHttpMessageConverter,
@ -217,8 +217,8 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* restTemplate .
* @return restTemplate
*/
@Bean (name = "restTemplate")
public RestTemplate restTemplate(
@Bean(name = "restTemplate")
RestTemplate restTemplate(
@Qualifier("mappingJacksonHttpMessageConverter")
MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter,
MarshallingHttpMessageConverter marshallingHttpMessageConverter) {
@ -236,7 +236,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
* @return webServerFactoryCustomizer
*/
@Bean
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() {
WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() {
return new WebServerFactoryCustomizer<ConfigurableWebServerFactory>() {
@Override
public void customize(ConfigurableWebServerFactory factory) {
@ -253,13 +253,13 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
}
@Bean
public SecurityContextHolderAwareRequestFilter securityContextHolderAwareRequestFilter() {
SecurityContextHolderAwareRequestFilter securityContextHolderAwareRequestFilter() {
_logger.debug("securityContextHolderAwareRequestFilter init ");
return new SecurityContextHolderAwareRequestFilter();
}
@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
FilterRegistrationBean<CorsFilter> corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowCredentials(true);
@ -275,7 +275,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
}
@Bean
public FilterRegistrationBean<Filter> delegatingFilterProxy() {
FilterRegistrationBean<Filter> delegatingFilterProxy() {
_logger.debug("delegatingFilterProxy init for /* ");
FilterRegistrationBean<Filter> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new DelegatingFilterProxy("securityContextHolderAwareRequestFilter"));
@ -288,7 +288,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
}
@Bean
public FilterRegistrationBean<Filter> webXssRequestFilter() {
FilterRegistrationBean<Filter> webXssRequestFilter() {
_logger.debug("webXssRequestFilter init for /* ");
FilterRegistrationBean<Filter> registrationBean = new FilterRegistrationBean<>(new WebXssRequestFilter());
registrationBean.addUrlPatterns("/*");
@ -298,7 +298,7 @@ public class MvcAutoConfiguration implements WebMvcConfigurer {
}
@Bean
public FilterRegistrationBean<Filter> webInstRequestFilter(
FilterRegistrationBean<Filter> webInstRequestFilter(
InstitutionsRepository institutionsRepository,
ApplicationConfig applicationConfig) {
_logger.debug("WebInstRequestFilter init for /* ");

View File

@ -42,7 +42,7 @@ public class RedisAutoConfiguration {
* @return RedisConnectionFactory
*/
@Bean
public RedisConnectionFactory redisConnFactory(
RedisConnectionFactory redisConnFactory(
@Value("${spring.redis.host}")
String host,
@Value("${spring.redis.port:6379}")

View File

@ -33,7 +33,7 @@ public class SwaggerAutoConfiguration {
boolean enable;
@Bean
public GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
return openApi -> {
if (openApi.getTags()!=null){
openApi.getTags().forEach(tag -> {
@ -51,7 +51,7 @@ public class SwaggerAutoConfiguration {
}
@Bean
public GroupedOpenApi userApi(){
GroupedOpenApi userApi(){
String[] paths = {
"/login",
"/logout",
@ -72,7 +72,7 @@ public class SwaggerAutoConfiguration {
}
@Bean
public OpenAPI docOpenAPI() {
OpenAPI docOpenAPI() {
return new OpenAPI()
.info(
new Info()

View File

@ -49,7 +49,7 @@ public class SynchronizerAutoConfiguration implements InitializingBean {
public static final String SYNCHRONIZERS_SELECT_STATEMENT = "select * from mxk_synchronizers where status ='1'";
@Bean(name = "schedulerSynchronizerJobs")
public String schedulerSynchronizerJobs(
String schedulerSynchronizerJobs(
JdbcTemplate jdbcTemplate,
SchedulerFactoryBean schedulerFactoryBean,
@Value("${maxkey.job.cron.enable}") boolean jobCronEnable

View File

@ -79,7 +79,7 @@ public class MaxKeyConfig {
@Bean
public OtpKeyUriFormat otpKeyUriFormat(
OtpKeyUriFormat otpKeyUriFormat(
@Value("${maxkey.otp.policy.type:totp}")
String type,
@Value("${maxkey.otp.policy.domain:MaxKey.top}")
@ -98,7 +98,7 @@ public class MaxKeyConfig {
//可以在此实现其他的登陆认证方式请实现AbstractAuthenticationRealm
@Bean
public JdbcAuthenticationRealm authenticationRealm(
JdbcAuthenticationRealm authenticationRealm(
@Qualifier("passwordEncoder") PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator,
LoginRepository loginService,
@ -122,7 +122,7 @@ public class MaxKeyConfig {
}
@Bean
public TimeBasedOtpAuthn timeBasedOtpAuthn(
TimeBasedOtpAuthn timeBasedOtpAuthn(
@Value("${maxkey.otp.policy.digits:6}")
int digits,
@Value("${maxkey.otp.policy.period:30}")
@ -133,8 +133,8 @@ public class MaxKeyConfig {
}
@Bean
public AbstractOtpAuthn tfaOtpAuthn(
@Value("${maxkey.login.mfa.type}")String mfaType,
AbstractOtpAuthn tfaOtpAuthn(
@Value("${maxkey.login.mfa.type}") String mfaType,
@Value("${maxkey.otp.policy.digits:6}")
int digits,
@Value("${maxkey.otp.policy.period:30}")
@ -154,7 +154,7 @@ public class MaxKeyConfig {
}
@Bean
public MailOtpAuthn mailOtpAuthn(
MailOtpAuthn mailOtpAuthn(
EmailConfig emailConfig,
@Value("${spring.mail.properties.mailotp.message.subject}")
String messageSubject,
@ -187,7 +187,7 @@ public class MaxKeyConfig {
@Bean
public RemoteKerberosService kerberosService(
RemoteKerberosService kerberosService(
@Value("${maxkey.login.kerberos.default.userdomain}")
String userDomain,
@Value("${maxkey.login.kerberos.default.fulluserdomain}")

View File

@ -39,7 +39,7 @@ public class MaxKeyMgtConfig {
//authenticationRealm for MaxKeyMgtApplication
@Bean
public JdbcAuthenticationRealm authenticationRealm(
JdbcAuthenticationRealm authenticationRealm(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator,
@ -63,7 +63,7 @@ public class MaxKeyMgtConfig {
}
@Bean
public AbstractOtpAuthn timeBasedOtpAuthn() {
AbstractOtpAuthn timeBasedOtpAuthn() {
AbstractOtpAuthn tfaOtpAuthn = new TimeBasedOtpAuthn();
logger.debug("TimeBasedOtpAuthn inited.");
return tfaOtpAuthn;

View File

@ -42,7 +42,7 @@ public class MaxKeyMgtListenerConfig {
private static final Logger logger = LoggerFactory.getLogger(MaxKeyMgtListenerConfig.class);
@Bean
public String sessionListenerAdapter(
String sessionListenerAdapter(
Scheduler scheduler,
SessionManager sessionManager) throws SchedulerException {
new ScheduleAdapterBuilder()
@ -56,7 +56,7 @@ public class MaxKeyMgtListenerConfig {
}
@Bean
public String reorgDeptListenerAdapter(
String reorgDeptListenerAdapter(
Scheduler scheduler,
OrganizationsService organizationsService) throws SchedulerException {
new ScheduleAdapterBuilder()
@ -70,7 +70,7 @@ public class MaxKeyMgtListenerConfig {
}
@Bean
public String dynamicGroupsListenerAdapter(
String dynamicGroupsListenerAdapter(
Scheduler scheduler,
GroupsService groupsService,
@Value("${maxkey.job.cron.schedule}") String cronSchedule
@ -87,7 +87,7 @@ public class MaxKeyMgtListenerConfig {
}
@Bean
public String provisioningRunnerThread(
String provisioningRunnerThread(
ConnectorsService connectorsService,
JdbcTemplate jdbcTemplate,
ApplicationConfig applicationConfig

View File

@ -47,8 +47,8 @@ public class Oauth20ClientAutoConfiguration {
private static final Logger logger = LoggerFactory.getLogger(Oauth20ClientAutoConfiguration.class);
@Bean
public JdbcClientDetailsService oauth20JdbcClientDetailsService(
DataSource dataSource , @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService oauth20JdbcClientDetailsService(
DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
logger.debug("JdbcClientDetailsService inited.");
@ -61,7 +61,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20TokenStore
*/
@Bean
public TokenStore oauth20TokenStore(
TokenStore oauth20TokenStore(
@Value("${maxkey.server.persistence}") int persistence,
JdbcTemplate jdbcTemplate,
RedisConnectionFactory jedisConnectionFactory) {
@ -82,7 +82,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20TokenServices
*/
@Bean
public DefaultTokenServices oauth20TokenServices(
DefaultTokenServices oauth20TokenServices(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
TokenStore oauth20TokenStore) {
DefaultTokenServices tokenServices = new DefaultTokenServices();
@ -97,7 +97,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20ClientAuthenticationManager
*/
@Bean
public ProviderManager oauth20ClientAuthenticationManager(
ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal

View File

@ -39,7 +39,7 @@ public class MaxKeyOpenApiConfig{
//authenticationRealm for MaxKeyMgtApplication
@Bean
public JdbcAuthenticationRealm authenticationRealm(
JdbcAuthenticationRealm authenticationRealm(
@Qualifier("passwordEncoder")
PasswordEncoder passwordEncoder,
PasswordPolicyValidator passwordPolicyValidator,
@ -63,7 +63,7 @@ public class MaxKeyOpenApiConfig{
}
@Bean
public AbstractOtpAuthn timeBasedOtpAuthn() {
AbstractOtpAuthn timeBasedOtpAuthn() {
AbstractOtpAuthn tfaOtpAuthn = new TimeBasedOtpAuthn();
logger.debug("TimeBasedOtpAuthn inited.");
return tfaOtpAuthn;

View File

@ -47,7 +47,7 @@ public class Oauth20ClientAutoConfiguration {
private static final Logger logger = LoggerFactory.getLogger(Oauth20ClientAutoConfiguration.class);
@Bean
public JdbcClientDetailsService oauth20JdbcClientDetailsService(
JdbcClientDetailsService oauth20JdbcClientDetailsService(
DataSource dataSource, @Qualifier("passwordReciprocal") PasswordEncoder passwordReciprocal) {
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
//clientDetailsService.setPasswordEncoder(passwordReciprocal);
@ -61,7 +61,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20TokenStore
*/
@Bean
public TokenStore oauth20TokenStore(
TokenStore oauth20TokenStore(
@Value("${maxkey.server.persistence}") int persistence,
JdbcTemplate jdbcTemplate,
RedisConnectionFactory jedisConnectionFactory) {
@ -82,7 +82,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20TokenServices
*/
@Bean
public DefaultTokenServices oauth20TokenServices(
DefaultTokenServices oauth20TokenServices(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
TokenStore oauth20TokenStore) {
DefaultTokenServices tokenServices = new DefaultTokenServices();
@ -97,7 +97,7 @@ public class Oauth20ClientAutoConfiguration {
* @return oauth20ClientAuthenticationManager
*/
@Bean
public ProviderManager oauth20ClientAuthenticationManager(
ProviderManager oauth20ClientAuthenticationManager(
JdbcClientDetailsService oauth20JdbcClientDetailsService,
@Qualifier("passwordReciprocal")
PasswordEncoder passwordReciprocal

View File

@ -1,7 +1,7 @@
echo off
echo set env
set JAVA_HOME=C:\IDE\jdk-17.0.2.8
set GRADLE_HOME=C:\IDE\gradle-8.8
set JAVA_HOME=C:\ide\jdk-17.0.9+9
set GRADLE_HOME=C:\ide\gradle-8.8
call %JAVA_HOME%/bin/java -version
call %GRADLE_HOME%/bin/gradle -version