[bs-138] Make it easy to secure only the management endpoints

Example: web UI with publicly available static assets

    # application.properties:
    security.ignored: /css/**,/script/**

Example: web UI with publicly available everything, but secure
management endpoints.

    # application.properties:
    # Empty path for basic security (default is /**)
    security.basic.path=

[Fixes #50721675]
This commit is contained in:
Dave Syer
2013-05-30 15:37:49 +01:00
parent 7b0ec252dd
commit e011312c68
12 changed files with 244 additions and 46 deletions

View File

@@ -28,7 +28,6 @@ import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Integration tests for separate management and main service ports.
@@ -83,10 +82,7 @@ public class ManagementAddressServiceBootstrapApplicationTests {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = getRestTemplate().getForEntity(
"http://localhost:" + managementPort + "/metrics", Map.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
@SuppressWarnings("unchecked")
Map<String, Object> body = entity.getBody();
assertTrue("Wrong body: " + body, body.containsKey("counter.status.200.root"));
assertEquals(HttpStatus.UNAUTHORIZED, entity.getStatusCode());
}
@Test