From 317b596dd95521bc40296b920d4aeef7507d1c1b Mon Sep 17 00:00:00 2001 From: Tim Schimandle Date: Tue, 4 Oct 2016 10:05:49 -0600 Subject: [PATCH] BAEL-315 reducing the number of users to simplify the code. --- .../application-config/discovery.properties | 2 +- .../application-config/gateway.properties | 1 - .../application-config/resource.properties | 1 - .../cloud/bootstrap/config/SecurityConfig.java | 12 ++---------- .../src/main/resources/application.properties | 2 +- .../cloud/bootstrap/discovery/SecurityConfig.java | 14 +------------- .../src/main/resources/bootstrap.properties | 4 ++-- .../src/main/resources/bootstrap.properties | 6 +++--- .../src/main/resources/bootstrap.properties | 6 +++--- 9 files changed, 13 insertions(+), 35 deletions(-) diff --git a/spring-cloud/spring-cloud-bootstrap/application-config/discovery.properties b/spring-cloud/spring-cloud-bootstrap/application-config/discovery.properties index 0df7988f69..dd117e128c 100644 --- a/spring-cloud/spring-cloud-bootstrap/application-config/discovery.properties +++ b/spring-cloud/spring-cloud-bootstrap/application-config/discovery.properties @@ -3,6 +3,6 @@ server.port=8082 eureka.instance.hostname=localhost -eureka.client.serviceUrl.defaultZone=http://disc_discUser:discPassword@localhost:8082/eureka/ +eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/ eureka.client.register-with-eureka=false eureka.client.fetch-registry=false diff --git a/spring-cloud/spring-cloud-bootstrap/application-config/gateway.properties b/spring-cloud/spring-cloud-bootstrap/application-config/gateway.properties index fc04c5fc23..b33f28f7a6 100644 --- a/spring-cloud/spring-cloud-bootstrap/application-config/gateway.properties +++ b/spring-cloud/spring-cloud-bootstrap/application-config/gateway.properties @@ -3,7 +3,6 @@ server.port=8080 eureka.client.region = default eureka.client.registryFetchIntervalSeconds = 5 -eureka.client.serviceUrl.defaultZone=http://disc_gatewayUser:gatewayPassword@localhost:8082/eureka/ zuul.routes.resource.path=/resource/** hystrix.command.resource.execution.isolation.thread.timeoutInMilliseconds: 5000 diff --git a/spring-cloud/spring-cloud-bootstrap/application-config/resource.properties b/spring-cloud/spring-cloud-bootstrap/application-config/resource.properties index 8df874a104..e19715e986 100644 --- a/spring-cloud/spring-cloud-bootstrap/application-config/resource.properties +++ b/spring-cloud/spring-cloud-bootstrap/application-config/resource.properties @@ -5,4 +5,3 @@ resource.returnString=hello cloud eureka.client.region = default eureka.client.registryFetchIntervalSeconds = 5 -eureka.client.serviceUrl.defaultZone=http://disc_resourceUser:resourcePassword@localhost:8082/eureka/ diff --git a/spring-cloud/spring-cloud-bootstrap/config/src/main/java/com/baeldung/spring/cloud/bootstrap/config/SecurityConfig.java b/spring-cloud/spring-cloud-bootstrap/config/src/main/java/com/baeldung/spring/cloud/bootstrap/config/SecurityConfig.java index 13c84dad94..b0e5d17698 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/src/main/java/com/baeldung/spring/cloud/bootstrap/config/SecurityConfig.java +++ b/spring-cloud/spring-cloud-bootstrap/config/src/main/java/com/baeldung/spring/cloud/bootstrap/config/SecurityConfig.java @@ -14,16 +14,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception{ auth.inMemoryAuthentication() - .withUser("config_discUser") - .password("discPassword") - .roles("SYSTEM") - .and() - .withUser("config_gatewayUser") - .password("gatewayPassword") - .roles("SYSTEM") - .and() - .withUser("config_resourceUser") - .password("resourcePassword") + .withUser("configUser") + .password("configPassword") .roles("SYSTEM"); } diff --git a/spring-cloud/spring-cloud-bootstrap/config/src/main/resources/application.properties b/spring-cloud/spring-cloud-bootstrap/config/src/main/resources/application.properties index dda7552960..6c47d001f4 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/src/main/resources/application.properties +++ b/spring-cloud/spring-cloud-bootstrap/config/src/main/resources/application.properties @@ -5,4 +5,4 @@ spring.cloud.config.server.git.uri=file:///${user.home}/application-config eureka.client.region = default eureka.client.registryFetchIntervalSeconds = 5 -eureka.client.serviceUrl.defaultZone=http://disc_configUser:configPassword@localhost:8082/eureka/ \ No newline at end of file +eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/ \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/src/main/java/com/baeldung/spring/cloud/bootstrap/discovery/SecurityConfig.java b/spring-cloud/spring-cloud-bootstrap/discovery/src/main/java/com/baeldung/spring/cloud/bootstrap/discovery/SecurityConfig.java index 20a7fdeda1..22e0369cb1 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/src/main/java/com/baeldung/spring/cloud/bootstrap/discovery/SecurityConfig.java +++ b/spring-cloud/spring-cloud-bootstrap/discovery/src/main/java/com/baeldung/spring/cloud/bootstrap/discovery/SecurityConfig.java @@ -15,21 +15,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception{ auth.inMemoryAuthentication() - .withUser("disc_configUser") - .password("configPassword") - .roles("SYSTEM") - .and() - .withUser("disc_discUser") + .withUser("discUser") .password("discPassword") .roles("SYSTEM") - .and() - .withUser("disc_gatewayUser") - .password("gatewayPassword") - .roles("SYSTEM") - .and() - .withUser("disc_resourceUser") - .password("resourcePassword") - .roles("SYSTEM") .and() .withUser("admin") .password("password") diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/src/main/resources/bootstrap.properties b/spring-cloud/spring-cloud-bootstrap/discovery/src/main/resources/bootstrap.properties index 2a8381a58d..d31caf55b5 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/src/main/resources/bootstrap.properties +++ b/spring-cloud/spring-cloud-bootstrap/discovery/src/main/resources/bootstrap.properties @@ -1,4 +1,4 @@ spring.cloud.config.name=discovery spring.cloud.config.uri=http://localhost:8081 -spring.cloud.config.username=config_discUser -spring.cloud.config.password=discPassword \ No newline at end of file +spring.cloud.config.username=configUser +spring.cloud.config.password=configPassword \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/bootstrap.properties b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/bootstrap.properties index 69d9155ce9..43491ff36b 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/bootstrap.properties +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/bootstrap.properties @@ -1,7 +1,7 @@ spring.cloud.config.name=gateway spring.cloud.config.discovery.service-id=config spring.cloud.config.discovery.enabled=true -spring.cloud.config.username=config_gatewayUser -spring.cloud.config.password=gatewayPassword +spring.cloud.config.username=configUser +spring.cloud.config.password=configPassword -eureka.client.serviceUrl.defaultZone=http://disc_gatewayUser:gatewayPassword@localhost:8082/eureka/ \ No newline at end of file +eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/ \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/resource/src/main/resources/bootstrap.properties b/spring-cloud/spring-cloud-bootstrap/resource/src/main/resources/bootstrap.properties index 2917cd570d..f915426a36 100644 --- a/spring-cloud/spring-cloud-bootstrap/resource/src/main/resources/bootstrap.properties +++ b/spring-cloud/spring-cloud-bootstrap/resource/src/main/resources/bootstrap.properties @@ -1,7 +1,7 @@ spring.cloud.config.name=resource spring.cloud.config.discovery.service-id=config spring.cloud.config.discovery.enabled=true -spring.cloud.config.username=config_resourceUser -spring.cloud.config.password=resourcePassword +spring.cloud.config.username=configUser +spring.cloud.config.password=configPassword -eureka.client.serviceUrl.defaultZone=http://disc_resourceUser:resourcePassword@localhost:8082/eureka/ \ No newline at end of file +eureka.client.serviceUrl.defaultZone=http://discUser:discPassword@localhost:8082/eureka/ \ No newline at end of file