Commit Graph

1805 Commits (5e35a34cbab77ccc6a696adbde6773b7b7364a19)

Author SHA1 Message Date
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
Stephane Nicoll 1df3fb6ecb Merge branch '1.5.x' 8 years ago
Stephane Nicoll b575be339e Fix endpoint id
See gh-7579
8 years ago
Andy Wilkinson 4993f32da8 Merge branch '1.5.x' 8 years ago
Andy Wilkinson f823599d1f Replace @PostConstruct validation with setter validation
Closes gh-7579
8 years ago
Stephane Nicoll 661fd848eb Merge branch '1.5.x' 8 years ago
dreis d58f38f6f6 Use String.replace() with single char if possible
See gh-8089
8 years ago
Stephane Nicoll 551bfb2c60 Polish contribution
Closes gh-8103
8 years ago
Johnny Lim 32f9e90de5 Replace 'String.length() == 0' with 'String.isEmpty()'
See gh-8103
8 years ago
Dave Syer 50c1e363ad Merge remote-tracking branch 'origin/1.5.x' 8 years ago
Dave Syer 98a4c72c50 Clarify PublicMetrics (uniqueness of metric names)
See gh-6404
8 years ago
Stephane Nicoll d67ce78e8b Merge branch '1.5.x' 8 years ago
Johnny Lim e0de28a1f7 Polish
Closes gh-8076
8 years ago
Phillip Webb 8ffaa54e74 Merge branch '1.5.x' 8 years ago
Madhura Bhave ca435512c0 Introduce spring-boot-autoconfigure-processor
Add an annotation processor that generates properties files for certain
auto-configuration class annotations. Currently attribute values from
@AutoConfigureOrder, @AutoConfigureBefore, @AutoConfigureAfter and
@ConditionalOnClass annotations are stored.

The properties file will allow optimizations to be added in the
`spring-boot-autoconfigure` project. Primarily by removing the need
to ASM parse as many `.class` files.

See gh-7573
8 years ago
Phillip Webb 2c89d9918f Relocate AutoConfigurations from root package
Move PropertyPlaceholder and MessageSource auto-configuration from the
root package to the `context` subpackage.

Fixes gh-8071
8 years ago
Phillip Webb 3893383cbe Merge branch '1.5.x' 8 years ago
Phillip Webb 5703fb1515 Polish 8 years ago
Andy Wilkinson d4c4bc35fd Start building against Spring Data Kay snapshots
See gh-7461
8 years ago
Andy Wilkinson 65fe405f19 Merge branch '1.5.x' 8 years ago
Andy Wilkinson b900a3efc8 Update Actuator endpoints to use custom media type
Previously, the actuator's endpoints produced application/json and,
where appropriate, also consumed application/json. Without a custom,
versioned media type, it's impossible for us to make changes to the
endpoints without breaking clients.

This commit introduces a new media type,
application/spring-boot.actuator.v1+json, that is now produced by
default with application/json also being produced if requested.
Endpoints that consume JSON will now also accept content the uses
the new media type in addition to application/json.

Closes gh-7967
8 years ago
Phillip Webb 89f7ec054f Merge branch '1.5.x' 8 years ago
Phillip Webb f3cd0ad22c Polish 8 years ago
Madhura Bhave e73c6bb2e2 Exclude authorization header from trace by default
Closes gh-7974
8 years ago
Andy Wilkinson e7ed7efb56 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 3e88c366ec Polish "Avoid property name collisions when serializing AuditEvent to JSON"
See gh-7990
8 years ago
Johannes Edmeier fcf36ed091 Avoid property name collisions when serializing AuditEvent to JSON
Previously, in case the data for the audit event contained an entry
with the key "type", the member `type` from the AuditEvent would be
overwritten when rendering to JSON due to the use of @JsonAnyGetter on
the data property.

This commit removes @JsonAnyGetter so that the data map is rendered as
a separate property in the JSON.

Closes gh-7990
8 years ago
Stephane Nicoll c54070d142 Merge branch '1.5.x' 8 years ago
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
8 years ago
Phillip Webb 5502fa2936 Merge branch '1.5.x' 8 years ago
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
8 years ago
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
8 years ago
Phillip Webb 43d432a527 Polish 8 years ago
Andy Wilkinson f7f764ffe1 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 5c9aa41c07 Update InMemoryRichGaugeRepository to support increments
Closes gh-2902
8 years ago
Andy Wilkinson 14e24462f2 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 7fa33cddd7 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson a02c2d4155 Improve the documentation of Health.Status constants
Closes gh-7784
8 years ago
Stephane Nicoll f4f5a70cb2 Merge branch '1.5.x' 8 years ago
Johnny Lim acc36c076d Polish
See gh-8004
8 years ago
Andy Wilkinson 9a4b6a90ae Merge branch '1.5.x' 8 years ago
Andy Wilkinson f72799186e Merge branch '1.4.x' into 1.5.x 8 years ago
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
8 years ago
Stephane Nicoll a9399639a0 Merge branch '1.5.x' 8 years ago
Stephane Nicoll 8bef0a1e60 Polish contribution
Closes gh-7905
8 years ago
Eddú Meléndez b2250f4ad8 Add LDAP health actuator
Provide specific health actuator endpoint to verify if LDAP connection
is valid.

See gh-7905
8 years ago
Stephane Nicoll e4876eb666 Merge branch '1.5.x' 8 years ago
Stephane Nicoll f21c767356 Polish contribution
Closes gh-7914
8 years ago
Kazuki Shimizu a6756c9ed3 Allow lowercase logger level on MVC endpoint
See gh-7914
8 years ago
Andy Wilkinson ae3434ba4c Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson d2201d5284 Correct copyright dates and enforce that starting year is 2012
Closes gh-7923
8 years ago
Andy Wilkinson 3c35066ed5 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 426435f4af Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 1afb050061 Correct copyright dates and enforce that starting year is 2012
Closes gh-7923
8 years ago
Andy Wilkinson 78a06c3278 Merge branch '1.5.x' 8 years ago
Phillip Webb 9159c87bf9 Polish 8 years ago
Stephane Nicoll a2d55428ef Merge branch '1.5.x' 8 years ago
Stephane Nicoll fefc66625f Merge branch '1.4.x' into 1.5.x 8 years ago
Eddú Meléndez f896ff9a10 Fix incomplete assertions
Closes gh-7907
8 years ago
Phillip Webb c35454e5f4 Merge branch '1.5.x' 8 years ago
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
8 years ago
Phillip Webb 77f9bb09ca Further Polish Mockito 2 support
See gh-7770
8 years ago
Phillip Webb 0cc313f224 Polish 8 years ago
Stephane Nicoll c28ff4314c Upgrade to Mockito 2
Closes gh-7770
8 years ago
Stephane Nicoll 506f6497c0 Merge branch '1.5.x' 8 years ago
Johnny Lim f915ae197a Polish 8 years ago
Phillip Webb 24f5125a8b Merge branch '1.5.x' 8 years ago
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
8 years ago
Phillip Webb 2fe4d60b47 Add `management.cloudfoundry.*` meta-data
Update configuration meta-data and appendix to include
`management.cloudfoundry.*` meta-data.

See gh-7108
8 years ago
Phillip Webb b1cb8bb3d9 Merge branch '1.5.x' 8 years ago
Phillip Webb 8ccd4db513 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 732011987d Fix ManagementContextConfiguration @Order support
Update `ManagementContextConfigurationsImportSelector` to instantiate
classes so that order annotations are respected.

Fixes gh-7814
8 years ago
Phillip Webb b4b8370632 Fix AuditEventsJmxEndpoint bean name
See gh-6579
8 years ago
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
8 years ago
Phillip Webb 4026fa563f Merge branch '1.5.x' 8 years ago
Phillip Webb 51762642b2 Polish audit event endpoint support
Closes gh-6579
8 years ago
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
8 years ago
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
8 years ago
Vedran Pavic a6d18f714f Add JMX without backing `Endpoint` support
Decompose `EndpointMBean` to improve support for JMX endpoints without
a backing `Endpoint`.

See gh-6579
8 years ago
Phillip Webb e1eb48e8b4 Fix warnings 8 years ago
Phillip Webb 6496ea78d4 Merge branch '1.5.x' 8 years ago
Phillip Webb a167db7b37 Allow OPTIONS requests in interceptors
Update `MvcEndpointSecurityInterceptor` and
`CloudFoundrySecurityInterceptor` to allow OPTIONS requests to be
processed.

Fixes gh-7720
8 years ago
Phillip Webb 53f1df86a2 Merge branch '1.5.x' 8 years ago
Phillip Webb aacf5d660f Update copyright year for changed files 8 years ago
Phillip Webb 38271b7397 Merge branch '1.5.x' 8 years ago
Phillip Webb 367963f29f Polish 8 years ago
Phillip Webb 519f9c6c54 Merge branch '1.5.x' 8 years ago
Phillip Webb 8b69856fc9 Polish 8 years ago
Stephane Nicoll ee9d86cb1c Merge branch '1.5.x' 8 years ago
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
8 years ago
Phillip Webb 49fa702708 Merge branch '1.5.x' 8 years ago
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`
8 years ago
Phillip Webb e0541d0f74 Polish 8 years ago
Stephane Nicoll 740813a1e8 Merge branch '1.5.x' 8 years ago
Stephane Nicoll 0d4ef3dbdb Fix formatting 8 years ago
Stephane Nicoll fb70097c4f Merge branch '1.5.x' 8 years ago
Stephane Nicoll d0fa72a169 Filter AbstractRoutingDataSource from health indicator
Closes gh-6806
8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Stephane Nicoll 3cf54884d8 Fix merge issue
See gh-7718
8 years ago
Stephane Nicoll 3d78068c67 Merge branch '1.5.x' 8 years ago
Stephane Nicoll 5d909a969f Polish contribution
Closes gh-6613
8 years ago
Eddú Meléndez 53d25999f3 Add support for multiple beans in the Flyway and Liquibase endpoints
Closes gh-6610
See gh-6613
8 years ago
Phillip Webb 6e02fe59f7 Merge branch '1.5.x' 8 years ago
Phillip Webb b87e02dde0 Polish Spring Integration metrics support
See gh-7722
8 years ago
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
8 years ago
Johnny Lim e12b4a944f Polish 8 years ago
Phillip Webb 8b47561f7e Merge branch '1.5.x' 8 years ago
Phillip Webb 38f7389eab Polish loggers 8 years ago
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
8 years ago
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
8 years ago
Phillip Webb dba8ef2ba8 Polish CF management skip SSL opt-in
See gh-7629
See gh-7655
8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
Phillip Webb 1f417997f3 Merge branch '1.5.x' 8 years ago
Phillip Webb d15f3548be Polish 8 years ago
Phillip Webb 6121208cbb Polish formatting 8 years ago
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb bd74c3d327 Polish formatting 8 years ago
Stephane Nicoll ef9f57621d Merge branch '1.5.x' 8 years ago
Stephane Nicoll 684be0f048 Polish contribution
Closes gh-6852
8 years ago
Vedran Pavic 899f7aa8f0 Add constants for supported audit event types
See gh-6582
8 years ago
Stephane Nicoll 9f3fa648bc Merge branch '1.5.x' 8 years ago
Stephane Nicoll f560f338ab Polish contribution
Closes gh-7219
8 years ago
Vedran Pavic 60e054d0e4 Add `LoggersEndpointMBean`
See gh-7219
8 years ago
Stephane Nicoll a86678cc31 Merge branch '1.5.x' 8 years ago
Eddú Meléndez fc09a23991 Add missing actuator metadata
Health metadata for cassandra and couchbase is added.

See gh-7632
8 years ago
Johnny Lim 6d1b752ffe Polish
Closes gh-7552
8 years ago
Oscar Utbult 38713c473f Remove redundant array creation for calling varargs method
Closes gh-7551
8 years ago
Andy Wilkinson 5a4a7409c9 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 595679bed4 Disable management security when testing Jolokia endpoint 8 years ago
Andy Wilkinson 133284c1c4 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 391a760c3c Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 4ec95b8308 Ensure that JolokiaMvcEndpoint destroys underlying controller
Closes gh-7606
8 years ago
Dave Syer 78b2931337 Merge branch '1.5.x' 8 years ago
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.
8 years ago
Dave Syer cc8ecb6ff5 Clear VCAP_APPLICATION after tests
So that other CF tests do not fail.
8 years ago
Madhura Bhave 6a1f3d2dab Merge branch '1.5.x' 8 years ago
Madhura Bhave 5d8e00cb56 Fix HealthMvcEndpointTests
See gh-7569
8 years ago
Madhura Bhave 1cd1054514 Merge branch '1.5.x' 8 years ago
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
8 years ago
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
8 years ago
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
8 years ago
Andy Wilkinson d0b1cad00f Merge branch '1.5.x' 8 years ago
Andy Wilkinson 967625db1e Replace field injection with constructor injection in config classes
Closes gh-7563
8 years ago
Andy Wilkinson 598eca7e0f Merge branch '1.5.x' 8 years ago
Andy Wilkinson 1464425d64 Remove use of @Component from classes that are not scanned
Closes gh-7549
8 years ago
Stephane Nicoll 816c236e5b Merge branch '1.5.x' 8 years ago
Stephane Nicoll ee72e788ed Rename `spring-boot-junit-runners` to `spring-boot-test-support`
Closes gh-7421
8 years ago
Stephane Nicoll 9c546a7efc Merge branch '1.5.x' 8 years ago
Stephane Nicoll 85de72c0d0 Merge branch '1.4.x' into 1.5.x 8 years ago
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
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
8 years ago
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
8 years ago
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
8 years ago
Andy Wilkinson 19cddd650d Merge branch '1.3.x' 8 years ago
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
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Phillip Webb ac1ad2a145 Polish 8 years ago
Johnny Lim 9627d0ed66 Polish
Closes gh-6487
8 years ago
Chad 18dd125059 Unescape quotation marks in JavaDoc
Closes gh-6482
8 years ago
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
8 years ago
Johnny Lim 68fe8a58b8 Align message with regex for AbstractMvcEndpoint.path
Closes gh-6437
8 years ago
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.
8 years ago
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
8 years ago
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
8 years ago
Phillip Webb e03e109874 Polish 8 years ago
Stephane Nicoll 7e6f4021de Polish contribution
Closes gh-6059
8 years ago
RichardCSantana 42bb843364 Fix Bug HealthIndicator for Redis Cluster
See gh-6059
8 years ago
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
8 years ago
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
8 years ago
Johnny Lim a9f6ae4422 Polish
Closes gh-6374
8 years ago
Andy Wilkinson 8e669e2eef Merge branch '1.3.x 8 years ago
Andy Wilkinson 4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
8 years ago
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
8 years ago
Andy Wilkinson c974de0119 Merge branch '1.3.x 8 years ago
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
8 years ago
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
8 years ago
Andy Wilkinson 5bfc6a50fd Remove accidental usage of Type.getTypeName() which is a Java 8 API
Closes gh-6325
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Lari Hotari 9f07e94450 Add MVC actuator endpoint for heap dumps
Add MVC only endpoint to obtain GZip compressed heap dump files.

See gh-5670
8 years ago
Lari Hotari e1893f66ce Extract AbstractMvcEndpoint class
Extract common functionality from Spring MVC only endpoints.

See gh-5670
8 years ago
Phillip Webb b732aeb453 Polish 8 years ago
Andy Wilkinson 5c6537c234 Consistently synchronize on this.monitor in InMemoryAuditEventRepository
See gh-6261
9 years ago
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
9 years ago
Phillip Webb 516df88ea0 Revisit AuditEventRepository interface
Update AuditEventRepository to restore support for `null` arguments and
explicitly Javadoc their meaning.

See gh-5854
9 years ago
Stephane Nicoll 3ba2b24301 Polish "Improve AuditEventRepository"
Closes gh-5854
9 years ago
Vedran Pavic 5f19323fbd Improve AuditEventRepository
See gh-5854
9 years ago
Phillip Webb 266445aaf0 Polish 9 years ago
Johnny Lim 5bc9d5b380 Polish
Closes gh-6244
9 years ago
Stephane Nicoll 84b2ff5c38 Polish "Add ability to filter cookies in trace data"
Closes gh-6018
9 years ago
Venil Noronha fde5e1b6a5 Add ability to filter cookies in trace data
See gh-6018
9 years ago
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
9 years ago
Alex Antonov 3546ae399e Allow management server SSL to be configured independently
Closes gh-6057
9 years ago
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
9 years ago
Stephane Nicoll fda2505be6 Fix checkstyle violations 9 years ago
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
9 years ago
Andy Wilkinson e5827f4840 Merge branch '1.3.x' 9 years ago
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
9 years ago
Phillip Webb 7446235ff4 Polish 9 years ago
Phillip Webb c136054e69 Merge branch '1.3.x' 9 years ago
Phillip Webb 5b97981c87 Polish 9 years ago
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
9 years ago
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
9 years ago
Andy Wilkinson 971913e672 Polish 9 years ago
Stephane Nicoll 3799496dc8 Merge branch '1.3.x' 9 years ago
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
9 years ago
Andy Wilkinson fa0a137cd2 Merge branch '1.3.x' 9 years ago
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
9 years ago
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
9 years ago
Phillip Webb ee319a6d8b Merge branch '1.3.x' 9 years ago
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
9 years ago
Phillip Webb 99c6194e17 Don't use MockitoJUnitRunner
Replace `@RunWith(MockitoJUnitRunner.class)` with direct Mockito
initialization since the running doesn't support parallel test
execution.
9 years ago
Johnny Lim 8704e4869d Polish
Closes gh-6066
9 years ago
Phillip Webb 14c7a1284e Formatting 9 years ago
Stephane Nicoll b02aba4c75 Polish contribution
Closes gh-5074
9 years ago
Vedran Pavic 20fa1b3b48 Support configuration of multiple management roles
Closes gh-5045
9 years ago
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
9 years ago
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
9 years ago
Ruben Dijkstra c84e09f611 Fix incorrect usage of Assert.notNull()
Closes gh-5931
9 years ago
Phillip Webb cf6212b955 Polish 9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Andy Wilkinson 3348ed5bb3 Make use of new GetMapping and PostMapping annotations
Closes gh-5277
9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Dave Syer 0ec5b7f43b Fix some more tests 9 years ago
Dave Syer 95c78e4e4c Fix test 9 years ago
Dave Syer 323d6e54a9 Add backwards compatible constructor to InfoEndpoint
Anyone who is extending InfoEndpoint (per the docs) in 1.3 can
continue to compile their code until they have time to adapt
to the new model.
9 years ago
Stephane Nicoll 21536f64e1 Polish info contributor feature
This commit improves the `InfoContributor` infrastructure as follows:

* `InfoEndpoint` no longer breaks its public API and returns a Map as
before
* `Info` is now immutable
* All properties of the build are now displayed. Since we control the
generation of that file, there is no longer a mode to restrict what's
shown
* Build info is now generated in `META-INF/build-info.properties` by
default

Closes gh-5734
9 years ago
Vedran Pavic 0b70710bbc Allow customization of AuditListener
Introduce `AbstractAuditListener` so that users can extended it to
replace the auto-configured default.

Fixes gh-5830
9 years ago
Johnny Lim 0efa0038c3 Polish
Closes gh-5815
9 years ago
Phillip Webb 590bd5c084 Fixup warnings 9 years ago
Phillip Webb 609cb52cd4 Move to relocated web classes
Refactor code to move from recently deprecated classes.

Closes gh-5822
9 years ago
Phillip Webb aea18671c1 Restructure web related classes
Reorganize web related classes for better separation of concerns.
Mainly this involves moving classes from `o.s.b.context.embedded`
that aren't directly tied to embedded servlet containers to
`o.s.b.web` and relocating everything from `o.s.b.context.web`.

See gh-5822
9 years ago
Phillip Webb a7cb689f95 Move @LocalServerPort annotation
Move the @LocalServerPort to org.springframework.boot.context.embedded
since it's only really useful when working with embedded servlet
containers.

See gh-5822
9 years ago
Johannes Edmeier 49ef93602e Add external-file-property to LogFileMvcEndpoint
Add an additional property to LogFileMvcEndpoint to allow log files to
be read from an external location. This is helpful when a launch.script
is used to start the boot-application and the logfile is written by a
redirect of stdout/stderr.

Fixes gh-4255
Closes gh-4836
9 years ago
Stephane Nicoll 5f41e82a89 Merge branch '1.3.x' 9 years ago
Stephane Nicoll 247685e992 Add missing `@Documented`
Closes gh-5786
9 years ago
Venil Noronha 0d47abbac4 Extract ApplicationContextHeaderFilter
Extract ApplicationContextHeaderFilter to a top-level class from
EndpointWebMvcAutoConfiguration and make the header field public.

Fixes gh-5726
Closes gh-5784
9 years ago
Phillip Webb 93382648ab Formatting 9 years ago
Phillip Webb 79922360e1 Polish 9 years ago
Dave Syer 014883253a Merge remote-tracking branch 'origin/1.3.x' 9 years ago
Dave Syer b9db4742ac Add metric flusher to export remaining metrics on shutdown
Before this change the app context closes and metrics that have not
yet been exported ccan be orphaned. The design of this feature is simple:
use Closeable where possible, so that it will be called automatically
by Spring on shutdown.

Fixes gh-5771
9 years ago
Dave Syer de2c22efee Merge remote-tracking branch 'origin/1.3.x' 9 years ago
Dave Syer de0f0ecce4 Align counter behaviour between metric exporters
The MetricCopyExporter has had the capability for a while to keep
track of counters internally. This change aligns that with the
PrefixMetricGroupExporter.

Fixes gh-5762
9 years ago
Andy Wilkinson 58dac43b8d Update TraceWebFilterAutoConfiguration to use constructor injection 9 years ago
Andy Wilkinson 13c01376b0 Merge branch '1.3.x' 9 years ago
Andy Wilkinson 9210029109 Record trace with response status of 500 following unhandled exception
Previously, if the filter chain threw an unhandled exception,
WebRequestTraceFilter would record a trace with a response status of
200. This occurred because response.getStatus() would return 200 as
the container had not yet caught the exception and mapped it to an
error response.

This commit updates WebRequestTraceFilter to align its behaviour with
MetricsFilter. It now assumes that the response status will be a 500
and only updates that to the status of the response if the call to the
filter chain returns successfully.

To avoid making a breaking change to the signature of the protected
enhanceTrace method, an HttpServletResponseWrapper is used to include
the correct status in the trace.

Closes gh-5331
9 years ago
Andy Wilkinson a2489b01aa Merge branch '1.3.x' 9 years ago
Andy Wilkinson 2e54078083 Tolerate possible null Flyway MigrationVersion when using Flyway 4.0
Flyway 4.0 provides support for repeatable migrations that do not
have a version. When such a migration has been performed,
MigrationInfo.getMigrationVersion() will return null and, previously,
FlywayEndpoint would fail with an NPE.

This commit updates FlywayEndpoint to use null as the version when
MigrationInfo.getMigrationVersion() returns null.

Closes gh-5700
9 years ago
Phillip Webb 5881c9c74f Polish 9 years ago