1297 Commits

Author SHA1 Message Date
dreis2211
2575621e06 Fix some illegal reflective access warnings
See gh-25531
2021-03-08 08:47:10 +01:00
Andy Wilkinson
cb600f1c0b Merge branch '2.3.x' into 2.4.x
Closes gh-25449
2021-02-26 14:26:57 +00:00
Andy Wilkinson
8f72ca6521 Use ResourceConfig customization to register endpoints with Jersey
Previously, actuator endpoints were registered with Jersey upon
injection of the ResourceConfig bean into a registrar class rather than
using a ResourceConfigCustomizer. This was done to fix a problem
when running the Actuator on a separate port where the main application
context's customizers were also applied to the management context,
breaking the singleton contract for those resources. This approach
meant that the registration could be performed at any point after the
ResourceConfig had been created. When Jersey's configured as a Filter
this resulted in the registration failing as the attempt was being made
after the Filter lifecyle callbacks which make the ResourceConfig
immutable.

This commit reworks the endpoint registration to be performed using a
ManagementContextResourceConfigCustomizer, a resource config customizer
that's only applied to the ResourceConfig that's used by the Actuator.
When there's a separate management context, this ResourceConfig is
created by the Actuator's auto-configuration and the management context
resource config customizers are applied to it during its creation. The
main application's customizers are not applied. When the actuator is
using the same context as the main application, this ResourceConfig is
created by the main application. In this case a
ResourceConfigCustomizer is defined that delegates to all
ManagementContextResourceConfigCustomizers, allowing them to register
the actuator endpoints with the main ResourceConfig.

Fixes gh-25262
2021-02-26 14:25:24 +00:00
Andy Wilkinson
9ba28a8b99 Merge branch '2.3.x' into 2.4.x
Closes gh-25185
2021-02-11 20:12:30 +00:00
Andy Wilkinson
bd64e05203 Instrument AMQP AbstractCF when defined as a ConnectionFactory
Fixes gh-25138
2021-02-11 20:09:40 +00:00
Stephane Nicoll
b2818680fd Polish "Clarify usage of BufferingApplicationStartup"
See gh-25075
2021-02-09 09:44:19 +01:00
Andy Wilkinson
788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
2021-02-02 15:12:27 +00:00
Andy Wilkinson
67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb
69fbd2f8aa Delegate usesPathPatterns() call to mappings
Update `CompositeHandlerMapping` so that the `usesPathPatterns()` method
returns `true` if any of the delegate mappings return `true`.

Closes gh-24877
2021-01-20 13:49:18 -08:00
Stephane Nicoll
3e376b955d Fix build failure
See gh-24943
2021-01-20 14:41:12 +01:00
Stephane Nicoll
2072e7242a Merge branch '2.3.x' into 2.4.x
Closes gh-24841
2021-01-14 18:02:28 +01:00
Stephane Nicoll
283ed48d63 Unwrap Datasource against an actual interface
This commit updates DataSourceUnwrapper to take a separate interface
type argument if the target datasource has to be unwrapped, given that
the target type is usually not an interface.

Closes gh-24697
2021-01-14 18:00:35 +01:00
Phillip Webb
a6a7c06e55 Merge branch '2.3.x' into 2.4.x 2021-01-12 12:04:11 -08:00
Phillip Webb
9da0bd8523 Update copyright year of changed files 2021-01-12 12:02:57 -08:00
Madhura Bhave
86e94b95c3 Merge branch '2.3.x' into 2.4.x 2021-01-04 13:36:36 -08:00
Madhura Bhave
9928d74a9e Revert fix to enable cors for actuator endpoints
The fix causes a Jersey application to fail in the absence
of a `CorsFilter` or `CorsConfigurationSource` bean.

See gh-11987
2021-01-04 12:25:43 -08:00
Stephane Nicoll
2c0bfb7674 Merge branch '2.3.x' into 2.4.x
Closes gh-24578
2020-12-21 09:38:37 +01:00
izeye
97dd4c0871 Polish
See gh-24558
2020-12-21 09:35:41 +01:00
Madhura Bhave
4822516fb7 Merge branch '2.3.x' into 2.4.x 2020-12-16 15:33:58 -08:00
Madhura Bhave
361198ebba Fix tests
See gh-11987
2020-12-16 15:25:02 -08:00
Madhura Bhave
a1ea5b49ec Merge branch '2.3.x' into 2.4.x
Closes gh-24542
2020-12-16 14:57:50 -08:00
Madhura Bhave
09e07428cc Configure CORS in default security configuration for MVC
Fixes gh-11987
2020-12-16 14:55:36 -08:00
Phillip Webb
4fba7d0c60 Merge branch '2.3.x' into 2.4.x 2020-12-15 19:48:52 -08:00
Phillip Webb
29300530c6 Polish 2020-12-15 19:44:40 -08:00
Phillip Webb
72d36e0c07 Update copyright year of changed files 2020-12-10 10:46:04 -08:00
Phillip Webb
e95c514661 Merge branch '2.3.x'
Closes gh-24412
2020-12-08 17:28:18 -08:00
Phillip Webb
49e754f48b Merge branch '2.2.x' into 2.3.x
Closes gh-24411
2020-12-08 17:23:33 -08:00
Phillip Webb
cd5ff6e4af Merge branch '2.3.x'
Closes gh-24404
2020-12-08 12:13:02 -08:00
Phillip Webb
11f285bde5 Merge branch '2.2.x' into 2.3.x
Closes gh-24403
2020-12-08 12:12:51 -08:00
izeye
8c55803931 Polish
See gh-24306
2020-12-08 12:08:35 -08:00
Phillip Webb
30c27274e2 Merge branch '2.3.x'
Closes gh-24339
2020-12-04 18:31:55 -08:00
Phillip Webb
5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb
837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
dreis2211
3e2d0c6d86 Remove deprecated ExposeExcludePropertyEndpointFilter
See gh-24323
2020-12-03 16:18:35 -08:00
Stephane Nicoll
bd7e89be1a Start building against Spring Framework 5.3.2 snapshots
See gh-24278
2020-11-30 17:18:35 +01:00
Stephane Nicoll
065fde2996 Start building against Spring Framework 5.2.12 snapshots
See gh-24277
2020-11-30 16:42:38 +01:00
Stephane Nicoll
9763ba56ba Start building against Spring Framework 5.2.12 snapshots
See gh-24276
2020-11-30 16:04:27 +01:00
Andy Wilkinson
1f3012b466 Merge branch '2.3.x'
Closes gh-24220
2020-11-20 11:36:45 +00:00
Andy Wilkinson
0ed7f7f40a Merge branch '2.2.x' into 2.3.x
Closes gh-24219
2020-11-20 11:36:31 +00:00
Andy Wilkinson
08b9d1da57 Polish "Ensure that MeterRegistry bean is defined before SI looks for it"
See gh-24095
2020-11-20 11:20:31 +00:00
Artem Bilan
7d712aaa2d Ensure that MeterRegistry bean is defined before SI looks for it
Previously, it was possible for Spring Integration, including its
built-in Micrometer support, to be auto-configured before the
Micrometer auto-configuration had defined the MeterRegistry bean. This
resulted in missing Spring Integration metrics.

Spring Integration is unusual in having its own built-in Micrometer
support that it configures itself. Rather than providing
auto-configuration for Integration's Micrometer support (Which isn't
needed), this commit introduces some auto-configuration that just
affects the ordering of the auto-configuration classes. This ordering
ensures that the MeterRegistry bean has been defined by Spring
Integration is auto-configured. This ensures that the MeterRegistry
bean is known to the BeanFactory when Spring Integration goes looking
for it.

See gh-24095
2020-11-20 11:18:09 +00:00
Andy Wilkinson
699f03d5a6 Merge branch '2.3.x'
Closes gh-24010
2020-11-03 14:04:38 +00:00
Andy Wilkinson
2dce4aa42b Merge branch '2.2.x' into 2.3.x
Closes gh-24009
2020-11-03 14:04:08 +00:00
Andy Wilkinson
30a0ccab02 Remove use of @PostConstruct from main code
When running on Java 11 (where `@PostConstruct` is no longer part of
the JRE) and without a dependency on jakarta-annotation-api,
`@PostContruct` annotions are silently dropped. This leads to obscure and
hard-to-track down changes in the behaviour of our auto-configuration
as the `@PostConstruct`-annotated methods are not invoked.

To allow users to run on Java 11 without having jakarta-annotation-api
on the classpath, this commit removes use of `@PostConstruct` from main
code. A Checkstyle rule has also been added to prevent its usage in
main code from being reintroduced.

Closes gh-23723
2020-11-03 13:59:38 +00:00
Stephane Nicoll
d951f28e16 Upgrade to Micrometer 1.6.0
Closes gh-23525
2020-10-29 18:58:32 +01:00
Andy Wilkinson
b9516bc77c Await registration of http.server.requests meter
Previously, the test would make an HTTP request and, as soon as the
response was received, it would check the presence and value of the
http.server.requests meter. This create a race condition between the
meter being registered once the response had been flushed and the
meter's presence being checked. If the check won the race, the test
would fail.

This commit updates the test to wait for up to 5 seconds for the
meter to be present and have a count of 1, matching the single request
that has been made.

Fixes gh-23919
2020-10-27 15:54:22 +00:00
Phillip Webb
ef89eb6dfb Add @ConditionalOnDefaultWebSecurity annotation
Add a dedicate condition annotation to detect when Spring Security is
available but has not been configured by the user. The new annotation
helps simplify quite a few of our auto-configuration classes.

See gh-23421
2020-10-26 23:47:14 -07:00
Madhura Bhave
0818f27f44 Configure WebSecurity using WebSecurityCustomizer
Replace `WebSecurityConfigurer` and `WebSecurityConfigurerAdapter`
configurations with `WebSecurityCustomizer` or `SecurityFilterChain`
beans.

Closes gh-23421
2020-10-26 23:47:14 -07:00
Andy Wilkinson
abfdfc3e5f Merge branch '2.3.x'
Closes gh-23908
2020-10-26 14:45:18 +00:00
Andy Wilkinson
c0bb6ff667 Await registration of http.server.requests meter
Previously, the test would make an HTTP request and, as soon as the
response was received, it would check the presence and value of the
http.server.requests meter. This create a race condition between the
meter being registered once the response had been flushed and the
meter's presence being checked. If the check won the race, the test
would fail.

This commit updates the test to wait for up to 5 seconds for the
meter to be present and have a count of 1, matching the single request
that has been made.

Fixes gh-23863
2020-10-26 14:41:58 +00:00