Skip to content

Commit

Permalink
✨ : add /admin/info endpoint
Browse files Browse the repository at this point in the history
This endpoint exposes git information (branch/commit), and build information (artifact/version)
  • Loading branch information
juwit committed Aug 21, 2019
1 parent 82d8f23 commit 883da5f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<!-- build information generation for /admin/info endpoint -->
<!-- see https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-build-info -->
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -190,6 +199,13 @@
</includes>
</configuration>
</plugin>

<!-- git information generation for /admin/info endpoint -->
<!-- see https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-build-info -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/codeka/gaia/config/ActuatorSecurity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ActuatorSecurity extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
http.requestMatcher(EndpointRequest.to("health")).authorizeRequests()
http.requestMatcher(EndpointRequest.to("health", "info")).authorizeRequests()
.anyRequest().permitAll();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring.data.rest.basePath=/api

management.endpoints.web.base-path=/admin
# exposing only health endpoint
management.endpoints.web.exposure.include=health
management.endpoints.web.exposure.include=health,info

# activating ldap health only if gaia has a ldap connexion
management.health.ldap.enabled=${gaia.ldap.enabled:false}
Expand Down

0 comments on commit 883da5f

Please sign in to comment.