Skip to content

Commit 79b2272

Browse files
committed
update config
1 parent 49b70c8 commit 79b2272

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

config-repo/application.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ spring:
2929
scheduled:
3030
skip-pattern: "^org.*HystrixStreamTask$"
3131

32-
management:
33-
security:
34-
enabled: false
32+
authserver:
33+
hostname: auth-service
34+
port: 5000
35+
contextPath: /uaa
3536

3637
security:
3738
oauth2:
3839
resource:
39-
user-info-uri: http://localhost:5000/uaa/current
40+
user-info-uri: http://${authserver.hostname}:${authserver.port}${authserver.contextPath}/current

config-repo/gateway.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ ribbon:
1313
ReadTimeout: 10000
1414
ConnectTimeout: 10000
1515

16-
security:
17-
oauth2:
18-
resource:
19-
userInfoUri: http://localhost:5000/uaa/current
20-
2116
zuul:
2217
ignoredServices: '*'
2318
routes:

config-repo/svca-service.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ server:
33

44
name: zhangxd
55

6-
authserver:
7-
hostname: auth-service
8-
port: 5000
9-
contextPath: uaa
6+
eureka:
7+
instance:
8+
metadata-map:
9+
user.name: ${security.user.name}
10+
user.password: ${security.user.password}
1011

1112
security:
13+
user:
14+
name: user
15+
password: password
1216
oauth2:
1317
client:
1418
clientId: svca-service
15-
clientSecret: ${SVCA_SERVICE_PASSWORD:password}
16-
accessTokenUri: http://localhost:5000/uaa/oauth/token
19+
clientSecret: ${security.user.password}
20+
accessTokenUri: http://${authserver.hostname}:${authserver.port}${authserver.contextPath}/oauth/token
1721
grant-type: client_credentials
1822
scope: server

config-repo/svcb-service.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ server:
33

44
msg: Hello
55

6+
eureka:
7+
instance:
8+
metadata-map:
9+
user.name: ${security.user.name}
10+
user.password: ${security.user.password}
11+
612
security:
13+
user:
14+
name: user
15+
password: password
716
oauth2:
817
client:
918
clientId: svcb-service
10-
clientSecret: ${SVCB_SERVICE_PASSWORD:password}
11-
accessTokenUri: http://localhost:5000/uaa/oauth/token
19+
clientSecret: ${security.user.password}
20+
accessTokenUri: http://${authserver.hostname}:${authserver.port}${authserver.contextPath}/oauth/token
1221
grant-type: client_credentials
1322
scope: server

svca-service/src/main/java/cn/zhangxd/svca/config/ServiceAConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public ResourceServerTokenServices tokenServices() {
5050
@Override
5151
public void configure(HttpSecurity http) throws Exception {
5252
http.authorizeRequests()
53-
.antMatchers("/").permitAll()
5453
.anyRequest().authenticated();
5554
}
5655
}

svcb-service/src/main/java/cn/zhangxd/svcb/config/ServiceBConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public ResourceServerTokenServices tokenServices() {
5050
@Override
5151
public void configure(HttpSecurity http) throws Exception {
5252
http.authorizeRequests()
53-
.antMatchers("/", "/demo").permitAll()
5453
.anyRequest().authenticated();
5554
}
5655
}

0 commit comments

Comments
 (0)