Commit Graph

1792 Commits

Author SHA1 Message Date
Stephane Nicoll 40e6f004da Enable info and status endpoints by default
Closes gh-10161
2017-09-12 12:51:26 +02:00
Stephane Nicoll 222ed44bd4 Replace enabledByDefault to DefaultEnablement
This commit introduces a DefaultEnablement enum that replaces the
"enabledByDefault" boolean flag of Endpoint. This allows to better
control what indicates the default enablement of an endpoint.

With DefaultEnablement#ENABLED, the endpoint is enabled unless an
endpoint specific property says otherwise. With DefaultEnabled#DISABLED,
the endpoint is disabled unless an endpoint specific property says
otherwise. DefaultEnablement#NEUTRAL provides a dedicated option to
indicate that we should resort to the default settings in absence of
a specific property.

See gh-10161
2017-09-12 12:23:04 +02:00
Andy Wilkinson 3882552b43 Polish 2017-09-12 10:22:35 +01:00
Phillip Webb 2e51b48cd9 Refactor actuator package locations
Restructure actuator packages to improve structure. The following
changes have been made:

 - Separate actuator and actuator auto-configuration into different
   modules.
 - Move endpoint code into `spring-boot-actuator`.
 - Move `Endpoint` implementations from a single package into
   technology specific packages.
 - Move `HealthIndicator` implementations from a single package into
   technology specific packages.
 - As much as possible attempt to mirror the `spring-boot` package
   structure and class naming in `spring-boot-actuator` and
   `spring-boot-actuator-autoconfigure`.
 - Move `DataSourceBuilder` and DataSource meta-data support from
   `spring-boot-actuator` to `spring-boot`.

Fixes gh-10261
2017-09-12 00:11:20 -07:00
Andy Wilkinson 85493367b6 Rework health response structure to eliminate chance of key clashes
Previously, if a health's details contained a key named status (either
because an indicator bean was named statusHealthIndicator or an
indicator added an entry named status to its details) this would
clash with the health's own status as the details were serialized as
siblings of the status field.

This commit updates Health to remove @JsonAnyGetter from getDetails().
This means that all of a Health's details will now be nested within
a separate details field, thereby preventing a possible clash with
the status field.

Closes gh-10249
2017-09-11 14:37:13 +01:00
Andy Wilkinson c06de245d9 Allow endpoints to be mapped to /
This commit removes the restriction that was added in 4a61e45 to
prevent / from being used as the management context path when the
management context was not using a different port

The management context path can now be set to / irrespective of the
configuration of the management port. To avoid a possible clash
with the application's welcome page or similar, the links "endpoint"
that is mapping to the management context path is disabled when
the management context path is /.

As part of allowing / to be used as the management context path again,
the handling of endpoint mappings and the creation of paths for
individual operations has been consolidated into a new EndpointMapping
class that is used across the three (MVC, WebFlux, and Jersey)
implementations.

See gh-9898
2017-09-08 09:38:41 +01:00
Johnny Lim fd1b460027 Remove EndpointServletWebAutoConfigurationTests
Closes gh-10228
2017-09-08 10:04:03 +02:00
Andy Wilkinson 2e19f0b3e5 Upgrade to Jersey 2.26
Closes gh-10217
2017-09-07 20:09:24 +01:00
Stephane Nicoll 905e851219 Fix build failure 2017-09-06 15:23:13 +02:00
Johnny Lim 30262e3bc1 Polish
Closes gh-10168
2017-09-06 12:52:24 +02:00
Stephane Nicoll 8b88c6e884 Polish 2017-09-06 12:41:51 +02:00
Stephane Nicoll e244d75bd2 Restore `endpoints.env.keys-to-sanitize` binding
Closes gh-10174
2017-09-06 12:25:10 +02:00
Brian Clozel 1cf7c32a1e Polish 2017-09-06 11:52:05 +02:00
Stephane Nicoll 7388b4b768 Fix build failure 2017-09-06 11:43:34 +02:00
Andy Wilkinson f1c5fc41b4 Polish 2017-09-05 12:52:38 +01:00
Andy Wilkinson ad4ce9cf57 Return objects from trace, audit event, and thread dump endpoints
Closes gh-7648
2017-09-05 12:13:25 +01:00
Andy Wilkinson a6b30a3aab Reflect context hierarchy in beans endpoint’s response structure
Closes gh-10156
2017-09-05 12:13:25 +01:00
Andy Wilkinson ab54801143 Improve structure of response from configprops endpoint
Closes gh-10162
2017-09-05 12:13:25 +01:00
Andy Wilkinson 9242def4c0 Improve structure and JSON serialization of beans endpoint's response
Closes gh-10156
2017-09-04 14:40:15 +01:00
Andy Wilkinson 9ffbfb0d80 Ensure that endpoints are created before their web extensions
Closes gh-10140
2017-09-04 11:01:52 +01:00
Stephane Nicoll 37d92807d6 Polish test
See gh-10139
2017-09-04 10:01:14 +02:00
Mark Paluch 0e2f7c57ee Close reactive Redis connection after health check
Closes gh-10153
2017-09-04 08:44:21 +02:00
Stephane Nicoll a274c78fa0 Add support for reactive health indicator
This commit introduces a "ReactiveHealthIndicator" contract that can be
implemented for health checks against a reactive API.

When running in a WebFlux-based web app, the health and status endpoints
transparently use this in a WebFlux-based application and regular
HealthIndicator are executed on the elastic scheduler.

When running in a Servlet-based web app, the endpoints includes and
adapts available ReactiveHealthIndicators automatically

Closes gh-7972
2017-09-01 15:18:48 +02:00
Andy Wilkinson 7fc12bc8a3 Polish 2017-08-30 17:34:07 +01:00
Johnny Lim db76112700 Polish
See gh-10109
2017-08-30 10:33:53 +02:00
Phillip Webb 2c97d3a5e9 Polish 2017-08-29 15:59:32 -07:00
Stephane Nicoll 441dd2bc16 Move endpoints.trace.filter to management.trace.filter
Closes gh-10007
2017-08-29 17:09:19 +02:00
Stephane Nicoll 54781c73b5 Move endpoints.metrics.filter to management.metrics.filter
See gh-10007
2017-08-29 17:04:59 +02:00
Stephane Nicoll 1897d76cda Merge branch '1.5.x' 2017-08-29 14:00:23 +02:00
Paul Vorbach 04ca7f137d Identify and fix incomplete assertions
Several calls to assertThat lacked a following assertion most often due
to wrong use of parenthesis.

See gh-10084
2017-08-29 13:49:28 +02:00
Johnny Lim 118f65556f Remove unused ExpectedExceptions
Closes gh-10101
2017-08-29 13:19:04 +02:00
Stephane Nicoll 3ef3b40783 Rename EndpointType to EndpointExposure
Closes gh-10100
2017-08-29 11:50:27 +02:00
Phillip Webb f9e5b07eec Polish endpoint 2017-08-29 11:32:39 +02:00
Stephane Nicoll 98455e30dc Rename default endpoint settings to "default"
Closes gh-10098
2017-08-29 11:27:35 +02:00
Madhura Bhave 919dfd3f90 Remove unused properties and constants
Since the autoconfig totally backs off in the presence
of a WebSecurityConfigurerAdapter, there is no need to
order them ahead of/after the one provided by Spring Boot.

See gh-7958
2017-08-28 15:53:35 -07:00
Stephane Nicoll f6134a8862 Polish 2017-08-28 11:38:10 +02:00
Stephane Nicoll da65158eae Disable Jolokia by default
To be consistent with Actuator web endpoints, Jolokia is now disabled
by default.

Closes gh-10090
2017-08-28 10:18:19 +02:00
Stephane Nicoll def094b844 Advertize web endpoints as disabled by default
Following the rework on Security that expects web endpoints to be
disabled by default, this commit updates the metadata (including the
automatic generation) to reflect this decision.
2017-08-28 10:08:38 +02:00
Stephane Nicoll c76c16d92b Polish 2017-08-28 09:59:32 +02:00
Madhura Bhave 4990b52b72 Reinstate CloudFoundry support for actuators
Closes gh-9996
2017-08-27 23:15:19 -07:00
Madhura Bhave bacbe0459b Disable web endpoints by default
Since the handler interceptors have been removed, web endpoints
are all disabled by default to prevent accidental exposure of
sensitive information.

Closes gh-7958
2017-08-27 23:15:18 -07:00
Madhura Bhave e08ddbf838 Rework security autoconfiguration
This commit combines security autoconfigurations for
management endpoints and the rest of the application. By default,
if Spring Security is on the classpath, it turns on @EnableWebSecurity.
In the presence of another WebSecurityConfigurerAdapter this backs off
completely. A default AuthenticationManager is also provided with a user
and generated password. This can be turned off by specifying a bean of
type AuthenticationManager, AuthenticationProvider or UserDetailsService.

Closes gh-7958
2017-08-27 23:15:18 -07:00
Stephane Nicoll f60ad0df74 Polish 2017-08-27 14:25:59 +02:00
Stephane Nicoll 049df50f31 Add explicit dependency to ConnectionFactory auto-configurations
This commit makes sure tht `HealthIndicatorAutoConfiguration` runs after
any producers of a `ConnectionFactory` and not only ActiveMQ. This was
identified as part of #10081: `JmsAutoConfiguration` is actually the
one that isn't necessary (spring-boot-actuator has no import on the
`org.springframework.jms` and only `javax.jms.ConnectionFactory` is used
as part of the JMS health indicator.
2017-08-27 14:25:01 +02:00
Stephane Nicoll 69faa7dd33 Remove useless cast
The number of nodes can be added to the details without the need to cast
it.

Closes gh-10078
2017-08-25 18:53:56 +02:00
Stephane Nicoll dd88b116d5 Add deprecated metadata for Jolokia
See gh-10076
2017-08-25 15:57:57 +02:00
Stephane Nicoll c69725f68c Add deprecated metadata for Actuator endpoints
See gh-10076
2017-08-25 14:28:48 +02:00
Stephane Nicoll 38745d41d7 Add deprecated metadata for CRaSH support
See gh-10076
2017-08-25 14:12:42 +02:00
Stephane Nicoll e4f3164da7 Polish 2017-08-23 15:50:30 +02:00
Stephane Nicoll 2725151bff Add missing test scope 2017-08-23 15:08:23 +02:00