Commit Graph

1536 Commits

Author SHA1 Message Date
Stephane Nicoll
c41ff17dd7 Provide relevant default values for Enums
This commits adds manual metadata for enums that have a default value
since the annotation processor is not able to detect that yet.

Closes gh-7890
2017-01-19 13:19:13 +01:00
Phillip Webb
f42ebe428c Remove JSR-330 configuration annotations
Replace JSR-330 validation annotations from all internal
`@ConfigurationProperties` classes with standard Asserts.

Prior to this commit validation of our own configuration properties
would only occur when the user happens to have compliant JSR-330
implementation on their classpath.

See gh-7579
2017-01-18 20:51:35 -08:00
Phillip Webb
0a6456a748 Always use prefix config annotation attribute
Update use of `@ConfigurationProperties` to prefer the more explicit
`prefix` attribute, rather than `value`.

See gh-7579
2017-01-18 20:49:53 -08:00
Phillip Webb
43d432a527 Polish 2017-01-18 20:35:41 -08:00
Andy Wilkinson
5c9aa41c07 Update InMemoryRichGaugeRepository to support increments
Closes gh-2902
2017-01-17 17:15:26 +00:00
Andy Wilkinson
7fa33cddd7 Merge branch '1.4.x' into 1.5.x 2017-01-17 15:00:01 +00:00
Andy Wilkinson
a02c2d4155 Improve the documentation of Health.Status constants
Closes gh-7784
2017-01-17 14:59:53 +00:00
Johnny Lim
acc36c076d Polish
See gh-8004
2017-01-17 09:53:50 +01:00
Andy Wilkinson
f72799186e Merge branch '1.4.x' into 1.5.x 2017-01-16 11:47:52 +00:00
Andy Wilkinson
a72365e1a2 Expose context hierarchy in beans endpoint
Previously, the beans endpoint would only expose the context that
contained the endpoint. This commit updates the endpoint so that
the context that contains the endpoint and all of its ancestors are
exposed.

In a context hierarhcy, the relation ship is child -> parent and there
is no way to navigate from a parent to a child. As a result, any
contexts that are descendants of the context containing the endpoint
are not exposed.

Closes gh-5188
2017-01-16 11:47:14 +00:00
Stephane Nicoll
8bef0a1e60 Polish contribution
Closes gh-7905
2017-01-16 11:24:36 +01:00
Eddú Meléndez
b2250f4ad8 Add LDAP health actuator
Provide specific health actuator endpoint to verify if LDAP connection
is valid.

See gh-7905
2017-01-16 10:56:49 +01:00
Stephane Nicoll
f21c767356 Polish contribution
Closes gh-7914
2017-01-15 09:45:32 +01:00
Kazuki Shimizu
a6756c9ed3 Allow lowercase logger level on MVC endpoint
See gh-7914
2017-01-15 09:42:40 +01:00
Andy Wilkinson
ae3434ba4c Merge branch '1.4.x' into 1.5.x 2017-01-13 18:45:50 -05:00
Andy Wilkinson
d2201d5284 Correct copyright dates and enforce that starting year is 2012
Closes gh-7923
2017-01-13 18:43:30 -05:00
Phillip Webb
9159c87bf9 Polish 2017-01-10 09:51:11 -05:00
Stephane Nicoll
fefc66625f Merge branch '1.4.x' into 1.5.x 2017-01-08 09:20:00 +01:00
Eddú Meléndez
f896ff9a10 Fix incomplete assertions
Closes gh-7907
2017-01-08 09:12:54 +01:00
Madhura Bhave
4ea47220e9 Match nested paths for insensitive actuators
Update `ManagementWebSecurityAutoConfiguration` to match nested path
for insensitive actuators.

Prior to this commit, when Spring Security was on the classpath
nested paths were considered sensitive (even if the actuator
endpoint was not sensitive). i.e. when setting
`endpoints.env.sensitive=false` `/env` could be accessed without
authentication but `/env/user` could not.

Fixes gh-7868
Closes gh-7881
2017-01-05 18:45:30 -08:00
Johnny Lim
f915ae197a Polish 2017-01-04 09:53:45 +01:00
Madhura Bhave
530c3cd3be Simplify HealthMvcEndpoint security
Expose full health details if management security is disabled or
management role is present.

Fixes gh-7604
Closes gh-7852
2017-01-03 19:00:14 -08:00
Phillip Webb
2fe4d60b47 Add management.cloudfoundry.* meta-data
Update configuration meta-data and appendix to include
`management.cloudfoundry.*` meta-data.

See gh-7108
2017-01-03 17:24:58 -08:00
Phillip Webb
8ccd4db513 Merge branch '1.4.x' into 1.5.x 2017-01-03 15:14:14 -08:00
Phillip Webb
732011987d Fix ManagementContextConfiguration @Order support
Update `ManagementContextConfigurationsImportSelector` to instantiate
classes so that order annotations are respected.

Fixes gh-7814
2017-01-03 15:12:35 -08:00
Phillip Webb
b4b8370632 Fix AuditEventsJmxEndpoint bean name
See gh-6579
2017-01-03 14:43:24 -08:00
Phillip Webb
8a9a61b64f Prevent duplicate JmxEndpoint MBean registration
Update JmxEndpoint support so that the `@ManagedResource` annotation
is no longer required. This prevents both `EndpointMBeanExporter` and
the regular `AnnotationMBeanExporter` from both registering the bean.

Fixes gh-7813
See gh-6579
2017-01-03 14:43:24 -08:00
Phillip Webb
51762642b2 Polish audit event endpoint support
Closes gh-6579
2017-01-02 19:43:26 -08:00
Phillip Webb
5b40eb48e0 Improve MBean without backing Endpoint support
Improve support for MBeans without a backing endpoint by introducing
a `JmxEndpoint` interface. The `JmxEndpoint` is intentionally
similar in design to the `MvcEndpoint` from the `mvc` package and
allows for completely custom JMX beans that are not backed by any
real actuator `Endpoint`.

The `AuditEventsMBean` has been refactored to use the new interface and
has been renamed to `AuditEventsJmxEndpoint`.

See gh-6579
2017-01-02 19:43:14 -08:00
Vedran Pavic
2f1e4f0c02 Add MVC and JMX endpoints to retrieve audit events
Add MVC and JMX specific endpoints that allow audit events to be
retrieved.

See gh-6579
2017-01-02 19:20:35 -08:00
Vedran Pavic
a6d18f714f Add JMX without backing Endpoint support
Decompose `EndpointMBean` to improve support for JMX endpoints without
a backing `Endpoint`.

See gh-6579
2017-01-02 19:19:04 -08:00
Phillip Webb
e1eb48e8b4 Fix warnings 2016-12-30 17:26:25 -08:00
Phillip Webb
a167db7b37 Allow OPTIONS requests in interceptors
Update `MvcEndpointSecurityInterceptor` and
`CloudFoundrySecurityInterceptor` to allow OPTIONS requests to be
processed.

Fixes gh-7720
2016-12-30 14:05:29 -08:00
Phillip Webb
aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Phillip Webb
367963f29f Polish 2016-12-28 15:41:00 -08:00
Phillip Webb
8b69856fc9 Polish 2016-12-28 15:23:26 -08:00
Stephane Nicoll
8b7055719f Move InMemoryMultiMetricRepository to a separate class
This commit moves the `MultiMetricRepository` implementation from
`InMemoryMetricRepository` to `InMemoryMultiMetricRepository`. Both
implementations can share the same underlying store (and are for backward
compatible reasons).

The side effect is that `reset` now works as expected for a group.

Closes gh-7687
2016-12-28 18:16:10 +01:00
Phillip Webb
3af5ae2a26 Polish ObjectProvider names
Consistently use the simple name for ObjectProvider parameter and
field names. For example:

  `ObjectProvider<Something> something`

rather than

  `ObjectProvider<Something> somethingProvider`
2016-12-27 15:04:06 -08:00
Phillip Webb
e0541d0f74 Polish 2016-12-27 14:48:44 -08:00
Stephane Nicoll
0d4ef3dbdb Fix formatting 2016-12-27 11:41:53 +01:00
Stephane Nicoll
d0fa72a169 Filter AbstractRoutingDataSource from health indicator
Closes gh-6806
2016-12-27 10:11:52 +01:00
Spring Buildmaster
9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Stephane Nicoll
5d909a969f Polish contribution
Closes gh-6613
2016-12-22 11:44:49 +01:00
Eddú Meléndez
53d25999f3 Add support for multiple beans in the Flyway and Liquibase endpoints
Closes gh-6610
See gh-6613
2016-12-22 11:44:12 +01:00
Phillip Webb
b87e02dde0 Polish Spring Integration metrics support
See gh-7722
2016-12-21 20:18:06 -08:00
Artem Bilan
d69e43b433 Refactor Spring Integration metrics support
Update Spring Integration metrics support since Spring Integration
`4.3.6`+ no longer needs `spring-integration-jmx` enable
`MessageChannel`, `MessageHandler` and `MessageSource` metrics.

- Add `IntegrationManagementConfiguration` conditional auto-configuration
  to provide `@EnableIntegrationManagement` when JMX is `enabled` or there
  is no `IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME` bean.
  By default this bean doesn't exist and you explicitly should declare it
  (e.g. via `@EnableIntegrationManagement`) if you would like to collect
  metrics. At the same time Spring Integration enables it when JMX
  management is present (that is a purpose of that new
  `IntegrationManagementConfiguration`)

- Change `SpringIntegrationMetricReader` to read metrics from the
  `IntegrationManagementConfigurer`, not `IntegrationMBeanExporter`

- Change `PublicMetricsAutoConfiguration` to register
  `IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME` bean if
  not present. Since we are here in `actuator`, therefore we are
  interested in the metrics for SI as well.

- Since we don't need JMX for the metrics any more, remove SI-JMX
  dependency from the `spring-boot-starter-integration`.

- Remove `IntegrationManagementConfiguration` modification from the
  `integrationMbeanExporter()`, since that looks like mutation of an
  external object, when end-user would prefer their own options.
  Therefore we don't need `ObjectProvider<IntegrationManagementConfigurer>`, too

- Add missed `MessageSourceMetrics` gathering for the
  `SpringIntegrationMetricReader`

Closes gh-7722
2016-12-21 20:18:06 -08:00
Johnny Lim
e12b4a944f Polish 2016-12-21 20:18:04 -08:00
Phillip Webb
38f7389eab Polish loggers 2016-12-20 21:16:40 -08:00
Phillip Webb
c76bd2d81e Refine error message from Endpoint MVC security
Update the error message to return less information to the client.
Details of how to disable security are now written to the log instead.

See gh-7605
See gh-7634
2016-12-20 18:47:39 -08:00
Madhura Bhave
38eeae2166 Send error with message from Endpoint MVC security
Update `MvcEndpointSecurityInterceptor` to that it sends an error in the
same way as Spring Security. Prior to this commit the `ErrorController`
would not handle endpoint security errors.

Fixes gh-7605
Closes gh-7634
2016-12-20 18:27:25 -08:00
Phillip Webb
dba8ef2ba8 Polish CF management skip SSL opt-in
See gh-7629
See gh-7655
2016-12-20 18:25:32 -08:00
Madhura Bhave
34712cbf76 Switch CF management skip SSL to opt-in
Change CloudFoundryActuatorAutoConfiguration so that skipping of SSL
verification is now opt-in rather than enabled by default.

Fixes gh-7629
Closes gh-7655
2016-12-20 18:24:15 -08:00
Phillip Webb
06a7ab0cd5 Polish ReservoirFactory support
Polish Dropwizrd reservoir support including a refactor of
`ReservoirFactory` to allow reservoirs to be created based on a
metric name.

See gh-5199
See gh-7105
2016-12-20 15:12:14 -08:00
Lucas Saldanha
1fc2e87053 Enable custom Reservoir with Dropwizard metrics
Uses the ReservoirFactory to customize the implementation of
the Reservoir that will be used when creating Timer and Histogram
in the DropwizardMetricServices.

Fixes gh-5199
Closes gh-7105
2016-12-20 14:56:29 -08:00
Phillip Webb
d15f3548be Polish 2016-12-19 13:12:03 -08:00
Phillip Webb
6121208cbb Polish formatting 2016-12-19 12:47:03 -08:00
Phillip Webb
4b9cba351b Merge branch '1.4.x' into 1.5.x 2016-12-19 12:36:57 -08:00
Phillip Webb
bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Stephane Nicoll
684be0f048 Polish contribution
Closes gh-6852
2016-12-16 14:19:20 +01:00
Vedran Pavic
899f7aa8f0 Add constants for supported audit event types
See gh-6582
2016-12-16 13:59:50 +01:00
Stephane Nicoll
f560f338ab Polish contribution
Closes gh-7219
2016-12-16 11:58:26 +01:00
Vedran Pavic
60e054d0e4 Add LoggersEndpointMBean
See gh-7219
2016-12-16 11:05:17 +01:00
Eddú Meléndez
fc09a23991 Add missing actuator metadata
Health metadata for cassandra and couchbase is added.

See gh-7632
2016-12-14 19:16:42 +01:00
Johnny Lim
6d1b752ffe Polish
Closes gh-7552
2016-12-14 19:14:24 +01:00
Oscar Utbult
38713c473f Remove redundant array creation for calling varargs method
Closes gh-7551
2016-12-14 19:12:08 +01:00
Andy Wilkinson
595679bed4 Disable management security when testing Jolokia endpoint 2016-12-13 13:02:40 +00:00
Andy Wilkinson
391a760c3c Merge branch '1.4.x' into 1.5.x 2016-12-13 09:44:16 +00:00
Andy Wilkinson
4ec95b8308 Ensure that JolokiaMvcEndpoint destroys underlying controller
Closes gh-7606
2016-12-13 09:42:14 +00:00
Dave Syer
1baf3c63c4 Make the Spring Security part of CF autoconfig conditional
Otherwise you get a class not found exception at runtime in
CF when Spring Securtity is not on the classpath.
2016-12-12 15:05:48 +00:00
Dave Syer
cc8ecb6ff5 Clear VCAP_APPLICATION after tests
So that other CF tests do not fail.
2016-12-12 15:05:07 +00:00
Madhura Bhave
5d8e00cb56 Fix HealthMvcEndpointTests
See gh-7569
2016-12-06 13:18:10 -08:00
Madhura Bhave
1be5812cf0 Require ACTUATOR role rather than ADMIN
Update management security to require an `ACTUATOR` role rather than
`ADMIN` by default. This should reduce the risk of users accidentally
exposing actuator endpoints because they happen to use a role named
`ADMIN`.

Fixes gh-7569
2016-12-05 17:58:16 -08:00
Madhura Bhave
95be208f0f Use IgnoredRequestCustomizer to ignore paths
Update `SpringBootWebSecurityConfiguration` to ignore requests by
delegating to `IgnoredRequestCustomizer` beans. This allows a single
Spring Boot `WebSecurityConfigurer<WebSecurity>` bean to be used which
prevents potential exceptions caused by duplicate `@Order` values.

Fixes gh-7106
2016-12-05 17:57:18 -08:00
Madhura Bhave
d09aafacda Add a security interceptor for actuator endpoints
Update `AbstractEndpointHandlerMapping` to support a security
interceptor that can be used to enforce endpoint security.

Fixes gh-6889
2016-12-05 17:57:00 -08:00
Andy Wilkinson
967625db1e Replace field injection with constructor injection in config classes
Closes gh-7563
2016-12-05 10:48:01 +00:00
Andy Wilkinson
1464425d64 Remove use of @Component from classes that are not scanned
Closes gh-7549
2016-12-02 17:57:21 +00:00
Stephane Nicoll
ee72e788ed Rename spring-boot-junit-runners to spring-boot-test-support
Closes gh-7421
2016-12-01 16:25:47 +01:00
Stephane Nicoll
85de72c0d0 Merge branch '1.4.x' into 1.5.x 2016-12-01 15:26:06 +01:00
Stephane Nicoll
2a85a2557d Fix health indicator auto-configuration order
Previously, the health auto-configuration `AutoconfigureOrder` entry for
couchbase was referring to the standard couchbase auto-configuration that
is not responsible to configure the `CouchbaseOperations` bean. Yet, the
health indicator implementation was relying on the presence of such a
bean.

This commit fixes the `AutoconfigureOrder` entry so that it refers to
`CouchbaseDataAutoConfiguration` now.

Closes gh-7543
2016-12-01 15:25:51 +01:00
Andy Wilkinson
9c20ada927 Merge branch '1.4.x' into 1.5.x 2016-12-01 13:26:45 +00:00
Andy Wilkinson
356edc725c Handle request mappings with regular expressions in MetricsFilter
Closes gh-7503
2016-12-01 13:22:55 +00:00
Andy Wilkinson
2be554456e Introduce SearchStrategy.ANCESTORS as a replacement for .PARENTS
Closes gh-6763
2016-11-28 15:41:53 +00:00
Andy Wilkinson
dce1487424 Merge branch '1.4.x' into 1.5.x 2016-11-24 20:57:34 +00:00
Andy Wilkinson
e19c6245ef Consider endpoints.sensitive when endpoints.health.sensitive is not set
Closes gh-7476
2016-11-24 20:57:29 +00:00
Andy Wilkinson
f5dd90815b Polishing: fix some compiler warnings 2016-11-22 11:07:51 +00:00
Phillip Webb
1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
2016-11-18 17:27:54 -08:00
Phillip Webb
c2c5611f77 Polish 2016-11-18 15:58:56 -08:00
Madhura Bhave
3a3228fc70 Add CORS interceptor for Cloud Foundry actuators
This interceptor processes the response with CORS headers
and apepars before the Cloud Foundry security interceptor.

See gh-7108
2016-11-18 09:26:31 -08:00
Andy Wilkinson
1cd781b242 Make spring-boot-test compatible with Mockito 2.1 and 2.2
We use some internal Mockito classes and some  breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.

To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.

Closes gh-6520
2016-11-18 16:39:44 +00:00
Andy Wilkinson
5527e3fdad Fix SpringApplicationHierarchyTests following latest Neo4j changes
See gh-7391
2016-11-18 11:54:05 +00:00
Johnny Lim
8038882d46 Polish
Closes gh-7403
2016-11-16 13:36:51 -08:00
Andy Wilkinson
387a406aad Merge branch '1.4.x' into 1.5.x 2016-11-16 09:13:17 +00:00
Phillip Webb
449b42ffa0 Polish LinksEnhancer to use endpoint name
See gh-7164
See gh-7132
2016-11-15 18:07:50 -08:00
Madhura Bhave
ada02232b9 Change LinksEnhancer to use endpoint name
Update `LinksEnhancer` to use NamedEndpoint names as rel names. If the
endpoint name is not available, fallback to endpoint path. Allow
multiple hrefs per rel if path is different.

Fixes gh-7132
Closes gh-7164
2016-11-15 18:03:26 -08:00
Madhura Bhave
0e3a3df6f4 Return log levels in /loggers endpoint payload
Update `LoggersEndpoint` to additionally return the log levels actually
supported by the system.

Fixes gh-7396
2016-11-15 14:32:02 -08:00
Phillip Webb
764f13453a Merge branch '1.4.x' into 1.5.x 2016-11-15 13:58:54 -08:00
Phillip Webb
bacf0878af Polish 2016-11-15 10:40:21 -08:00
Andy Wilkinson
24cc5d5644 Give javac's type inferencing a helping hand 2016-11-15 13:29:19 +00:00
Andy Wilkinson
22e456a177 Merge branch '1.4.x' into 1.5.x 2016-11-15 13:14:30 +00:00
Madhura Bhave
2697bf2ba1 Add Content-Type to allowed headers for CloudFoundry actuators
See gh-7108
2016-11-11 12:09:16 -08:00
Madhura Bhave
af61278213 Extend HealthMvcEndpoint for Cloud Foundry
The CloudFoundryHealthMvcEndpoint does not perform additional
security checks since security is handled by the interceptor.

See gh-7108
2016-11-09 11:04:51 -08:00
Madhura Bhave
a3bcb2778f Add message to response body for Cloud Foundry security error
See gh-7108
2016-11-09 10:54:56 -08:00
Spring Buildmaster
e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Andy Wilkinson
2e76687d17 Merge branch '1.4.x' into 1.5.x 2016-11-08 13:50:41 +00:00
Andy Wilkinson
5f44598d8b Remove use of static import that Checkstyle prohibits 2016-11-08 13:50:15 +00:00
Andy Wilkinson
218d28f74c Merge branch '1.4.x' into 1.5.x 2016-11-08 13:22:58 +00:00
Andy Wilkinson
33dcd853fd Ensure that health endpoint remains insecure without Spring Security
The changes made in 6a2ac080 mean that getSecurity() on
ManagementServerProperties will no longer return null when Spring
Security is on the classpath. This had the unwanted side-effect of
causing the health endpoint to hide its details when Spring Security
was not on the classpath.

This commit reinstates the previous behaviour by only considering
the health endpoint to be secure if Spring Security is on the
classpath and management.security.enabled is true.

Closes gh-7345
2016-11-08 13:18:05 +00:00
Madhura Bhave
82f89b4ac1 Add custom headers to allowed CORS headers for CF actuators
Update CORS configuration to support Authorization and X-Cf-App-Instance.

See gh-7108
2016-11-07 15:37:09 -08:00
Stephane Nicoll
01e66ecbd5 Merge branch '1.4.x' into 1.5.x 2016-11-05 11:15:27 +01:00
Stephane Nicoll
2c71cb8efd Polish 2016-11-05 11:10:17 +01:00
Stephane Nicoll
4407194c00 Replace sample by integration test
Closes gh-3888
2016-11-05 11:09:36 +01:00
Phillip Webb
6c76353682 Default management.cloudfoundry.enabled to true
Update `CloudFoundryActuatorAutoConfiguration` so that it is enabled
when `management.cloudfoundry.enabled` is missing.

See gh-7108
2016-11-04 17:26:25 -07:00
Madhura Bhave
a77cfc3b0e Skip SSL validation when calling Cloud Foundry
Update CloudFoundrySecurityService so that SSL validation is not
required. We're unlikely to have configured public keys for the
REST endpoints we need to call. Since the endpoints are provided via
environment variables we can implicitly trust them.

See gh-7108
2016-11-04 17:26:25 -07:00
Madhura Bhave
862a06eb7a Add POST to allowed CORS methods for CF actuators
Update CORS configuration to support POST.

See gh-7108
2016-11-04 16:41:49 -07:00
Madhura Bhave
1005feb27d Update discovery endpoint to respect AccessLevel
Change `CloudFoundryDiscoveryMvcEndpoint` so that `AccessLevel` rights
are consulted so that only accessible links are returned.

See gh-7108
2016-11-04 16:41:49 -07:00
Madhura Bhave
340f1d5574 Add security for Cloud Foundry actuators
Add security to Cloud Foundry actuator endpoints. Security is enforced
by a `HanderInterceptor` on `CloudFoundryEndpointHandlerMapping`. Each
endpoint call expects an 'Authorization' header containing a bearer
token. The token signature is checked against the UAA public keys then
passed to the Cloud Controller to obtain an ultimate access level.

The client may either have 'RESTRICTED' or FULL' access, with the latter
only providing access to a limited set of endpoints.

See gh-7108
2016-11-04 16:41:48 -07:00
Phillip Webb
81c5753f4d Merge branch '1.4.x' into 1.5.x 2016-11-03 14:49:38 -07:00
Phillip Webb
6a2ac080ac Create our own SessionCreationPolicy enum
Update `ManagementServerProperties` so that `security.sessions` no
longer uses `SessionCreationPolicy` from Spring Security. We now
use our own enun which allows `management.security.*` properties to
be set without the risk of a `ClassNotFoundException`.

Fixes gh-3888
2016-11-03 14:36:49 -07:00
Andy Wilkinson
bdfceae24c Merge branch '1.4.x' into 1.5.x 2016-11-03 20:15:13 +00:00
Andy Wilkinson
97e5e32496 Make sure the MetricsFilter uses committed response's status
Previously, if an exception was thrown during request handling after
the response had been committed, i.e. after the status and headers
had been written, the metrics filter would assume that it was a 500
response. This was potentially inaccurate as the status had already
been sent to the client and before the exception was thrown and it
may have been something other than a 500.

This commit updates MetricsFilter so that it will use the
status from the response if the response has been committed even when
an exception is thrown.

Closes gh-7277
2016-11-03 20:08:31 +00:00
Andy Wilkinson
fe50b2019e Merge branch '1.4.x' into 1.5.x 2016-11-01 13:52:51 +00:00
Andy Wilkinson
b191974faa Reflect Java 7/8 differences in javadoc for metric repository auto-config
Closes gh-6985
2016-11-01 13:51:46 +00:00
Phillip Webb
5b66ffbb4b Merge branch '1.4.x' into 1.5.x 2016-10-31 23:09:36 -07:00
Phillip Webb
60355e0e11 Fix ResourceHttpRequestHandler delegate
Fix ResourceHttpRequestHandler to set the ServletContext following the
Spring Framework update for SPR-14851.
2016-10-31 15:04:43 -07:00
Johnny Lim
7bb63238ab Fix typo
Closes gh-7253
2016-10-31 11:37:52 +01:00
Stephane Nicoll
c4d8fb1c09 Merge branch '1.4.x' into 1.5.x 2016-10-30 10:59:02 +01:00
Stephane Nicoll
6d50e26b70 Polish contribution
Closes gh-7215
2016-10-30 10:57:58 +01:00
Madhura Bhave
9bde1e89cb Move some tests to AbstractEndpointHandlerMapping
See gh-7108
2016-10-24 10:38:53 -07:00
Phillip Webb
a448183681 Polish /loggers actuator endpoint
See gh-7086
2016-10-24 10:24:36 -07:00
Ben Hale
06cb4fcca5 Add /loggers actuator endpoint
Add `LoggersEndpoint` that can enables listing and configuration of log
levels. This actuator builds on top of the `LoggingSystem` abstraction
and implements support for Logback, Log4J2, and JUL.  The LoggingSystem
interface is modified to require each implementation to list the
configuration of all loggers as well as an individual logger by name.

The MVC endpoint exposes these behaviors at `GET /loggers` and
`GET /loggers/{name}` (much like the metrics actuator).

In addition `POST /loggers/{name}` allows users to modify the level for a given
logger. This modification is passed to the logging implementation, which
then decides, as an internal implementation detail, what the final outcome
of the modification is (e.g. changing all unconfigured children). Users
are then expected to request the listing of all loggers to see what has
changed internally to the logging system.

Closes gh-7086
2016-10-24 10:24:36 -07:00
Stephane Nicoll
aec85787d2 Merge branch '1.4.x' into 1.5.x 2016-10-24 10:08:06 +02:00
Johnny Lim
eb7c0e4dc8 Remove unused
Closes gh-6966
2016-10-24 10:07:10 +02:00
Phillip Webb
2ba978b4ad Polish 2016-10-21 10:23:13 -07:00
Madhura Bhave
ab81d993e6 Add CloudFoundryDiscoveryMvcEndpoint
Update Cloud Foundry support with a discovery endpoint that shows what
endpoints are available.

See gh-7108
2016-10-21 10:16:09 -07:00
Madhura Bhave
7afb161fcf Add CloudFoundry EndpointHandlerMapping
Add a CloudFoundryEndpointHandlerMapping that can expose actuator
endpoints for Cloud Foundry "appsmanager" to use.

See gh-7108
2016-10-21 10:06:34 -07:00
Andy Wilkinson
a416f496c0 Clean up deprecation and unused code warnings 2016-10-18 20:43:05 +01:00
Madhura Bhave
7352d8e303 Improve EndpointHandlerMapping subclassing support
Update EndpointHandlerMapping so that it can be subclasses easily.
Subclasses can override the `path` that is used to map the endpoint,
allowing different mapping strategies to be used.

See gh-7108
2016-10-12 13:32:39 -07:00
Madhura Bhave
0be8a30276 Add EndpointHandlerMapping.getEndpoints(Class)
Add an additional method to EndpointHandlerMapping which allows
endpoints of a specific type to be returned.

See gh-7108
2016-10-12 13:32:38 -07:00
Madhura Bhave
7f1ff968a1 Support NamedMvcEndpoints
Introduce a new NamedMvcEndpoint interface which can be used when an
MvcEndpoint also has a logical name. Existing MvcEndpoints have been
reworked to implement the NamedMvcEndpoint interface.

Fixes gh-7156
2016-10-12 13:32:38 -07:00
Madhura Bhave
0f5007d69d Drop superfluous disabled check
Remove EndpointWebMvcManagementContextConfiguration `disabled` logic
since the configuration should even be processed when the management
port is `-1`.

Closes gh-7154
2016-10-12 12:19:35 -07:00
Madhura Bhave
84d0e8acd8 Fix EndpointHandlerMappingTests path references
Fix the TestEndpoint constructor to use an ID parameter rather than
path.
2016-10-12 12:19:35 -07:00
Phillip Webb
d818a09ed8 Polish 2016-10-11 23:38:14 -07:00
Stephane Nicoll
cfee9bab81 Deprecate remote shell support
Closes gh-7044
2016-10-11 17:39:28 +02:00
Andy Wilkinson
9b6fa1e8d7 Separate conditions that did and did not match in auto-config endpoint
Closes gh-7122
2016-10-06 17:15:38 +01:00
Stephane Nicoll
cf28663cd7 Deprecate commons-dbcp 1
Closes gh-6787
2016-10-05 15:21:09 +02:00
Phillip Webb
f2b0fa284e Merge branch '1.4.x' into 1.5.x 2016-10-03 22:38:22 -07:00
Phillip Webb
3326841a97 Formatting 2016-10-03 22:19:35 -07:00
Phillip Webb
39ed0d4dfb Polish 2016-10-03 21:58:13 -07:00
Stephane Nicoll
3d9c56fbf3 Merge branch '1.4.x' into 1.5.x
# Conflicts:
#	spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java
#	spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java
2016-10-03 10:42:07 +02:00
Stephane Nicoll
8c1b736bb0 Fix list property to be mutable
Closes gh-7068
2016-10-03 10:40:46 +02:00
Vedran Pavic
c4aa78679a Upgrade Hazelcast to 3.7.1
In addition, dependency management for `hazelcast-hibernate5` module has
been added, and a separate dependency version was introduced for
`hazelcast-hibernate4` module.

Closes gh-7023
2016-09-29 10:37:29 +02:00
Andy Wilkinson
c108da9d53 Upgrade to Spring Data Ingalls M1
Closes gh-6785
Closes gh-5835
2016-09-21 17:01:47 +01:00
Stephane Nicoll
bd7c20eb1c Deprecate Guava support 2016-09-21 14:59:02 +02:00
Stephane Nicoll
ce1e41dce3 Remove deprecated code
This code removes code deprecated in 1.4 with the exception of code that
requires an update to Spring Framework 5.

Closes gh-6971
2016-09-21 14:30:28 +02:00
Stephane Nicoll
6bd670edbc Initiate 1.4.x branch 2016-09-21 11:11:24 +02:00
Spring Buildmaster
7e9ed5e1a7 Next Development Version 2016-09-21 07:58:07 +00:00
Spring Buildmaster
5f959b074f Next Development Version 2016-09-20 20:20:06 +00:00
Andy Wilkinson
155cfb1805 Fix boot curies href when server has custom servlet path
Previously, the servlet path was being applied twice. Once by the
code that sets up the DefaultCurieProvider and once by the provider
itself which uses ServletUriComponentBuilder's
fromCurrentServletMapping() to build the application URI.

This commit removes the duplicate logic when creating the
DefaultCurieProvider.

Closes gh-6585
2016-09-19 12:40:38 +01:00
Phillip Webb
825dd0a26c Merge branch '1.3.x' 2016-09-16 15:07:18 -07:00
Phillip Webb
3172d434a7 Polish
Closes gh-6835
2016-09-16 13:31:54 -07:00
Phillip Webb
c56f30fd91 Formatting 2016-09-12 12:44:31 -07:00
Stephane Nicoll
c662986628 Merge branch '1.3.x' 2016-09-12 16:30:25 +02:00
Stephane Nicoll
6eb0449aa9 Use BDD mockito
See gh-6869
2016-09-12 16:30:07 +02:00
Stephane Nicoll
d87d60f746 Merge branch '1.3.x' 2016-09-12 16:02:28 +02:00
Stephane Nicoll
b88cb35ea2 Fix JMS health indicator
This commit improves the JMS health indicator to identify a broken broker
that uses failover. An attempt to start the connection is a good way to
make sure that it is effectively available.

Closes gh-6818
2016-09-12 15:59:18 +02:00
Phillip Webb
3570f7730a Prevent erroneous "empty locations" log warnings
Update our `ResourceHttpRequestHandler` subclass so that the following
warning is no longer displayed:

  "Locations list is empty. No resources will be served unless a
  custom ResourceResolver is configured as an alternative to
  PathResourceResolver."

Fixes gh-6791
2016-09-09 13:19:58 -07:00
Vedran Pavic
d87bec11fb Include AuditEvent details in AuditListener
Update `AuthorizationAuditListener` to include `AuditEvent` data if
found.

Closes gh-6851
2016-09-09 12:48:30 -07:00
Phillip Webb
7396ccfe04 Harmonize ConditionOutcome messages
Add ConditionMessage class to help build condition messages in a
uniform format and update existing conditions to use it.

Fixes gh-6756
2016-09-07 10:50:39 -07:00
Phillip Webb
41dc53f5dd Polish 2016-09-07 08:34:45 -07:00
Johnny Lim
4b9f6869f0 Polish
Closes gh-6817
2016-09-05 09:08:08 +02:00
Stephane Nicoll
b7da0bd301 Merge branch '1.3.x' 2016-09-05 09:00:52 +02:00
Vedran Pavic
b88889f020 Polish HealthEndpoint javadoc
Closes gh-6815
2016-09-05 09:00:08 +02:00
Andy Wilkinson
3814e509a3 Polish @deprecated javadoc and link to replacements where available
Closes gh-6765
2016-08-31 14:34:49 +01:00
Andy Wilkinson
9874c22e23 Fix HAL browser endpoint redirect and entry point with custom servlet path
Previously, the HAL browser endpoint did not consider the dispatcher
servlet’s path (server.servlet-path) when redirecting to browser.html
or when updating the API entry point in the served HTML.

This commit moves to using ServletUriComponentsBuilder to build the URI
for the redirect and the path for the entry point. In the interests of
simplicity the logic that sometimes redirected and sometimes forwarded
the request has been changed so that it will always perform a redirect.

Closes gh-6586
2016-08-31 11:22:45 +01:00
Phillip Webb
565ad79856 Polish 2016-08-29 20:26:30 +01:00
Johnny Lim
524edaea51 Polish
Closes gh-6728
2016-08-23 15:13:33 +02:00
Andy Wilkinson
98d81110f2 Write management and main server access logs to separate files
Previously, when access logging was enabled and the management server
was running on a separate port, both the main server and the management
server would write their access logs to the same file. Having two
separate containers writing to the same file could cause problems such
as causing log rotation to break.

This commit updates the actuator so that when the management server is
running on a separate port (and therefore using a separate container)
it prepends management_ to the access log prefix so that the main
server and the management server write their access logs to separate
files in the same directory.

Closes gh-6618
2016-08-22 11:57:51 +01:00
Andy Wilkinson
13a9bc0537 Polish “Allow injection of StatsDClient into StatsdMetricWriter”
Closes gh-6588
2016-08-16 13:25:16 +01:00
Nick Pillitteri
63085fb441 Allow injection of StatsDClient into StatsdMetricWriter
Allow an instance of StatsDClient to be injected into the StatsdMetricWriter
which is used for exporting metrics to a Statsd server. This new constructor
allows the client to be injected but does not change the default behavior of
the writer.
2016-08-16 13:23:25 +01:00
Andy Wilkinson
df4ef3e1cb Merge branch '1.3.x' 2016-08-15 13:47:32 +01:00
Andy Wilkinson
ffc0dc44ed Make Flyway and Liquibase endpoints conditional on a single candidate
Previously, auto-configuration of the Flyway and Liquibase endpoints
would fail if there were multiple Flyway or Spring Liquibase beans
in the application context.

This commit updates them so that they are now conditional on a single
candidate.

Closes gh-6609
2016-08-15 13:43:03 +01:00
Stephane Nicoll
4882544c84 Polish contribution
Closes gh-6540
2016-08-13 08:02:04 +02:00
Eddú Meléndez
dced154f71 Fix health endpoint security
Commit b02aba4 has renamed `management.security.role` to
`management.security.roles`. Unfortunately, the `HealthMvcEndpoint`
was still looking at the old property.

This commit makes sure that the proper key is used and any custom
role is applied rather than an unconditional `ADMIN` role.

See gh-6540
2016-08-13 07:26:41 +02:00
Phillip Webb
a49f309ec1 Call afterProperties set in LogFileMvcEndpoint
Call afterPropertiesSet on the delegate `ResourceHttpRequestHandler`
to prevent an NPE. This change is required for compatibility with
Spring Framework 4.3 following SPR-13834.

Closes gh-6592
2016-08-11 16:11:29 +01:00
Andy Wilkinson
22ac6bcb2d Break GaugeWriter dependency cycle in MetricExportAutoConfiguration
Previously, MetricExportAutoConfiguration consumed
ExportMetricWriter-annotated GaugeWriter beans in its constructor and
also produced such a bean from one of its @Bean methods. This cycle
caused a BeanCurrentlyInCreationException to be thrown when the
bean method was active (the spring.metrics.export.statsd.host property
was set).

This commit break the cycle by moving the bean method into a separate,
nested configuration class. It also updates the existing test for
auto-configuration of a Statsd writer to catch any possible cycles
and to verify that the writer has be registered with the
MetricsExporter.

Closes gh-6544
2016-08-10 14:54:42 +01:00
Andy Wilkinson
19cddd650d Merge branch '1.3.x' 2016-08-08 17:25:15 +01:00
Andy Wilkinson
cec6015f8a Cope with null server or management port when creating curie provider
Previously, a NullPointerException would occur if
endpoints.docs.curies.enabled was true and the default value was being
used for either server.port or management.port.

EndpointWebMvcHypermediaManagementContextConfiguration has been
restructured to ensure that the DocsMvcEndpoint bean is defined before
the condition on its existence is evaluated. Previously this was
dependant on the class’s bean methods being processed in a particular
ordering, something that would be ok when using ASM but would vary when
using reflection.

Closes gh-6584
2016-08-08 17:16:00 +01:00
Spring Buildmaster
334baaeffd Next development version 2016-07-28 19:54:01 +00:00
Spring Buildmaster
a89ef5df6e Next Development Version 2016-07-28 09:18:40 +00:00
Phillip Webb
ac1ad2a145 Polish 2016-07-27 16:27:11 -07:00
Johnny Lim
9627d0ed66 Polish
Closes gh-6487
2016-07-27 12:29:33 +01:00
Chad
18dd125059 Unescape quotation marks in JavaDoc
Closes gh-6482
2016-07-26 21:42:22 -07:00
Phillip Webb
496b3a8d75 Relocate FileWriters to spring-boot
Move ApplicationPidFileWriter and EmbeddedServerPortFileWriter to the
core spring-boot project since they're not really tied to the actuator.

Fixes gh-6398
2016-07-25 13:45:29 -07:00
Johnny Lim
68fe8a58b8 Align message with regex for AbstractMvcEndpoint.path
Closes gh-6437
2016-07-21 17:04:32 +01:00
Andy Wilkinson
fe22609096 Test that temp file has been deleted before triggering heap dump
The MBean requires that a file does not exist at the location to which
it’s dumping the heap. This commit updates the test to ensure that the
temporary file that’s created to get a location for the heap dump file
is deleted before asking the MBean to dump the heap to that location.
2016-07-21 13:51:51 +01:00
Phillip Webb
05cde789e1 Reduce noise in /end actuator docs
Update the `/env` sample used in the actuator docs to use only a limited
set of keys.

Fixes gh-5849
2016-07-19 09:41:12 -07:00
Phillip Webb
05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
2016-07-18 17:52:35 -07:00
Phillip Webb
e03e109874 Polish 2016-07-18 11:27:55 -07:00
Stephane Nicoll
7e6f4021de Polish contribution
Closes gh-6059
2016-07-18 08:54:27 +02:00
RichardCSantana
42bb843364 Fix Bug HealthIndicator for Redis Cluster
See gh-6059
2016-07-18 08:48:01 +02:00
Andy Wilkinson
91df749839 Improve usage of ConcurrentMap
- Call get rather than containsKey then get
- Only call putIfAbsent after get has returned null to avoid unnecessary
  object creation

Closes gh-6382
2016-07-13 09:26:28 +01:00
Adrian Cole
38e3b39d3b Improves metrics performance by not guarding map.get
ConcurrentHashMap implements `containsKey` with `get`. By removing a
redundant call to `containsKey`, we guarantee better performance in our
counter services.

The geek inside measured this with JMH, and found under 4 threads of
contention, throughput on this check was 40% higher in success case.

Benchmark                                  Mode  Cnt     Score     Error   Units
TestBenchmarks.containsKeyAndGet_success  thrpt   30   432.389 ±  20.616  ops/us
TestBenchmarks.get_success                thrpt   30   606.789 ±  10.848  ops/us

Closes gh-6379
2016-07-13 08:56:13 +01:00
Johnny Lim
a9f6ae4422 Polish
Closes gh-6374
2016-07-12 08:46:58 +02:00
Andy Wilkinson
8e669e2eef Merge branch '1.3.x 2016-07-11 17:03:16 +01:00
Andy Wilkinson
4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
2016-07-11 16:46:05 +01:00
Andy Wilkinson
e53d3167ab Set TCCL of shutdown thread when triggered by the shutdown endpoint
Previously, the shutdown endpoint would spawn a new thread to perform
the shutdown but did not explicitly configure its thread context
class loader (TCCL). This mean that the new thread would use the
request thread's TCCL as its TCCL. This meant that a different TCCL
would be used compared to a shutdown triggered by the shutdown hook
and also caused problems with Tomcat's thread leak detection logic.

This commit updates the shutdown endpoint to explicitly configure the
TCCL of the shutdown thread to be the ClassLoader that loaded the
endpoint's class.

Closes gh-6361
2016-07-11 11:27:41 +01:00
Andy Wilkinson
c974de0119 Merge branch '1.3.x 2016-07-11 11:27:15 +01:00
Andy Wilkinson
5f751fe356 Set TCCL of shutdown thread when triggered by the shutdown endpoint
Previously, the shutdown endpoint would spawn a new thread to perform
the shutdown but did not explicitly configure its thread context
class loader (TCCL). This mean that the new thread would use the
request thread's TCCL as its TCCL. This meant that a different TCCL
would be used compared to a shutdown triggered by the shutdown hook
and also caused problems with Tomcat's thread leak detection logic.

This commit updates the shutdown endpoint to explicitly configure the
TCCL of the shutdown thread to be the ClassLoader that loaded the
endpoint's class.

Closes gh-6361
2016-07-11 11:16:34 +01:00
Phillip Webb
bd65045285 Allow WebRequestTraceFilter header post processing
Update WebRequestTraceFilter so that additional post processing can be
applied to traced request headers. The postProcessRequestHeaders method
can be used to remove or change map entries before they are returned.

Fixes gh-6309
2016-07-06 17:45:35 -07:00
Andy Wilkinson
5bfc6a50fd Remove accidental usage of Type.getTypeName() which is a Java 8 API
Closes gh-6325
2016-07-05 15:21:50 +01:00
Spring Buildmaster
2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Lari Hotari
9f07e94450 Add MVC actuator endpoint for heap dumps
Add MVC only endpoint to obtain GZip compressed heap dump files.

See gh-5670
2016-07-02 11:14:42 -07:00
Lari Hotari
e1893f66ce Extract AbstractMvcEndpoint class
Extract common functionality from Spring MVC only endpoints.

See gh-5670
2016-07-02 11:13:21 -07:00
Phillip Webb
b732aeb453 Polish 2016-07-02 10:52:59 -07:00
Andy Wilkinson
5c6537c234 Consistently synchronize on this.monitor in InMemoryAuditEventRepository
See gh-6261
2016-07-01 14:09:07 +01:00
Andy Wilkinson
92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
2016-07-01 10:44:23 +01:00
Phillip Webb
516df88ea0 Revisit AuditEventRepository interface
Update AuditEventRepository to restore support for `null` arguments and
explicitly Javadoc their meaning.

See gh-5854
2016-06-30 17:27:55 -07:00
Stephane Nicoll
3ba2b24301 Polish "Improve AuditEventRepository"
Closes gh-5854
2016-06-30 11:44:01 +02:00
Vedran Pavic
5f19323fbd Improve AuditEventRepository
See gh-5854
2016-06-30 11:20:23 +02:00
Phillip Webb
266445aaf0 Polish 2016-06-29 10:44:33 -07:00
Johnny Lim
5bc9d5b380 Polish
Closes gh-6244
2016-06-29 08:08:53 +02:00
Stephane Nicoll
84b2ff5c38 Polish "Add ability to filter cookies in trace data"
Closes gh-6018
2016-06-27 16:41:10 +02:00
Venil Noronha
fde5e1b6a5 Add ability to filter cookies in trace data
See gh-6018
2016-06-27 15:43:47 +02:00
Andy Wilkinson
618535f576 Polish “Allow management server SSL to be configured independently”
This commit polishes b0fbc7e, throwing an exception when an attempt is
made to configure management-specific SSL without also configuring a
custom management port. The testing of management-specific SSL
configuration has also been improved.

See gh-6057
Closes gh-4810
2016-06-27 13:24:42 +01:00
Alex Antonov
3546ae399e Allow management server SSL to be configured independently
Closes gh-6057
2016-06-27 13:24:42 +01:00
Phillip Webb
15670b8e28 Relocate Neo4J auto-configuration
Move Neo4J auto-configuration from `autoconfigure.neo4j` to
`autoconfigure.data.neo4j` since it's intrinsically linked to Spring
Data.

See gh-5458
See gh-6142
2016-06-24 12:49:11 -07:00
Stephane Nicoll
fda2505be6 Fix checkstyle violations 2016-06-23 11:14:28 +02:00
Stephane Nicoll
2dc6e5b6fa Refactor Jest auto-configuration package space
This commit moves the Jest auto-configuration from `spring.jest` to
`spring.elasticsearch.jest`

Closes gh-6032
2016-06-23 10:39:16 +02:00
Andy Wilkinson
e5827f4840 Merge branch '1.3.x' 2016-06-21 15:09:56 +01:00
Andy Wilkinson
6c8f8c9d82 Better diagnotics when ESCF subclass breaks with custom management port
When a custom management.port is used, the child context is configured
with an EmbeddedServletContainerFactory bean that has the same class
as the parent context’s EmbeddedServletContainerFactory bean. This
ensures that the child context uses the same type of embedded container
as its parent when there are multiple embedded containers on the
classpath. It also causes a failure when the custom
EmbeddedServletContainerFactory subclass cannot be instantiated, for
example because it’s an anonymous inner-class.

This commit improves the diagnostics so that we fail fast with an
information exception message when we detect that the embedded servlet
container factory bean’s class cannot be instantiated.

Closes gh-6193
2016-06-21 15:05:00 +01:00
Phillip Webb
7446235ff4 Polish 2016-06-20 20:13:13 -07:00
Phillip Webb
c136054e69 Merge branch '1.3.x' 2016-06-20 18:54:01 -07:00
Phillip Webb
5b97981c87 Polish 2016-06-20 18:13:43 -07:00
Andy Wilkinson
f28e3d54c5 Upgrade to Tomcat 8.5.3
This commit changes the default version of Tomcat to 8.5.3 while
also retaining support for Tomcat 8.0 and 7.0. The main difference
in 8.5 is that the ServerSocketFactory abstraction that allowed the
TrustStore and KeyStore to be configured programatically no longer
exists. This logic has been replaced with the use of a custom URL
protocol (springbootssl) that provides access to the key store and
trust store of an SslStoreProvider. In addition to working with 8.5,
this approach has the advantage of also working with 8.0 and 7.0.

Closes gh-6164
2016-06-20 13:27:47 +01:00
Stephane Nicoll
06b81cf16f Use @AliasFor when applicable
This commit adds `@AliasFor` meta-data to annotations that declare an
alias attribute.

`@ConditionalOnProperty` and `@AutoconfigureRestDocs` were not migrated
due to the use of `AnnotationMetadata#getAnnotationAttributes`.

Closes gh-5187
2016-06-20 14:20:16 +02:00
Andy Wilkinson
971913e672 Polish 2016-06-17 21:01:29 +01:00
Stephane Nicoll
3799496dc8 Merge branch '1.3.x' 2016-06-17 17:50:47 +02:00
Stephane Nicoll
9abca48a7f Fix HAL browser entry point with contextPath
Previously, if the `contextPath` of the application wasn't the root, the
HAL browser could not initialize since the `entryPoint` was referring to
an invalid location.

This commit makes sure to take the `contextPath` into account.

Closes gh-5814
2016-06-17 17:49:49 +02:00
Andy Wilkinson
fa0a137cd2 Merge branch '1.3.x' 2016-06-17 13:16:34 +01:00
Andy Wilkinson
a2446080bc Prevent GC pressure from causing an NPE in SimpleInMemoryRepository
Previously, SimpleInMemoryRepository used a ConcurrentReferenceHashMap
to store its locks. The type of map will discard its entries when the
JVM comes under GC pressure. With the code in its previous form, this
could lead to a NullPointerException when the following occurred:

1. putIfAbsent returned null indicating that a new entry has been added
   to the map
2. GC pressure caused the map to discard the new entry
3. get returned null as the entry has been discard

There are two problems with the existing code:

1. Its usage of a ConcurrentMap is incorrect. The correct usage is:
   a. Call get to see if the map already contains a lock
   b. If the lock is null, create a new one
   c. Call putIfAbsent to add the new lock
   d. If the return value is non-null, another thread has created the
      lock and it should be used. If the return value is null, use the
      new lock created in b.
2. Once the use of ConcurrentMap has been corrected, the fact that it is
   a ConcurrentReferenceHashMap means that different threads could
   access the same value using different locks. This would occur if one
   thread has retrieved a lock from the map and is using it, while GC
   causes the lock to be removed from the map. Another thread then
   attempts to get the lock and, as GC pressure has remove it, a new
   lock is created allowing concurrent access to the same value.

This commit updates the code to use the ConcurrentMap correctly and also
replaces the ConcurrentReferenceHashMap with a ConcurrentHashMap. This
means that the repository will now use slightly more memory but this is
outweighed by the benefits of thread-safe updates and no risk of an NPE.

Closes gh-6115
2016-06-17 13:13:49 +01:00
Stephane Nicoll
64bbefd3ac Add Jest-based health indicator
This commit adds a Jest-based health indicator for ElasticSearch. If both
Jest and the Spring Data are available, the latter takes precedence as it
provides more information.

Closes gh-3178
2016-06-13 17:19:04 +02:00
Phillip Webb
ee319a6d8b Merge branch '1.3.x' 2016-06-10 21:11:00 -07:00
Johannes Edmeier
e89063cc07 Close connection after use in LiquibaseEndpoint
Update LiquibaseEndpoint so that connections are closed and returned to
the pool after use.

Fixes gh-6118
2016-06-10 21:03:15 -07:00
Phillip Webb
99c6194e17 Don't use MockitoJUnitRunner
Replace `@RunWith(MockitoJUnitRunner.class)` with direct Mockito
initialization since the running doesn't support parallel test
execution.
2016-06-09 20:55:59 -07:00
Johnny Lim
8704e4869d Polish
Closes gh-6066
2016-06-07 08:40:47 -04:00
Phillip Webb
14c7a1284e Formatting 2016-05-25 14:30:13 -07:00
Stephane Nicoll
b02aba4c75 Polish contribution
Closes gh-5074
2016-05-23 17:38:45 +02:00
Vedran Pavic
20fa1b3b48 Support configuration of multiple management roles
Closes gh-5045
2016-05-23 17:15:44 +02:00
Stephane Nicoll
6698af08df Replace Starter POM to Starter in the documentation
"Starter POM" is a confusing term as it implies the starter may be a
POM while it's actually a jar artifact like any other dependency. To
reduce the confusion (especially in the way such starter should be
declared in the build), the term Starter POM has been renamed to Starter.

Closes gh-5966
2016-05-18 08:55:42 +02:00
Phillip Webb
68983400fb Propogate startup failures to management context
Update EndpointWebMvcAutoConfiguration so that ApplicationFailedEvents
cause the management context to close.

Prior to this commit if an application failed to start (for example
because `server.port` was already in use) the management context would
remain open and the application would not exit.

Fixes gh-5388
2016-05-16 17:26:03 -07:00