320 Commits

Author SHA1 Message Date
Madhura Bhave
d1b8558430 Make /health and /info insecure by default
Closes gh-13722
2018-07-13 13:35:52 -07:00
Phillip Webb
e0ae805924 Update copyright header 2018-06-05 17:45:09 -07:00
Phillip Webb
2215709165 Merge branch '2.0.x' 2018-05-25 23:50:39 -07:00
Phillip Webb
9fd3b9103a Format code 2018-05-25 23:02:45 -07:00
Stephane Nicoll
93c45cb6ec Move server.servlet.path to spring.mvc.servlet.path
Closes gh-12971
2018-05-14 12:24:38 +02:00
Stephane Nicoll
3c169b4e0a Fix bean name of EnvironmentEndpointWebExtension
Closes gh-12827
2018-04-11 11:34:44 +02:00
Phillip Webb
9e75680e6f Polish 2018-02-16 18:11:54 -08:00
Madhura Bhave
51de220b55 Enable CSRF protection by default
Fixes gh-11758
2018-02-16 13:31:51 -08:00
Madhura Bhave
85aeb5c00d Fix path in tests 2018-02-12 10:19:52 -08:00
Stephane Nicoll
7473642f58 Harmonize endpoints exclude property
Closes gh-11914
2018-02-12 14:00:40 +01:00
Phillip Webb
5de46c3186 Polish 2018-02-08 16:35:10 -08:00
Andy Wilkinson
8605499a64 Provide more control over when the health endpoint shows details
Closes gh-11869
2018-02-07 09:51:19 +00:00
Andy Wilkinson
356efaa7c8 Rename trace to httptrace
Closes gh-11806
2018-01-30 12:55:27 +00:00
Phillip Webb
adfb6dc128 Polish 2018-01-25 13:20:29 -08:00
Andy Wilkinson
3565961d68 Rework HTTP exchange tracing and add support for WebFlux
Closes gh-9980
2018-01-25 13:27:07 +00:00
Madhura Bhave
d65f9b25bc Remove redundant throws Exception 2018-01-25 17:25:38 +05:30
Andy Wilkinson
5b8a2f9675 Improve context hierarchy handling in Actuator endpoints
Previously, a number of Actuator endpoints ignored a context hierarchy
or assumed that it would always be linear. This commit reworks the
affected endpoints so that the no longer assume a linear hierarchy.

A side-effect of a non-linear hierarchy is that there may be multiple
different beans with the same name (in a linear hierarchy, a bean
with the same name as one in an ancestor context, replaces that bean).
The affected endpoints have also been updated so that, when bean names
are used as keys, those keys are grouped by application context. This
prevents a bean in one context from accidentially overwriting a bean
in another context.

Closes gh-11019
2018-01-16 09:53:52 +00:00
Stephane Nicoll
afba8fed79 Harmonize management.server.context-path property
This commit moves management.server.context-path to
management.server.servlet.context-path to align with the configuration
key for the application's main context path.

Closes gh-11359
2017-12-28 12:08:51 +01:00
Stephane Nicoll
681fdb1ee8 Property detect Health web extension with management context
Previously, the Health web extension was defined in the management
context and, as a result, it wasn't found when a separate port was
required. The side effect is that anything that the health web extension
does was not active anymore in that case.

This commit makes sure that the extension is always defined as part of
the main context where operations are discovered and merged.

Closes gh-11285
2017-12-13 17:47:18 +01:00
Stephane Nicoll
1fdc1e373c Polish 2017-12-13 15:43:30 +01:00
Stephane Nicoll
23218add90 Polish 2017-12-12 11:57:30 +01:00
Madhura Bhave
47ed096981 Make default username and password configurable
Closes gh-10963
2017-12-11 15:15:47 -08:00
Phillip Webb
07f71e889e Move /application to /actuator
Change the endpoint default path from `/application` to `/actuator`.

Fixes gh-10970
2017-11-22 23:18:22 -08:00
Phillip Webb
31025d9f6c Drop status endpoint
Drop the status endpoint and merge functionality back into the health
endpoint. The `management.endpoint.health.show-details` property can
be used to change if full details, or just the status is displayed.

Fixes gh-11113
2017-11-22 22:01:58 -08:00
Phillip Webb
fd5c43cdc9 Separate endpoint concerns
Update endpoint code to provide cleaner separation of concerns.
Specifically, the top level endpoint package is no longer aware of
the fact that JMX and HTTP are ultimately used to expose endpoints.
Caching concerns have also been abstracted behind a general purpose
`OperationMethodInvokerAdvisor` interface.

Configuration properties have been refined to further enforce
separation. The `management.endpoint.<name>` prefix provides
configuration for a  single endpoint (including enable and cache
time-to-live). These  properties are now technology agnostic (they
don't include `web` or `jmx` sub properties).

The `management.endpoints.<technology>` prefix provide exposure specific
configuration. For example, `management.endpoints.web.path-mapping`
allow endpoint URLs to be changed.

Endpoint enabled/disabled logic has been simplified so that endpoints
can't be disabled per exposure technology. Instead a filter based
approach is used to allow refinement of what endpoints are exposed over
a given technology.

Fixes gh-10176
2017-11-15 14:41:38 -08:00
Andy Wilkinson
88366b75d0 Reinstate @DirtiesContext on shutdown endpoint test
Closes gh-10548
2017-11-14 18:42:09 +00:00
Ivan Sopov
d8fa71bc97 Samples cleanup
- Modifying dependencies to starter-web with tomcat exclusion plus
  alternative servlet container instead of manual dependency on
  spring-webmvc as it is the preferrable way to use alternative servlet
  container
- Previously RestTemplate with ssl was configured manually in tests - now
  it rellies on autoconfiguration - changed this for multi-connector test
  and added test to ensure that ssl autoconfiguration is working
- Most samples with alterntative servlet containers used some kind of
  service reading property and returning default since it wasn't
  configured - removed it, since it is not specific to using alternative
  servlet containers.

See gh-10548
2017-11-14 15:39:27 +01:00
Andy Wilkinson
ec7840e049 Align Actuator sample's tests with endpoint contextId changes
See gh-10980
2017-11-11 21:32:07 +00:00
Phillip Webb
c55b5d7111 Polish 2017-11-01 23:14:52 -07:00
Andy Wilkinson
66b55defa0 Adapt to password encoder changes in Spring Security
Closes gh-10762
2017-10-24 21:50:19 +01:00
Madhura Bhave
d307eba0a3 Add property to configure base-path for web endpoints.
Also, move properties corresponding to management server under
`management.server.*`.

Closes gh-10230
2017-10-16 15:17:55 -07:00
Phillip Webb
9ff87612f9 Delete sample Gradle builds
Remove the Gradle builds that were provided with some of the sample
applications since they were never directly invoked.

See gh-9316
2017-10-04 16:34:40 -07:00
Phillip Webb
2855010841 Fix sample POMs
Update sample POMs to follow CI friendly Maven conventions.

See gh-9316
2017-10-04 16:34:39 -07:00
Phillip Webb
9e43b99966 Polish 2017-09-27 17:44:48 -07:00
Madhura Bhave
7093602753 Simplify UserDetailsService creation in samples
Closes gh-10385
2017-09-26 14:06:19 -07:00
Andy Wilkinson
8ab12d909e Use standard bean validation annotations that are new in 2.0
See gh-9969
2017-09-20 12:08:13 +01:00
Stephane Nicoll
d89ff8cb28 Polish sample
Closes gh-10330
2017-09-19 17:03:27 +02:00
Jon Schneider
c2958c27ab Replace Boot's own metrics with support for Micrometer
Closes gh-9970
2017-09-14 17:15:46 +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
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
Phillip Webb
2c97d3a5e9 Polish 2017-08-29 15:59:32 -07:00
Stephane Nicoll
98455e30dc Rename default endpoint settings to "default"
Closes gh-10098
2017-08-29 11:27:35 +02: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
08ce7e24d7 Polish 2017-08-25 13:56:37 +02:00
Stephane Nicoll
68fcea7b9a Migrate endpoints.cors to management.endpoints.cors
This commit moves CORS properties out of the endpoints namespace as they
do not refer to a "cors" endpoint but rather to the CORS configuration
of all endpoints.

Closes gh-10053
2017-08-22 11:40:39 +02:00
Andy Wilkinson
ee16332745 Update Actuator to use the new endpoint infrastructure
This commit migrates the Actuator onto the new endpoint infrastruture.
In addition to the existing support for accessing the endpoints via
JMX and HTTP using Spring MVC, support for access via HTTP using
Jersey and WebFlux has been added. This includes using a separate
management port where we now spin up an additional, appropriately
configured servlet or reactive web server to expose the management
context on a different HTTP port to the main application.

Closes gh-2921
Closes gh-5389
Closes gh-9796
2017-08-11 16:38:41 +01:00
Andy Wilkinson
0aa39d0279 Improve the package structure of spring-boot-actuator module
Closes gh-7545
2017-08-10 12:08:01 +01:00