Commit Graph

4119 Commits

Author SHA1 Message Date
Sam Brannen ba42deb7db Remove obsolete code 2022-10-07 14:12:04 +02:00
Brian Clozel 455a736a01 Switch to Micrometer 1.10.0-SNAPSHOT
See gh-29241
2022-10-06 14:08:07 +02:00
Iain Henderson b8243e6f84 Support CBOR and Protobuf with Kotlin Serialization
This commit introduces support for CBOR and Protobuf using Kotlin
serialization. Support comes in the form of Encoder/Decoder as well
as HttpMessageConverters. Seperate abstract base classes supply support
for binary and string (de)serialization.

The exising JSON codecs and message converters have been migrated to
use the new base classes.

Closes gh-27628
2022-10-06 13:51:50 +02:00
Juergen Hoeller 2a1807895e Upgrade to Tomcat 10.1 in web tests
Adapting to FileUpload API change: no FileItemFactory constructor argument anymore.
2022-10-06 12:33:56 +02:00
rstoyanchev ffe2ba4c7b Undo constructor deprecation + polishing 2022-10-05 20:04:39 +01:00
rstoyanchev b08f185a0b Use MethodArgumentNotValidException for model attributes
Closes gh-29251
2022-10-05 14:02:42 +01:00
rstoyanchev a4210854fb MessageSource support for Spring MVC and WebFlux exceptions
See gh-28814
2022-10-05 14:02:42 +01:00
Brian Clozel 681cf0dae7 Provide full request URL for "http.url" keyvalue
Prior to this commit, the Observation filter for Servlet applications
would only use the request pathInfo as an "http.url" high cardinality
keyvalue. This commit ensures that we're using the full request URL as a
value there.

This also polishes gh-29254.

Fixes gh-29257
See gh-29254
2022-10-05 11:40:28 +02:00
Brian Clozel 486a1b6024 Change keyvalue name to http.url in server observations
This commit changes the new high cardinality key value from
"uri.expanded" to "http.url" in order to align with the OTel
specification, since there is no need for backwards compatibility on
this new metadata.

Closes gh-29254
2022-10-05 09:55:42 +02:00
rstoyanchev 4d5b0c91a3 Polishing contribution
Closes gh-29247
2022-10-03 18:20:52 +01:00
Violeta Georgieva b5adae2086 Switch to Reactor Netty 2 snapshots
Update to Reactor BOM 2022.0.0-SNAPSHOT.
Process package changes.
Adapt to new `HttpHeaders` API.
Adapt to new cookies API.

See gh-29247
2022-10-03 18:20:52 +01:00
Brian Clozel a18c692b53 Start RestTemplate observation wtih available request
Prior to this commit, the `RestTemplate` `ClientHttpObservation` would
be started before the request object is available. While this would also
measure the connection estalishment for some HTTP client libraries, this
arrangement is incompatible with a tracing approach where the request
must be available to propagate information through the request headers.

This commit ensures that the observation only starts when the request is
available.

Fixes gh-29234
2022-09-30 23:12:53 +02:00
Johnny Lim 380795e5b8 Polish observability changes
Closes gh-29235
2022-09-30 23:12:26 +02:00
Brian Clozel 8c24e8c034 Add HttpOutcome for HTTP observations
Prior to this commit, the HTTP Observations would use
`HttpStatus.Series` as a value source for the "outcome" key value in
recorded observations. This would work for most cases, but would not
align in the 2xx HTTP status cases: the series would provide a
"SUCESSFUL" value whereas the heritage metrics support in Spring Boot
would give "SUCESS".

This commit introduces a dedicated `HttpOutcome` concept for this and
applies it to all HTTP observations.

Fixes gh-29232
2022-09-30 18:17:23 +02:00
Brian Clozel b9070ae752 Add contextualName to HTTP Observations
This commit ensures that all HTTP `ObservationConvention`
implementations provide a consistent contextual name for observations.
This name should be like "http get" where only the HTTP verb changes
depending on the request.

Fixes gh-29231
2022-09-30 18:17:23 +02:00
rstoyanchev 5d2c9d946a Clean up conditional use of ChannelOperationsId
Closes gh-29224
2022-09-30 13:04:02 +01:00
Violeta Georgieva e81d30160c Remove useless constant reactorNettyRequestChannelOperationsIdPresent
`reactor.netty.ChannelOperationsId` is available in Reactor Netty 1.1.x from the very beginning.
2022-09-30 13:04:02 +01:00
Brian Clozel d98e27cf79 Upgrade to Kotlin 1.7.20
This commit also temporarily changes a test assertion for the Jackson
Kotlin module.
As of https://youtrack.jetbrains.com/issue/KT-52932, Kotlin enhanced the
`IntRange` and this change is not supported yet by the Jackson Kotlin
module. An issue has been reported here:
FasterXML/jackson-module-kotlin#582

Closes gh-29225
2022-09-30 11:24:55 +02:00
rstoyanchev 9eaae0fe04 Polishing contribution and Theme deprecation notices
Closes gh-28870
2022-09-28 16:22:45 +01:00
Vedran Pavic cde92f5e1d Deprecate CookieGenerator
This commit deprecates CookieGenerator in favor of the more modern
alternative, ResponseCookie.

See gh-28870
2022-09-28 16:04:38 +01:00
rstoyanchev e6c2d44646 Better integrate ResponseCookie in CookieLocaleResolver
Improve ResponseCookie to allow an existing instance to be mutated
and also to set the cookie value through the builder. This allows
CookieLocaleResolver to avoid duplicating all the fields of
ResponseCookie and to have only a ResponseCookie field instead.

Closes gh-28779
2022-09-28 16:00:33 +01:00
Vedran Pavic 7ea49fa9f4 Refactor CookieLocaleResolver
At present, CookieLocaleResolver extends CookieGenerator instead of
AbstractLocale(Context)Resolver like other LocaleResolver
implementations. This means it duplicates some common aspects of
LocaleResolver hierarchy while also exposing some CookieGenerator
operations, such as #addCookie and #removeCookie.

Additionally, CookieGenerator's support for writing cookies is based
on Servlet support which at current baseline doesn't support SameSite
directive.

This commit refactors CookieLocaleResolver to make it extend
AbstractLocaleContextResolver and also replaces CookieGenerator's
cookie writing support with newer and more capable ResponseCookie.
Simplify creation of CookieLocaleResolver with custom cookie name

This commit introduces CookieLocaleResolver constructor that accepts
cookie name thus allowing for a simpler creation of an instance with
the desired cookie name.

See gh-28779
2022-09-28 16:00:33 +01:00
rstoyanchev badba7c3e9 Support coma-delimited format for origin values
Closes gh-27606
2022-09-27 14:49:18 +01:00
Arjen Poutsma d516667f37 Polish "Allow for CoroutineContext in invokeSuspendingFunction"
See gh-27193
2022-09-27 13:26:49 +02:00
Lukáš Křečan ff844ed99f Allow overriding invokeSuspendingFunction
This commit isolates the invocation of Kotlin coroutines into a separate
template method, so that it can be overridden in subclasses of
RequestMappingHandlerAdapter.

Closes gh-27195
2022-09-27 13:26:28 +02:00
Brian Clozel 1707a22c18 Merge branch '5.3.x' 2022-09-26 22:27:53 +02:00
Brian Clozel 9465110917 Polish
See gh-26707
2022-09-26 22:25:44 +02:00
chenrl b71e686cbd Fix ServletContextResource isFile check
Prior to this commit, `ServletContextResource` could rely on
`ServletContext#getRealPath` to check whether a resource exists.
This behavior is not enforced on some Servlet containers, as this method
is only meant to translate virtual paths to real paths, but not
necessarily check for the existence of the file.

See https://bz.apache.org/bugzilla/show_bug.cgi?id=55837#c3 for a
rationale of this behavior in Tomcat.

This commit enforces an additional check, resolving the path as a `File`
and checking that is exists and is a file.

Closes gh-26707
2022-09-26 22:20:15 +02:00
Brian Clozel 9c400ed384 Polish Stream#toList() consistent usage
In general, `Stream#toList()` is not a transparent replacement for
`.collect(Collectors.toList()))`, as the former returns an immutable
list.

This commit reverts some of those changes, where the returned `List`
instance was expected to be mutable.

See gh-29203
2022-09-26 20:25:13 +02:00
Adam Ostrožlík 0ccb64fe10 Replace Collectors.toList with Stream.toList
Closes gh-29203
2022-09-26 18:32:01 +02:00
Sam Brannen a975b9d5da Suppress "unused" warnings in tests 2022-09-26 14:27:32 +02:00
Sébastien Deleuze 42ab1b75e7 Fix a regression in Kotlin serialization support
After gh-29068, some Type instances can throw an
IllegalArgumentException. This commit catches them
properly to just return a null serializer in that
case.

Closes gh-29192
2022-09-26 09:55:44 +02:00
Johnny Lim 907c96b21e Polish "Deprecate support for theme" changes
See gh-29202
2022-09-26 08:46:19 +02:00
rstoyanchev 57067f58e1 Polishing contribution
Closes gh-28401
2022-09-23 16:54:15 +01:00
Laber, Jason M 27b5d141e2 Allow customization for ObjectReader and ObjectWriter
Allows customization from subclasses of
AbstractJackson2HttpMessageConverter, AbstractJackson2Decoder, and
AbstractJackson2Encoder

See gh-28401
2022-09-23 16:54:15 +01:00
rstoyanchev 74df50c906 Polishing ProblemDetail Javadoc 2022-09-23 16:54:02 +01:00
Arjen Poutsma ef5b64dc00 Minor Javadoc correction 2022-09-22 12:26:16 +02:00
rstoyanchev 5192d99fa4 Support formatting annotations on HTTP service interface
Closes gh-29095
2022-09-21 16:18:39 +01:00
Sébastien Deleuze 157c28bcec Enable HTTP and HTTPS on native in spring-web module
Closes gh-29185
2022-09-21 16:47:57 +02:00
Sam Brannen 321092ce6f Consistent use of @Deprecated(since = "6.0") 2022-09-20 14:34:24 +02:00
Sam Brannen 1263226928 Remove unused EMPTY_BUFFER constant
See gh-29038
2022-09-20 13:51:35 +02:00
Arjen Poutsma 990a34074a Upgrade RestTemplate to HttpClient 5
This commit upgrades the HttpComponentClientHttpRequestFactory and
related types from HttpClient version 4.5 to 5.

Closes gh-28925
2022-09-20 12:04:51 +02:00
Brian Clozel 4c45387805 Polish Observability instrumentation
This commit removes the scoping of `RestTemplate` requests, since no
user code is meant to run during HTTP client exchanges.

This also polishes the reactive `WebFilter` to directly use the
specific enum when creating the observation.
2022-09-19 10:05:42 +02:00
rstoyanchev 8f617780f7 Merge branch '5.3.x' 2022-09-14 19:28:45 +01:00
rstoyanchev ae8b7973b4 Improve Javadoc on RequestEntity#getUrl
Closes gh-28930
2022-09-14 19:25:55 +01:00
rstoyanchev f3c082abac Deprecate ignoreDefaultModelOnRedirect property
Closes gh-28324
2022-09-14 18:14:04 +01:00
rstoyanchev 02f61e3aae Fix failing test in CancelWithoutDemandCodecTests
The test started failing after recent commit
e370c15bc6.

See gh-29038
2022-09-14 16:43:35 +01:00
Sam Brannen b87d48b99b Merge branch '5.3.x' 2022-09-14 17:18:00 +02:00
Marc Wrobel ce49068ff9 Fix links in Javadoc and reference docs
- Fix broken links (by using a new URL, an alternative URL, or a
  Wayback Machine link)

- Use HTTPS where possible

- Remove https://issuetracker.springsource.com/browse/EBR-349: this
  link is dead and is also mentioned in
  https://jira.spring.io/browse/SPR-8093

- Clean up nohttp allowlist.lines

Closes gh-28876
2022-09-14 17:00:11 +02:00
Sam Brannen 8d92c57777 Merge branch '5.3.x'
# Conflicts:
#	spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java
2022-09-14 16:52:55 +02:00