Provide security matchers for actuator links

Fixes gh-12353
This commit is contained in:
Madhura Bhave
2018-03-07 18:52:48 -08:00
parent 7d1faa1c88
commit 89e42d40c5
7 changed files with 330 additions and 38 deletions

View File

@@ -92,6 +92,16 @@ public class SampleSecureWebFluxCustomSecurityTests {
.accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isOk();
}
@Test
public void actuatorLinksIsSecure() {
this.webClient.get().uri("/actuator").accept(MediaType.APPLICATION_JSON)
.exchange()
.expectStatus().isUnauthorized();
this.webClient.get().uri("/actuator").accept(MediaType.APPLICATION_JSON)
.header("Authorization", "basic " + getBasicAuthForAdmin()).exchange()
.expectStatus().isOk();
}
@Configuration
static class SecurityConfiguration {