Skip to content

Commit ac0eb6b

Browse files
actuator tests
1 parent 3a4dde1 commit ac0eb6b

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/bfd-server-ng/src/main/java/gov/cms/bfd/server/ng/Configuration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class Configuration {
3737
"/v3/fhir/swagger-ui/*",
3838
"/v3/fhir/api-docs",
3939
"/actuator",
40+
// We can allow the basic health endpoint, but other actuator endpoints may show
41+
// things we don't want to expose, so /actuator/* should not be allowed
4042
"/actuator/health",
4143
"/actuator/health/*",
4244
"/favicon.ico");

apps/bfd-server-ng/src/test/java/gov/cms/bfd/server/ng/AuthenticationFilterTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ public class AuthenticationFilterTest {
3131
@Mock FilterChain filterChain;
3232

3333
@ParameterizedTest
34-
@ValueSource(strings = {"/favicon.ico", "/v3/fhir/swagger-ui", "/v3/fhir/swagger-ui/style.css"})
34+
@ValueSource(
35+
strings = {
36+
"/favicon.ico",
37+
"/v3/fhir/swagger-ui",
38+
"/v3/fhir/swagger-ui/",
39+
"/v3/fhir/swagger-ui/style.css",
40+
"/actuator/health"
41+
})
3542
void testAllowedPaths(String path) throws ServletException, IOException {
3643
when(environment.getActiveProfiles()).thenReturn(new String[] {"aws"});
3744
when(request.getRequestURI()).thenReturn(path);
@@ -42,7 +49,7 @@ void testAllowedPaths(String path) throws ServletException, IOException {
4249
}
4350

4451
@ParameterizedTest
45-
@ValueSource(strings = {"/v3/fhir/Patient"})
52+
@ValueSource(strings = {"/v3/fhir/Patient", "/actuator/random"})
4653
void testNotAllowedPaths(String path) throws ServletException, IOException {
4754
when(environment.getActiveProfiles()).thenReturn(new String[] {"aws"});
4855
when(request.getRequestURI()).thenReturn(path);

0 commit comments

Comments
 (0)