浏览代码

spring cloud & gateway support fix

spring cloud & gateway support fix
Crystal.Sea 3 年之前
父节点
当前提交
8e901cd699

+ 8 - 44
maxkey-core/src/main/java/org/maxkey/autoconfigure/ApplicationAutoConfiguration.java

@@ -18,13 +18,9 @@
 package org.maxkey.autoconfigure;
 
 import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
-
 import javax.sql.DataSource;
-import org.maxkey.constants.ConstantsProperties;
 import org.maxkey.crypto.keystore.KeyStoreLoader;
 import org.maxkey.crypto.password.LdapShaPasswordEncoder;
 import org.maxkey.crypto.password.Md4PasswordEncoder;
@@ -44,9 +40,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
-import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.datasource.DataSourceTransactionManager;
@@ -70,42 +63,6 @@ public class ApplicationAutoConfiguration  implements InitializingBean {
         return DruidDataSourceBuilder.create().build();
     }
     
-    /**
-     * propertySourcesPlaceholderConfigurer .
-     * @return propertySourcesPlaceholderConfigurer
-     * @throws IOException  null
-     */
-    /*@Bean (name = "propertySourcesPlaceholderConfigurer")
-    public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer()
-            throws IOException {
-        ClassPathResource classPathApplicationPropertySource = 
-                new ClassPathResource(ConstantsProperties.classPathResource(
-                        ConstantsProperties.applicationPropertySource));
-
-        PropertySourcesPlaceholderConfigurer configurer = 
-                new PropertySourcesPlaceholderConfigurer();
-        configurer.setLocations(classPathApplicationPropertySource);
-        configurer.setIgnoreUnresolvablePlaceholders(true);
-        _logger.debug("PropertySourcesPlaceholderConfigurer init");
-        
-        return configurer;
-    }
-    
-    @Bean (name = "applicationProperty")
-    public Properties applicationProperty(
-    		@Value("${spring.profiles.active:}")String profilesActive) throws IOException {
-    	 Resource resource = new ClassPathResource(
-                 ConstantsProperties.classPathResource(
-                 		ConstantsProperties.classPathResource(
-                 				ConstantsProperties.applicationPropertySource,
-                 				profilesActive)));
-     
-    	 Properties properties = new Properties();
-    	 properties.load(resource.getInputStream());
-    	 return properties;
-    }
-    */
-    
     @Bean(name = "passwordReciprocal")
     public PasswordReciprocal passwordReciprocal() {
         return new PasswordReciprocal();
@@ -151,7 +108,14 @@ public class ApplicationAutoConfiguration  implements InitializingBean {
         //idForEncode is default for encoder
         PasswordEncoder passwordEncoder =
             new DelegatingPasswordEncoder(idForEncode, encoders);
-        
+       
+        if(_logger.isDebugEnabled()) {
+        	 _logger.debug("Password Encoders :");
+	        for (String key : encoders.keySet()) {
+	            _logger.debug(key + "=" + encoders.get(key));
+	        }
+        }
+        _logger.debug("default encoder " + idForEncode);
         return passwordEncoder;
     }
 

+ 1 - 1
maxkey-core/src/main/java/org/maxkey/configuration/ApplicationConfig.java

@@ -75,7 +75,7 @@ public class ApplicationConfig {
     @Value("${server.servlet.session.timeout:1800}")
     private int sessionTimeout;
 
-    @Value("${maxkey.identity.kafkasupport:false}")
+    @Value("${maxkey.server.kafka.support:false}")
     private boolean kafkaSupport;
     
     @Value("${maxkey.notices.visible:false}")

+ 1 - 2
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-http.properties

@@ -42,7 +42,7 @@ maxkey.server.authz.uri                         =${maxkey.server.name}:${server.
 #InMemory 0 , Redis 2               
 maxkey.server.persistence                       =${SERVER_PERSISTENCE:0}
 #identity               
-maxkey.identity.kafkasupport                    =${SERVER_KAFKA_SUPPORT:false}
+maxkey.server.kafka.support                     =${SERVER_KAFKA_SUPPORT:false}
 #issuer name                
 maxkey.app.issuer                               =CN=ConSec,CN=COM,CN=SH
 ############################################################################
@@ -404,7 +404,6 @@ management.security.enabled                     =false
 management.endpoints.web.exposure.include       =*
 management.endpoint.health.show-details         =ALWAYS
 #Spring Boot Admin Client
-spring.application.name                         =maxkey
 spring.boot.admin.client.url                    =${SPRING_BOOT_ADMIN_URL:http://127.0.0.1:9528}
 management.health.redis.enabled                 =false
 

+ 1 - 2
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-https.properties

@@ -42,7 +42,7 @@ maxkey.server.authz.uri                         =${maxkey.server.name}/maxkey
 #InMemory 0 , Redis 2               
 maxkey.server.persistence                       =${SERVER_PERSISTENCE:0}
 #identity               
-maxkey.identity.kafkasupport                    =${SERVER_KAFKA_SUPPORT:false}
+maxkey.server.kafka.support                     =${SERVER_KAFKA_SUPPORT:false}
 #issuer name                
 maxkey.app.issuer                               =CN=ConSec,CN=COM,CN=SH
 
@@ -406,7 +406,6 @@ management.security.enabled                     =false
 management.endpoints.web.exposure.include       =*
 management.endpoint.health.show-details         =ALWAYS
 #Spring Boot Admin Client
-spring.application.name                         =maxkey
 spring.boot.admin.client.url                    =${SPRING_BOOT_ADMIN_URL:http://127.0.0.1:9528}
 management.health.redis.enabled                 =false
 

+ 0 - 1
maxkey-webs/maxkey-web-maxkey/src/main/resources/application.properties

@@ -16,7 +16,6 @@
 #MaxKey Title and Version                                                  #
 ############################################################################
 application.title                           =MaxKey
-application.name                            =MaxKey
 application.formatted-version               =v2.9.0 GA
 #for dynamic service discovery
 spring.application.name                     =maxkey

+ 1 - 2
maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties

@@ -38,7 +38,7 @@ maxkey.server.authz.uri                         =https://${maxkey.server.domain}
 #InMemory 0 , Redis 2 
 maxkey.server.persistence                       =0
 #identity
-maxkey.identity.kafkasupport                    =${SERVER_KAFKA_SUPPORT:false}
+maxkey.server.kafka.support                     =${SERVER_KAFKA_SUPPORT:false}
 
 ############################################################################
 #Login configuration                                                       #
@@ -216,7 +216,6 @@ management.security.enabled                     =false
 management.endpoints.web.exposure.include       =*
 management.endpoint.health.show-details         =ALWAYS
 #Spring Boot Admin Client
-spring.application.name                         =maxkey
 spring.boot.admin.client.url                    =${SPRING_BOOT_ADMIN_URL:http://127.0.0.1:9528}
 management.health.redis.enabled                 =false
 

+ 1 - 2
maxkey-webs/maxkey-web-mgt/src/main/resources/application.properties

@@ -15,8 +15,7 @@
 ############################################################################
 #MaxKey Title and Version                                                  #
 ############################################################################
-application.title                               =MaxKey
-application.name                                =MaxKey-Mgt
+application.title                               =MaxKey-Mgt
 application.formatted-version                   =v2.9.0 GA
 #for dynamic service discovery
 spring.application.name                         =maxkey-mgt