Commit Graph

1404 Commits (1d589fc55a06a47b06d50ba2f993f2d21e9de168)

Author SHA1 Message Date
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
8 years ago
Andy Wilkinson 2608b331dd Merge branch '1.5.x' 8 years ago
Andy Wilkinson 9c20ada927 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 356edc725c Handle request mappings with regular expressions in MetricsFilter
Closes gh-7503
8 years ago
Andy Wilkinson 4870349438 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 2be554456e Introduce SearchStrategy.ANCESTORS as a replacement for .PARENTS
Closes gh-6763
8 years ago
Andy Wilkinson e0d9352e80 Merge branch '1.5.x' 8 years ago
Andy Wilkinson dce1487424 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson e19c6245ef Consider endpoints.sensitive when endpoints.health.sensitive is not set
Closes gh-7476
8 years ago
Andy Wilkinson 95a763d528 Merge branch '1.5.x' 8 years ago
Andy Wilkinson f5dd90815b Polishing: fix some compiler warnings 8 years ago
Phillip Webb 20d7dd5747 Merge branch '1.5.x' 8 years ago
Phillip Webb 1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
8 years ago
Phillip Webb c2c5611f77 Polish 8 years ago
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
8 years ago
Andy Wilkinson 9273b1789b Merge branch '1.5.x' 8 years ago
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
8 years ago
Andy Wilkinson 93612116c5 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 5527e3fdad Fix SpringApplicationHierarchyTests following latest Neo4j changes
See gh-7391
8 years ago
Phillip Webb cb7c0b5031 Merge branch '1.5.x' 8 years ago
Johnny Lim 8038882d46 Polish
Closes gh-7403
8 years ago
Andy Wilkinson 4edab86ba2 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 387a406aad Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb d8b7d6dfdc Merge branch '1.5.x' 8 years ago
Phillip Webb 449b42ffa0 Polish LinksEnhancer to use endpoint name
See gh-7164
See gh-7132
8 years ago
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
8 years ago
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
8 years ago
Phillip Webb 764f13453a Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb bacf0878af Polish 8 years ago
Andy Wilkinson 86c55dda16 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 24cc5d5644 Give javac's type inferencing a helping hand 8 years ago
Andy Wilkinson e26a3e3766 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 22e456a177 Merge branch '1.4.x' into 1.5.x 8 years ago
Madhura Bhave ed75ed3d93 Merge branch '1.5.x' 8 years ago
Madhura Bhave 2697bf2ba1 Add Content-Type to allowed headers for CloudFoundry actuators
See gh-7108
8 years ago
Madhura Bhave e1a216e34a Merge branch '1.5.x' 8 years ago
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
8 years ago
Madhura Bhave a3bcb2778f Add message to response body for Cloud Foundry security error
See gh-7108
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Andy Wilkinson f3c2f55cbe Merge branch '1.5.x' 8 years ago
Andy Wilkinson 2e76687d17 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 5f44598d8b Remove use of static import that Checkstyle prohibits 8 years ago
Andy Wilkinson 04a869bbe7 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 218d28f74c Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Madhura Bhave 372cfb3dff Merge branch '1.5.x' 8 years ago
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
8 years ago
Stephane Nicoll d32da0d692 Merge branch '1.5.x' 8 years ago
Stephane Nicoll 01e66ecbd5 Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll 2c71cb8efd Polish 8 years ago
Stephane Nicoll 4407194c00 Replace sample by integration test
Closes gh-3888
8 years ago
Stephane Nicoll 71bbd9faaf Polish
See gh-7322
8 years ago
Phillip Webb 3435fdf7fd Merge branch '1.5.x' 8 years ago
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
8 years ago
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
8 years ago
Madhura Bhave 862a06eb7a Add POST to allowed CORS methods for CF actuators
Update CORS configuration to support POST.

See gh-7108
8 years ago
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
8 years ago
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
8 years ago
Phillip Webb 0cdde3b83c Merge branch '1.5.x' 8 years ago
Phillip Webb 81c5753f4d Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Andy Wilkinson f7618cb421 Merge branch '1.5.x' 8 years ago
Andy Wilkinson bdfceae24c Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Andy Wilkinson 8026b2e7a0 Merge branch '1.5.x'
See gh-6982
8 years ago
Andy Wilkinson fe50b2019e Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson b191974faa Reflect Java 7/8 differences in javadoc for metric repository auto-config
Closes gh-6985
8 years ago
Phillip Webb 98a3ae9ac4 Merge branch '1.5.x' 8 years ago
Phillip Webb 5b66ffbb4b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 60355e0e11 Fix ResourceHttpRequestHandler delegate
Fix ResourceHttpRequestHandler to set the ServletContext following the
Spring Framework update for SPR-14851.
8 years ago
Stephane Nicoll 236f03c4bb Merge branch '1.5.x' 8 years ago
Johnny Lim 7bb63238ab Fix typo
Closes gh-7253
8 years ago
Stephane Nicoll 99af8ca414 Merge branch '1.5.x' 8 years ago
Stephane Nicoll c4d8fb1c09 Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll 6d50e26b70 Polish contribution
Closes gh-7215
8 years ago
Madhura Bhave 08229899b1 Merge branch '1.5.x' 8 years ago
Madhura Bhave 9bde1e89cb Move some tests to AbstractEndpointHandlerMapping
See gh-7108
8 years ago
Phillip Webb 2e4edf1804 Merge branch '1.5.x' 8 years ago
Phillip Webb a448183681 Polish `/loggers` actuator endpoint
See gh-7086
8 years ago
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
8 years ago
Stephane Nicoll 0541c14684 Merge branch '1.5.x' 8 years ago
Stephane Nicoll aec85787d2 Merge branch '1.4.x' into 1.5.x 8 years ago
Johnny Lim eb7c0e4dc8 Remove unused
Closes gh-6966
8 years ago
Phillip Webb df3c152813 Merge '1.5.x' 8 years ago
Phillip Webb 2ba978b4ad Polish 8 years ago
Phillip Webb 1e1d929dde Merge branch '1.5.x' 8 years ago
Madhura Bhave ab81d993e6 Add CloudFoundryDiscoveryMvcEndpoint
Update Cloud Foundry support with a discovery endpoint that shows what
endpoints are available.

See gh-7108
8 years ago
Madhura Bhave 7afb161fcf Add CloudFoundry EndpointHandlerMapping
Add a CloudFoundryEndpointHandlerMapping that can expose actuator
endpoints for Cloud Foundry "appsmanager" to use.

See gh-7108
8 years ago
Andy Wilkinson a416f496c0 Clean up deprecation and unused code warnings 8 years ago
Phillip Webb 277d01ab53 Merge branch '1.5.x' 8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
Madhura Bhave 84d0e8acd8 Fix EndpointHandlerMappingTests path references
Fix the TestEndpoint constructor to use an ID parameter rather than
path.
8 years ago
Phillip Webb 01900c8342 Merge branch '1.5.x' 8 years ago
Phillip Webb d818a09ed8 Polish 8 years ago
Stephane Nicoll c5cc626d48 Remove remote shell support
See gh-7044
8 years ago
Stephane Nicoll 66a3df454f Merge branch '1.5.x' 8 years ago
Stephane Nicoll cfee9bab81 Deprecate remote shell support
Closes gh-7044
8 years ago
Andy Wilkinson cf038da083 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 9b6fa1e8d7 Separate conditions that did and did not match in auto-config endpoint
Closes gh-7122
8 years ago
Stephane Nicoll 543498f040 Merge branch '1.5.x' 8 years ago
Stephane Nicoll cf28663cd7 Deprecate commons-dbcp 1
Closes gh-6787
8 years ago
Phillip Webb 53f50eda39 Merge branch '1.5.x' 8 years ago
Phillip Webb f2b0fa284e Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 3326841a97 Formatting 8 years ago
Phillip Webb 39ed0d4dfb Polish 8 years ago
Stephane Nicoll 669b09cbde Merge branch '1.5.x' 8 years ago
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
8 years ago
Stephane Nicoll 8c1b736bb0 Fix list property to be mutable
Closes gh-7068
8 years ago
Andy Wilkinson f82dc8e043 Upgrade to JMS API 2.0
Closes gh-7049
8 years ago
Stephane Nicoll 8b6d7eedc0 Merge branch '1.5.x' 8 years ago
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
8 years ago
Andy Wilkinson bd8a9bb310 Polish
See gh-6971 and commit ce1e41d
8 years ago
Andy Wilkinson beca5e486e Polish 8 years ago
Andy Wilkinson 312292b93e Update Animal Sniffer and related annotations for Java 8 baseline
Closes gh-6981
8 years ago
Andy Wilkinson 16a0f72df5 Merge branch '1.5.x' 8 years ago
Andy Wilkinson c108da9d53 Upgrade to Spring Data Ingalls M1
Closes gh-6785
Closes gh-5835
8 years ago
Stephane Nicoll 9bc77254a7 Start building against Spring Framework 5 snapshot
This commit enables compatibility build against Spring Framework 5.

The Velocity and Guava support that are deprecated in the 1.x line have
been removed and few other classes contain minor change to comply to non
backward compatible changes in Spring Framework 5.

This commit also switches the required java version to 8.

Closes gh-6977
8 years ago
Stephane Nicoll 6643ec3713 Next development version 8 years ago
Stephane Nicoll bd7c20eb1c Deprecate Guava support 8 years ago
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
8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
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
8 years ago
Phillip Webb 825dd0a26c Merge branch '1.3.x' 8 years ago
Phillip Webb 3172d434a7 Polish
Closes gh-6835
8 years ago
Phillip Webb c56f30fd91 Formatting 8 years ago
Stephane Nicoll c662986628 Merge branch '1.3.x' 8 years ago
Stephane Nicoll 6eb0449aa9 Use BDD mockito
See gh-6869
8 years ago
Stephane Nicoll d87d60f746 Merge branch '1.3.x' 8 years ago
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
8 years ago
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
8 years ago
Vedran Pavic d87bec11fb Include AuditEvent details in AuditListener
Update `AuthorizationAuditListener` to include `AuditEvent` data if
found.

Closes gh-6851
8 years ago
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
8 years ago
Phillip Webb 41dc53f5dd Polish 8 years ago
Johnny Lim 4b9f6869f0 Polish
Closes gh-6817
8 years ago
Stephane Nicoll b7da0bd301 Merge branch '1.3.x' 8 years ago
Vedran Pavic b88889f020 Polish `HealthEndpoint` javadoc
Closes gh-6815
8 years ago
Andy Wilkinson 3814e509a3 Polish @deprecated javadoc and link to replacements where available
Closes gh-6765
8 years ago
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
8 years ago
Phillip Webb 565ad79856 Polish 8 years ago
Johnny Lim 524edaea51 Polish
Closes gh-6728
8 years ago
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
8 years ago
Andy Wilkinson 13a9bc0537 Polish “Allow injection of StatsDClient into StatsdMetricWriter”
Closes gh-6588
8 years ago
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.
8 years ago
Andy Wilkinson df4ef3e1cb Merge branch '1.3.x' 8 years ago
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
8 years ago
Stephane Nicoll 4882544c84 Polish contribution
Closes gh-6540
8 years ago