Skip to content

Commit 89dd475

Browse files
committed
feat: permit access to actuators (but only as configured)
Provides a sane default (info and health) for local use and docker.
1 parent 49448d9 commit 89dd475

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

config/application-default.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spring.servlet.multipart.max-request-size: 100MB
4444
management.endpoint.health.access: unrestricted
4545
management.endpoint.health.show-details: ALWAYS
4646
management.endpoint.health.sensitive: false
47-
management.endpoints.web.exposure.include: *
47+
management.endpoints.web.exposure.include: health, info
4848

4949
###############
5050
### Logging ###
@@ -106,6 +106,7 @@ spring.autoconfigure.exclude=org.keycloak.adapters.springboot.KeycloakAutoConfig
106106
# enables search endpoint at /api/v1/search
107107
repo.search.enabled: false
108108
repo.search.index: *
109+
# only enable if endpoint is enabled:
109110
management.health.elasticsearch.enabled: false
110111

111112
# TO BE REMOVED!
@@ -132,6 +133,8 @@ spring.cloud.gateway.proxy.sensitive=content-length
132133
# exchange aka. topic and the queue. The routingKeys are defining wich messages are
133134
# routed to the aforementioned queue.
134135
repo.messaging.enabled: false
136+
# enables report via health actuator. Only activate if messaging is enabled.
137+
management.health.rabbit.enabled: false
135138
repo.messaging.hostname: localhost
136139
repo.messaging.port: 5672
137140
repo.messaging.sender.exchange: record_events

config/application-docker.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spring.servlet.multipart.max-request-size: 100MB
4444
management.endpoint.health.enabled: true
4545
management.endpoint.health.show-details: ALWAYS
4646
management.endpoint.health.sensitive: false
47-
management.endpoints.web.exposure.include: *
47+
management.endpoints.web.exposure.include: health, info
4848

4949
###############
5050
### Logging ###
@@ -106,6 +106,7 @@ spring.autoconfigure.exclude=org.keycloak.adapters.springboot.KeycloakAutoConfig
106106
# enables search endpoint at /api/v1/search
107107
repo.search.enabled: false
108108
repo.search.index: *
109+
# only enable if endpoint is enabled:
109110
management.health.elasticsearch.enabled: false
110111

111112
# TO BE REMOVED!
@@ -132,6 +133,8 @@ spring.cloud.gateway.proxy.sensitive=content-length
132133
# exchange aka. topic and the queue. The routingKeys are defining wich messages are
133134
# routed to the aforementioned queue.
134135
repo.messaging.enabled: false
136+
# enables report via health actuator. Only activate if messaging is enabled.
137+
management.health.rabbit.enabled: false
135138
repo.messaging.hostname: localhost
136139
repo.messaging.port: 5672
137140
repo.messaging.sender.exchange: record_events

src/main/java/edu/kit/datamanager/pit/configuration/WebSecurityConfig.java

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ protected SecurityFilterChain filterChain(HttpSecurity http, Logger logger) thro
7777
.requestMatchers(HttpMethod.GET, "/swagger-ui.html").permitAll()
7878
.requestMatchers(HttpMethod.GET, "/swagger-ui/**").permitAll()
7979
.requestMatchers(HttpMethod.GET, "/v3/**").permitAll()
80+
// permit access to actuator endpoints
81+
.requestMatchers("/actuator/**").permitAll()
8082
// only the actual API is protected
8183
.requestMatchers("/api/v1/**").authenticated()
8284
)

0 commit comments

Comments
 (0)