Commit Graph

113 Commits

Author SHA1 Message Date
Dave Syer
beef5cfd31 Prevent type not present exception when no security on classpath 2013-12-13 11:10:30 +00:00
Dave Syer
b05ffd1164 Add extra condition to security properties config 2013-12-12 16:04:20 +00:00
Dave Syer
1db28e5b92 Prevent cryptic exception if SecurityProperties not created
Previously if a user happened to provide an @EnableWebSecurity bean
the SecurityProperties would not be created, which is fine until you
add the Actuator (which needs them). Fixed by adding an explicit
SecurityProperties @Bean if not already present.
2013-12-12 15:05:58 +00:00
Dave Syer
023faf092f Fix broken test 2013-12-06 15:45:07 +00:00
Dave Syer
bcae284dd9 Add a shim Endpoint if management context is child
When management endpoints are on a different port the HandlerMappings
are restricted to a single EndpointHandlerMapping, so the error
controller (which is a normal @Controller with @RequestMappings) does
not get mapped.

Fixed by addinga shim Endpoint on "/error" that delegates to the
ErrorController (which interface picks up an extra method).
2013-12-05 09:56:00 +00:00
Dave Syer
884fd0125a Add some handler adapter tests 2013-12-04 14:56:53 +00:00
Dave Syer
2104d9a1e2 Prevent failure of web app with parent context
ServerProperties formerly had an @OnMissingBeanCondition
that didn't restrict the hierarchy. It also asserts that
the current context (not including parents) contains such
a bean. This led to an inevitable failure when there was
an existing instance in the parent context.

Fixed by a) searching only the current context, b) not
adding a ServerProperties bean if the context is not a
web app.
2013-11-29 17:40:16 +00:00
Christian Dupuis
5661f8fc28 Test key/value sanitization 2013-11-29 15:55:06 +01:00
Christian Dupuis
078933c8fd Add actuator endpoint to expose ConfigurationProperties
This information should probably be also available from the console and log similar to AutoConfigurationReport.
2013-11-29 15:16:31 +01:00
Christian Dupuis
00c8633597 Add missing new exception class 2013-11-29 15:16:30 +01:00
Christian Dupuis
2c67e06b47 Move enablement of endpoints into AbstractEndpoint 2013-11-29 15:16:30 +01:00
Dave Syer
e74da3fa73 FIXME test additions 2013-11-28 15:01:00 +00:00
Dave Syer
3e6c1b435f Add @SpringApplicationConfiguration (for integration testing)
Example:

    @RunWith(SpringJUnit4ClassRunner.class)
    @SpringApplicationConfiguration(classes = SampleDataJpaApplication.class)
    public class CityRepositoryIntegrationTests {

    	@Autowired
    	CityRepository repository;

Fixes gh-66.
2013-11-28 14:35:36 +00:00
Dave Syer
3e5e058b02 Ensure /error view is available 2013-11-28 14:20:45 +00:00
Dave Syer
8c9b7bd406 Use SimpleHealthIndicator if DataSource present 2013-11-28 14:20:26 +00:00
Dave Syer
20bede21ad Add support for parent hierarchy in AUtoConfigurationReport 2013-11-28 11:39:27 +00:00
Dave Syer
b74a9b2d06 Add tests to FIXME 2013-11-27 16:03:27 +00:00
Dave Syer
171c1366f9 Move shutdown enable flag to the endpoint 2013-11-26 18:01:08 +00:00
Dave Syer
94e2f90793 Ensure endpoints.jolokia.enabled=false switches off jolokia 2013-11-26 13:27:10 +00:00
Phillip Webb
f4f668a52b Polish 2013-11-25 17:12:56 -08:00
Phillip Webb
8845c9c279 Fixup for upstream Spring changes 2013-11-25 16:25:03 -08:00
Christian Dupuis
04b7b9b2ca Rework handling of default shell authentication method in the absence of Spring Security
In case Spring Security is missing from the class path, shell auto configuration will now fall back gracefully to simple authentication and emit warning to the console.

fixes #114
2013-11-25 16:07:58 +01:00
Christian Dupuis
e69e190ae9 Close application context in test 2013-11-22 20:37:58 +01:00
Christian Dupuis
1b49605749 Make shell username and password configuration properties consistent with general security properties
Now simple authentication for the crsh shell can we configured using shell.auth.simple.user.name and shell.auth.simple.user.password. This is consistent with security.user.name and security.user.password.

fixes #113
2013-11-22 20:37:37 +01:00
Christian Dupuis
2d058570ca Add auto configure support for Jolokia a JMX-HTTP bridge 2013-11-22 18:07:14 +01:00
Christian Dupuis
b14c607d36 Add missing tests 2013-11-22 18:07:14 +01:00
Christian Dupuis
405c9d5593 Allow management endpoints to express what http methods they support
Previously a management endpoint was either GET or POST. That requirement seems limited.
2013-11-22 18:07:14 +01:00
Christian Dupuis
845aeecbad Properly close application context in tests 2013-11-22 18:07:14 +01:00
Christian Dupuis
cd89691726 Pin order to of crsh auto configuration to happen after any security related configuration
If crsh auto configuration happens too early a AuthenticationManager contributed by SecurityAutoConfiguration will not be detected
2013-11-22 18:07:13 +01:00
Dave Syer
61dd7d1dbb Add port scan to ServerProperties (server.scan=true)
Also moved ServerProperties to autoconfigure project.
2013-11-22 16:56:43 +00:00
Dave Syer
bd26b28aa5 Extract actuator security into separate classes
So spring-security + a web app is secure by default
(you don't need the actuator).
2013-11-21 16:47:29 +00:00
Christian Dupuis
f3a225f35f Polish and rework default authentication method if a Spring Security AuthenticationManager is available
In case a Spring Security AuthenticationManager is found in the app context the auto configuration will change default shell authentication method to auth against Spring Security. In addition shell access will get protected by the specific role configured in SecurityProperties.Management.

Certainly this can be overridden by providing shell.auth and shell.auth.spring.roles.
2013-11-20 17:15:45 +01:00
Christian Dupuis
43c0c932e6 Ensure telnet connector gets installed if available on the class path 2013-11-20 17:15:45 +01:00
Christian Dupuis
2e926601f2 Polish 2013-11-18 20:59:25 +01:00
Christian Dupuis
dba8c01035 Polish 2013-11-18 20:09:58 +01:00
Christian Dupuis
e16e23230c Clarify default authentication settings for shell access 2013-11-18 17:48:21 +01:00
Christian Dupuis
41cbbeba79 Re-Introduce authentication specific properties 2013-11-18 17:42:50 +01:00
Christian Dupuis
e009d3e47d Polish
Fixed inconsistency in method naming after last polish. Method and class name should use 'crsh' instead of 'crash' to be aligned with CRaSH code base.

Implemented facility to provide custom shell properties by adding beans of type CrshShellProperties to the ApplicationContext.
2013-11-18 17:20:45 +01:00
Christian Dupuis
dc252c7417 Remove unnecessary String concatenation 2013-11-18 15:06:05 +01:00
Dave Syer
2f7214002d Update Spring to catch SPR-11069 2013-11-17 07:59:16 +00:00
Phillip Webb
0f85f31960 Polish 2013-11-16 01:22:10 -08:00
Phillip Webb
64f32893bb Source format and clean-up 2013-11-16 00:08:18 -08:00
Phillip Webb
883fd9162f Polish 2013-11-16 00:08:17 -08:00
Dave Syer
b39ab925cf Make the AutoConfigurationReportEndpoint path a bit shorter 2013-11-14 14:54:32 +00:00
Phillip Webb
dc3d670019 Strip trailing whitespace 2013-11-07 10:32:57 -08:00
Christian Dupuis
1f922f49b0 Switch to placeholders in conditional expressions; Ensure that Crsh auto configuration works without Spring Security 2013-11-07 12:48:03 +01:00
Christian Dupuis
a498a7f477 Make simple authentication the default and log default password 2013-11-07 12:48:03 +01:00
Phillip Webb
dafeddca09 Rework auto-configure report
Update the auto-configuration report to improve log formatting and to
separate the internal report data-structure from the JSON friendly
endpoint data-structure.
2013-11-06 21:40:05 -08:00
Phillip Webb
ab249b034d Rename Outcome -> ConditionOutcome 2013-11-06 15:40:09 -08:00
Christian Dupuis
9f13d291ec Return early if no plugins should be disabled 2013-11-06 10:35:15 +01:00