Browse Source

Enable application statistics end point

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
39045b8314
3 changed files with 18 additions and 2 deletions
  1. +8
    -0
      bookstore/pom.xml
  2. +9
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java
  3. +1
    -0
      bookstore/src/main/resources/website.properties

+ 8
- 0
bookstore/pom.xml View File

@ -83,6 +83,14 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!--
https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html
-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>


+ 9
- 2
bookstore/src/main/java/com/fjordtek/bookstore/config/WebSecurityConfig.java View File

@ -89,7 +89,12 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity httpSecurity) throws Exception { protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity httpSecurity
.antMatcher(env.getProperty("spring.data.rest.base-path") + "/**")
.requestMatchers()
.antMatchers(
env.getProperty("spring.data.rest.base-path") + "/**",
env.getProperty("page.url.actuator") + "/**"
)
.and()
.authorizeRequests( .authorizeRequests(
authorize -> authorize authorize -> authorize
.anyRequest().hasAuthority(env.getProperty("auth.authority.admin")) .anyRequest().hasAuthority(env.getProperty("auth.authority.admin"))
@ -133,7 +138,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
env.getProperty("page.url.resources.images") + "/**" env.getProperty("page.url.resources.images") + "/**"
// "/favicon.ico", // "/favicon.ico",
).permitAll() ).permitAll()
.antMatchers(env.getProperty("page.url.apiref") + "/**")
.antMatchers(
env.getProperty("page.url.apiref") + "/**"
)
.hasAuthority(env.getProperty("auth.authority.admin")) .hasAuthority(env.getProperty("auth.authority.admin"))
.anyRequest() .anyRequest()
.authenticated() .authenticated()


+ 1
- 0
bookstore/src/main/resources/website.properties View File

@ -24,6 +24,7 @@ page.url.apiref = /apiref
page.url.autherror = /autherror page.url.autherror = /autherror
page.url.error = /error page.url.error = /error
page.url.actuator = /actuator
# BookRestController # BookRestController
# Public JSON end points # Public JSON end points


Loading…
Cancel
Save