Commit Graph

131 Commits

Author SHA1 Message Date
Phillip Webb d6dbbebc88 Polish 2013-12-18 22:39:37 -08:00
Phillip Webb 7c78b74a76 Minor polish 2013-12-18 22:21:13 -08:00
Phillip Webb 43b820a7d3 Rename Endpoint path to ID 2013-12-18 21:00:37 -08:00
Dave Syer 451acb5679 Move JolokiaEndpoint so it is not an Endpoint 2013-12-18 20:05:34 -08:00
Dave Syer 7f1264bb65 Replace @FrameworkEndpoint with MvcEndpoint interface 2013-12-18 20:05:34 -08:00
Dave Syer 87e00cfae9 Extract MVC concerns completely from Endpoint implementations 2013-12-18 20:05:34 -08:00
Dave Syer 6443800038 Add actuator-noweb sample 2013-12-18 20:05:33 -08:00
Dave Syer 332f23a0ee Add parent properties to config props endpoint 2013-12-18 20:05:33 -08:00
Dave Syer bbac4ea9fb @FrameworkEndpoint replaces EndpointHandlerAdapter 2013-12-18 20:05:33 -08:00
Christian Dupuis 5a978e2f31 Change strategy from ApplicationListener to SmartLifecycle to avoid multiple registration attempts for the same beans
When running with parent/child application contexts the previous implementation was trying to re-register the same beans with JMX which led to errors.
2013-12-18 22:42:06 +01:00
Christian Dupuis 0a04b74379 Allow configuration of domainName and key for endpoint JMX export 2013-12-18 21:12:24 +01:00
Christian Dupuis cd1a228210 Allow Endpoint JMX export to be switched off 2013-12-18 19:03:30 +01:00
Christian Dupuis 32818515b7 Expose endpoints via JMX
Actuator endpoints are now being exposed over JMX.
2013-12-18 19:03:30 +01:00
Phillip Webb 513c6a1de2 Polish 2013-12-16 14:38:52 -08:00
Phillip Webb 85fb1cba0b Rework HttpMessageConverters 2013-12-16 14:38:48 -08:00
Dave Syer b72002142d Split MessageConverters auto config out into separate class 2013-12-16 16:13:39 +00:00
Dave Syer c78973e375 MessageConverters -> HttpMessageConverters 2013-12-15 13:33:50 +00:00
Dave Syer c2b499c775 Support for @Beans of type HttpMessageConverter, and Jackson specific details
You can contribute additional HttpMessageConverters
by simply adding beans of that type in a Spring Boot
context. If a bean you add is of a type that would have been included
by default anyway (like MappingJackson2HttpMessageConverter for JSON
conversions) then it will replace the default value. A convenience
bean is provided of type MessageConverters (always available if you
use the default MVC configuration) which has some useful methods to
access the default and user-enhanced message converters (useful, for
example if you want to manually inject them into a custom
RestTemplate).

There are also some convenient configuration shortcuts for Jackson2.
The smallest change that might work is to just add beans of type
Module to your context. They will be registered with the default
ObjectMapper and then injected into the default message
converter. In addition, if your context contains any beans of type
ObjectMapper then all of the Module beans will be registered with
all of the mappers.
2013-12-14 22:05:30 +00:00
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