mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[CST-5288] Introduced spring boot actuators
This commit is contained in:
@@ -280,6 +280,12 @@
|
|||||||
<version>${spring-boot.version}</version>
|
<version>${spring-boot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.flipkart.zjsonpatch</groupId>
|
<groupId>com.flipkart.zjsonpatch</groupId>
|
||||||
<artifactId>zjsonpatch</artifactId>
|
<artifactId>zjsonpatch</artifactId>
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.app.rest.configuration;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.dspace.app.rest.DiscoverableEndpointsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.hateoas.Link;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration class related to the actuator endpoints.
|
||||||
|
*
|
||||||
|
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class ActuatorConfiguration {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DiscoverableEndpointsService discoverableEndpointsService;
|
||||||
|
|
||||||
|
@Value("${management.endpoints.web.base-path:/actuator}")
|
||||||
|
private String actuatorBasePath;
|
||||||
|
|
||||||
|
@EventListener(ApplicationReadyEvent.class)
|
||||||
|
public void registerActuatorEndpoints() {
|
||||||
|
discoverableEndpointsService.register(this, Arrays.asList(new Link(actuatorBasePath, "actuator")));
|
||||||
|
}
|
||||||
|
}
|
@@ -81,7 +81,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||||||
// Configure authentication requirements for ${dspace.server.url}/api/ URL only
|
// Configure authentication requirements for ${dspace.server.url}/api/ URL only
|
||||||
// NOTE: REST API is hardcoded to respond on /api/. Other modules (OAI, SWORD, IIIF, etc) use other root paths.
|
// NOTE: REST API is hardcoded to respond on /api/. Other modules (OAI, SWORD, IIIF, etc) use other root paths.
|
||||||
http.requestMatchers()
|
http.requestMatchers()
|
||||||
.antMatchers("/api/**", "/iiif/**")
|
.antMatchers("/api/**", "/iiif/**", "/actuator/**")
|
||||||
.and()
|
.and()
|
||||||
// Enable Spring Security authorization on these paths
|
// Enable Spring Security authorization on these paths
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
|
@@ -132,3 +132,7 @@ spring.servlet.multipart.max-file-size = 512MB
|
|||||||
|
|
||||||
# Maximum size of a multipart request (i.e. max total size of all files in one request) (default = 10MB)
|
# Maximum size of a multipart request (i.e. max total size of all files in one request) (default = 10MB)
|
||||||
spring.servlet.multipart.max-request-size = 512MB
|
spring.servlet.multipart.max-request-size = 512MB
|
||||||
|
|
||||||
|
#Spring Boot actuator configuration
|
||||||
|
management.endpoint.health.show-details = when-authorized
|
||||||
|
management.endpoint.health.roles = ADMIN
|
||||||
|
Reference in New Issue
Block a user