spring cloud : e-commerce(user-service) - spring cloud config(actuator refresh)
This commit is contained in:
@@ -9,4 +9,5 @@ spring:
|
||||
config:
|
||||
server:
|
||||
git:
|
||||
uri: file://C:/Users/Woojin/Desktop/study/config
|
||||
# uri: file://C:/Users/Woojin/Desktop/study/config
|
||||
uri: file:///Users/bobby/Desktop/kim/study/config
|
||||
@@ -26,6 +26,10 @@ dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
|
||||
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||
|
||||
|
||||
@@ -33,8 +33,11 @@ public class UserController {
|
||||
|
||||
@GetMapping("/health_check")
|
||||
public String status() {
|
||||
return String.format("It's working in User Service on PORT %s",
|
||||
env.getProperty("local.server.port"));
|
||||
return "It's working in User Service"
|
||||
+ ", port(local.server.port)=" + env.getProperty("local.server.port")
|
||||
+ ", port(server.port)=" + env.getProperty("server.port")
|
||||
+ ", token secret=" + env.getProperty("token.secret")
|
||||
+ ", token expiration time=" + env.getProperty("token.expiration_time");
|
||||
}
|
||||
|
||||
@GetMapping("/welcome")
|
||||
|
||||
@@ -31,8 +31,9 @@ public class WebSecurity extends WebSecurityConfigurerAdapter {
|
||||
http.csrf().disable().headers().frameOptions().disable();
|
||||
|
||||
// http.authorizeRequests().antMatchers("/users/**").permitAll();
|
||||
http.authorizeRequests().antMatchers("/actuator/**").permitAll();
|
||||
http.authorizeRequests().antMatchers("/**")
|
||||
.hasIpAddress("172.30.1.7")
|
||||
.hasIpAddress("127.0.0.1")
|
||||
.and()
|
||||
.addFilter(getAuthenticationFilter());
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ logging:
|
||||
level:
|
||||
com.example.userservice: DEBUG
|
||||
|
||||
token:
|
||||
expiration_time: 86400000
|
||||
secret: user_token
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: refresh, health, beans
|
||||
|
||||
#token:
|
||||
# expiration_time: 86400000
|
||||
# secret: user_token
|
||||
@@ -0,0 +1,5 @@
|
||||
spring:
|
||||
cloud:
|
||||
config:
|
||||
uri: http://127.0.0.1:8888
|
||||
name: ecommerce
|
||||
Reference in New Issue
Block a user