Commit Graph

2307 Commits

Author SHA1 Message Date
Madhura Bhave 114d270c9f Use date that fails with the fallback formatter
Fixes gh-9975
2017-09-18 16:39:28 -07:00
Andy Wilkinson d1cf308bd2 Polish 2017-09-18 19:26:19 +01:00
Phillip Webb 324a00fd6d Polish 2017-09-14 18:33:03 -07:00
Phillip Webb 0e32c0a7bc Fix speed regression in property binding
Update `MapBinder` to only compute values if an entry does not already
exist. Prior to this commit, a binding to `Map<String,List<String>>`
would be expensive since the same entries would be bound many times.

For example, given:

	foo.bar[0]=baz1
	foo.bar[1]=baz1
	foo.bar[2]=baz1

The Map binder would iterate over the properties `bar[0]`, `bar[1]` and
`bar[2]`. Each of these properties resulted in the same actual key of
`bar` which would then be bound to list multiple times.

Fixes gh-10093
2017-09-14 16:03:57 -07:00
Phillip Webb 402dcb7ea4 Polish 2017-09-14 15:24:14 -07:00
Stephane Nicoll 5efcbad751 Polish 2017-09-14 19:22:37 +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
Johnny Lim bd2d08bcd0 Polish
Closes gh-10282
2017-09-14 15:13:51 +02:00
Brian Clozel 485d0ed8be Polish
Release allocated `DataBuffer` if an error happens during template
processing. Otherwise, this buffer will be automatically released when
written to the exchange.
2017-09-14 10:06:34 +02:00
Phillip Webb 46dfe38b60 Rework security request matchers
Update the security request matchers so that a bean is no longer needed
when the matcher is used. Matchers can now be build by starting from
the `EndpointRequest` or `StaticResourceRequest` classes. For example:

http.authorizeRequests()
  .requestMatchers(EndpointRequest.to("status", "info")).permitAll()
  .requestMatchers(EndpointRequest.toAnyEndpoint()).hasRole("ACTUATOR")
  .requestMatchers(StaticResourceRequest.toCommonLocations()).permitAll()

Closes gh-7958
2017-09-12 00:11:29 -07: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 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
Andy Wilkinson 2e19f0b3e5 Upgrade to Jersey 2.26
Closes gh-10217
2017-09-07 20:09:24 +01:00
Johnny Lim 30262e3bc1 Polish
Closes gh-10168
2017-09-06 12:52:24 +02:00
Andy Wilkinson f1c5fc41b4 Polish 2017-09-05 12:52:38 +01:00
Stephane Nicoll 5111b03aa3 Remove duplicated method
This commit removes the beanNamesForAnnotationIncludingAncestors
method as it is now part of Spring Framework's BeanFactoryUtils.

Closes gh-10150
2017-09-05 09:51:33 +02:00
Stephane Nicoll 0e21af4082 Fix typo 2017-09-05 09:10:52 +02:00
Stephane Nicoll 67fc5ca433 Create a public API to bind a ConfigurationProperties object
Previously, the API used to bind a ConfigurationProperties annotated
object was private to the BeanPostProcessor implementation.

This commit moves most of the logic to ConfigurationPropertiesBinder. As
we want this object to have the same state regardless of how it is built,
a builder is now provided that detects the components that the binder
needs if not specified explicitly.

Closes gh-8344
2017-09-05 08:51:01 +02:00
Stephane Nicoll ab82aed96a Improve configuration properties binding test coverage
See gh-8344
2017-09-04 12:01:07 +02:00
Stephane Nicoll 11edff7576 Discover endpoints in parent context
Closes gh-10144
2017-09-01 16:45:52 +02:00
Andy Wilkinson f49741e3ed Allow an operation to specify the media types that it produces
Closes gh-10118
2017-08-31 13:56:15 +01:00
Phillip Webb 9cb0a81e50 Polish adapt to and from Mono conversion
See gh-10112
2017-08-30 15:38:05 -07:00
Andy Wilkinson 7fc12bc8a3 Polish 2017-08-30 17:34:07 +01:00
Stephane Nicoll afda0ec129 Default Hibernate DDL auto to none with Flyway/Liquibase
This commit adds a strategy interface to specific if a given DataSource
has its schema managed. The Hibernate auto-configuration uses it to set
it to "none" if a mechanism to initialize the DataSource is
found and "create-drop" otherwise.

Both Flyway and Liquibase implements that strategy interface and
register it in the context accordingly.

Closes gh-9262
2017-08-30 12:42:24 +02:00
Andy Wilkinson 8babd5d4c5 Adapt to and from Mono when calling an operation on an endpoint
This commit adds support for adapting to and from Mono when calling
an operation on an endpoint.

When an endpoint is exposed using WebFlux, a call to a blocking
operation is adapted to return a Mono by dispatching the operation
invocation on a separate thread using Reactor's elastic scheduler.

When an endpoint is exposed using Jersey, a call to an endpoint that
returns a Mono is adapted to return the Mono's result by blocking
until it is available. Note that such adaptation is not necessary when
using Spring MVC as it supports Mono natively.

Closes gh-10112
2017-08-30 10:53:07 +01:00
Stephane Nicoll b91ceef621 Polish "Polish"
Closes gh-10109
2017-08-30 10:41:51 +02: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 4c7088981f Add support for delete operations
This commit adds a `@DeleteOperation` annotation that can be used to
indicate that an endpoint's operation is meant to delete a resource.

Such operation is mapped to a DELETE http method.

Closes gh-10023
2017-08-29 16:45:50 +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
Stephane Nicoll 83eee7e65d Fix XA DataSource class name for Firebird
Closes gh-10102
2017-08-29 13:48:57 +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 f6134a8862 Polish 2017-08-28 11:38:10 +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
Johnny Lim 4ae3691fee Avoid substring() invocation when the result is itself
Closes gh-10077
2017-08-25 17:37:56 +02:00
Stephane Nicoll f8e08f79ed Add DispatcherType enum for configuration purpose
This commit creates our own version of javax.servlet.DispatcherType for
configuration purpose as we can use the other one now the servlet api
is optional.

Closes gh-9856
2017-08-24 10:28:59 +02:00
Johnny Lim 14c9f91aab Polish
Closes gh-10054
2017-08-22 16:28:03 +02:00
Brian Clozel 918d803f76 Remove start/stop integration test
This test is not useful in this context.

Closes gh-9889
2017-08-21 16:20:15 +02:00
Stephane Nicoll 2f51340047 Restore WebServerInitializedEvent listener registration
This commit fixes ServerPortInfoApplicationContextInitializer so that
is registers a listener against `WebServerInitializedEvent`.

A former polish to use a lambda actually introduced a regression as the
listener was registered as `ApplicationListener<?>`.

Closes gh-10047
2017-08-20 18:28:35 +02:00
Stephane Nicoll 394371eb73 Polish "Harmonize database initializers"
Closes gh-9752
2017-08-18 18:14:22 +02:00
Johnny Lim a7ef258069 Polish
Closes gh-10032
2017-08-18 11:28:33 +02:00
Stephane Nicoll e93f61ba70 Calling delegate on LoaderHidingResource#close()
Closes gh-10025
2017-08-17 14:25:00 +02:00
Stephane Nicoll 35cf0c56a8 Merge branch '1.5.x' 2017-08-14 16:15:17 +02:00
Stephane Nicoll cabd798353 Polish NestedConfigurationProperty documentation
Closes gh-9895
2017-08-14 16:13:54 +02:00
Gytis Trikleris 4d42d89d71 Upgrade to Narayana 5.5.30.Final
Closes gh-10004
2017-08-14 15:44:46 +02:00