为配置中心添加安全认证

This commit is contained in:
lsy
2017-10-21 15:11:21 +08:00
parent c6018b21d1
commit 40a88f1c72
9 changed files with 26 additions and 3 deletions
Executable → Regular
View File
+2
View File
@@ -6,6 +6,8 @@ spring:
profile: dev
label: master
name: cms
username: config
password: server
eureka:
client:
serviceUrl:
+5
View File
@@ -37,6 +37,11 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<!--安全-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!--测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -32,4 +32,12 @@ eureka:
client:
service-url:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.config.server.com
security:
basic:
enabled: true
user:
name: config
password: server
@@ -8,6 +8,8 @@ spring:
discovery:
enabled: true
service-id: config-server
username: config
password: server
eureka:
client:
serviceUrl:
@@ -2,7 +2,7 @@
spring:
cloud:
config:
uri: http://127.0.0.1:9999/
uri: http://config:server@127.0.0.1:9999/
profile: dev
label: master
name: eureka-server
@@ -4,7 +4,7 @@ spring:
name: eureka-server2
profile: dev
label: master
uri: http://127.0.0.1:9999/
uri: http://config:server@127.0.0.1:9999/
eureka:
client:
service-url:
@@ -8,6 +8,8 @@ spring:
discovery:
service-id: config-server
enabled: true
username: config
password: server
eureka:
client:
serviceUrl:
+5 -1
View File
@@ -2,10 +2,14 @@
spring:
cloud:
config:
uri: http://127.0.0.1:9999/
profile: dev
label: master
name: upms
discovery:
service-id: config-server
enabled: true
username: config
password: server
eureka:
client:
serviceUrl: