This moves the feature from a unconditional application listener that
can load gRPC types to an auto-configuration that backs off if the
necessary classes are not present.
Also updated the smoke tests to actually use the feature.
Closes gh-50825
The javadoc promises an IllegalArgumentException, but the method asserts
with Assert.state, which throws an IllegalStateException.
See gh-51175
Signed-off-by: wantaek <wantaekchoi@gmail.com>
This commit introduces new properties for configuring the HTTP headers
that should be used for forward support.
The new `server.netty.forwarded-headers.header-format` property allows
"standard" or "x_forwarded" to select "Forwarded" or "X-Forwarded-*"
headers.
This aligns the behavior of Netty server with the "FRAMEWORK" strategy.
Closes gh-51031
This commit introduces new properties for configuring the HTTP headers
that should be used for forward support.
The new `server.jetty.forwarded-headers.header-format` property allows
"standard" or "x_forwarded" to select "Forwarded" or "X-Forwarded-*"
headers.
This aligns the behavior of Jetty server with the "FRAMEWORK" strategy.
Closes gh-51148
Prior to this commit, Spring Boot would auto-configure the
`ForwardedHeaderFilter`/`ForwardedHeaderTransformer` when the "NATIVE"
strategy is chosen.
Spring Framework now requires an explicit choice between the supported
HTTP header variants as of spring-projects/spring-framework#37072.
This commit adapts to this new behavior with the following:
* the "FRAMEWORK" strategy now only applies to Spring MVC and Spring
WebFlux applications, since "NATIVE" strategies are now a good choice
for most deployments.
* the format of HTTP headers is now configured with
`spring.mvc.forwarded-headers.header-format` and
`spring.webflux.forwarded-headers.header-format`, with additional
options.
The default header format is now "X-Forwarded-*" for both NATIVE and
FRAMEWORK strategies. The reference documentation also reflects those
changes.
Closes gh-51030
Track meter registries added to Metrics.globalRegistry and remove them
on context close.
Disable use of the global registry in tests by default to avoid pinning
cached test contexts.
See gh-50886
Signed-off-by: LordKay-sudo <lkandiro@gmail.com>
Before deprecating `TestRestTemplate`, we must first stop using it in
module tests and replace it with:
* `RestTestClient` when the Spring MVC infrastructure is present
* `RestClient` when the test does not have Spring MVC on classpath
See gh-46632
This commit adds a new `TrustAllTlsRequestFactory` request factory that
can be used in tests for connecting a `RestTestClient` to a TLS endpoint
without checking the certificates validity.
See gh-46632
With Spring Framework 7.1 deprecating RestTemplate for removal, this
commit deprecates our supporting infrastructure as well, and steers
users towards RestClient instead:
* RestTemplateAutoConfiguration and
RestTemplateObservationAutoConfiguration
* RestTemplateBuilder, RestTemplateBuilderConfigurer, and
RestTemplateBuilderClientHttpRequestInitializer
* RestTemplateCustomizer, RestTemplateRequestCustomizer, and
ObservationRestTemplateCustomizer
* MockRestServiceServerAutoConfiguration,
MockServerRestTemplateCustomizer, and RootUriRequestExpectationManager
in the test support module
The reference documentation no longer covers RestTemplate and now
solely documents RestClient and WebClient. Code snippets and sample
tests that only existed to illustrate RestTemplate usage have been
removed accordingly.
Closes gh-51118