Commit Graph

1001 Commits

Author SHA1 Message Date
Andy Wilkinson d5b58a60e0 Upgrade to Jetty El 8.5.24.1
Closes gh-11739
2018-01-22 20:35:36 +00:00
Andy Wilkinson 89953f0d46 Upgrade to Jooq 3.10.4
Closes gh-11738
2018-01-22 20:35:35 +00:00
Andy Wilkinson 3b760d3620 Upgrade to Kotlin 1.2.20
Closes gh-11737
2018-01-22 20:35:34 +00:00
Andy Wilkinson 0ebff9aa80 Upgrade to Flyway 5.0.6
Closes gh-11736
2018-01-22 20:35:34 +00:00
Andy Wilkinson 37d3416627 Upgrade to Elasticsearch 5.6.6
Closes gh-11735
2018-01-22 20:35:33 +00:00
Andy Wilkinson c825167ec7 Upgrade to Netty 4.1.20.Final
Closes gh-11734
2018-01-22 20:35:32 +00:00
Andy Wilkinson 67c74ff123 Upgrade to Embedded Mongo 2.0.1
Closes gh-11733
2018-01-22 20:35:31 +00:00
Andy Wilkinson 884486aba7 Upgrade to Hikaricp 2.7.6
Closes gh-11732
2018-01-22 20:35:31 +00:00
Andy Wilkinson 315d2b620e Upgrade to Unboundid Ldapsdk 4.0.4
Closes gh-11731
2018-01-22 20:35:30 +00:00
Andy Wilkinson 59e577d9ac Upgrade to Cassandra Driver 3.4.0
Closes gh-11730
2018-01-22 20:35:28 +00:00
Andy Wilkinson 1fdfcfd042 Upgrade to Couchbase Client 2.5.4
Closes gh-11729
2018-01-22 20:35:27 +00:00
Andy Wilkinson 61eb93f9b0 Upgrade to Atomikos 4.0.6
Closes gh-11728
2018-01-22 20:35:26 +00:00
Andy Wilkinson b5444430ca Merge branch '1.5.x' 2018-01-22 20:33:36 +00:00
Brian Clozel a8baf42f2f Ensure that CharacterEncodingFilter is ordered first
This commit makes sure that `CharacterEncodingFilter` is ordered with
the `Ordered.HIGHEST_PRECEDENCE` and that other filters, potentially
reading the request body, are ordered after.

In this particular case, both `WebMvcMetricsFilter` and
`ErrorPageFilter` are now ordered at `Ordered.HIGHEST_PRECEDENCE + 1` to
avoid cases where the request body is read before the encoding
configuration is taken into account.

Closes gh-11607
2018-01-22 21:08:21 +01:00
Stephane Nicoll 6aa639253a Analyse the environment for properties that are no longer supported
This commit adds a new `spring-boot-configuration-analyzer` module that
can be added to any app to analyze its environment on startup.

Each configuration key that has a matching replacement is temporarily
transitioned to the new name with a `WARN` report that lists all of
them.

If the project defines configuration keys that don't have a replacement,
an `ERROR` report lists them with more information if it is available.

Closes gh-11301
2018-01-22 17:31:03 +01:00
sdeleuze d1b18b75d7 Manage dependencies for kotlin-stdlib-jdk7/8
As explained in the "Split package compatibility" section of
https://blog.jetbrains.com/kotlin/2017/09/kotlin-1-2-beta-is-out/
kotlin-stdlib-jdk7 and kotlin-stdlib-jdk8 are the recommended
dependencies to use with Kotlin 1.2 for Java 9+ compatibility.

Closes gh-11716
2018-01-22 17:03:22 +01:00
Johnny Lim a0f6abffb6 Use the platform-specific line separator
Closes gh-11674
2018-01-22 16:11:34 +01:00
Johnny Lim 13a7c9df4b Add missing null checks and volatile keyword
Closes gh-11692
2018-01-22 16:05:11 +01:00
Andy Wilkinson 66164bff14 Polish 2018-01-22 11:30:49 +00:00
Andy Wilkinson fbb1ba1bb3 Move actuator mappings introspection classes into dedicated packages
Closes gh-9979
2018-01-22 11:25:40 +00:00
Andy Wilkinson e973eaf2c3 Configure WebClient to use same address (IPv4 or IPv6) as server
Closes gh-11712
2018-01-22 09:47:37 +00:00
Stephane Nicoll 886ee9c870 Polish 2018-01-20 12:00:07 +01:00
Stephane Nicoll 68cc373daa Polish 2018-01-20 11:37:39 +01:00
Stephane Nicoll 126f8783a2 Polish 2018-01-20 11:07:07 +01:00
Phillip Webb 80bba046a3 Fix broken javadoc import 2018-01-19 22:24:47 -08:00
Phillip Webb bda9b892b3 Add direct WebFlux and WebMvc endpoint support
Add `@ControllerEndpoint` and `@RestControllerEndpoint` annotations that
can be used to develop a Spring-only request mapped endpoint. Both
Spring MVC and Spring WebFlux are supported.

This feature is primarily for use when deeper Spring integration is
required or when existing Spring Boot 1.5 projects want to migrate to
Spring Boot 2.0 without re-writing existing endpoints. It comes at the
expense of portability, since such endpoints will be missing from
Jersey.

Fixes gh-10257
2018-01-19 21:06:32 -08:00
Phillip Webb 340ef52f78 Refactor endpoint path concerns
Create a `PathMappedEndpoint` interface that allows any `ExposedEndpoint`
to provide root path details. The `EndpointPathResolver` interface has
been renamed to `PathMapper` and is now only used during endpoint
discovery.

`EndpointPathProvider` has been replaced with `PathMappedEndpoints`
which simply finds relevant path mapped endpoints.

Fixes gh-10985
2018-01-19 20:44:24 -08:00
Phillip Webb 1d39feffea Overhaul actuator endpoint code
Refactor several areas of the actuator endpoint code in order to make
future extensions easier. The primary goal is to introduce the concept
of an `ExposableEndpoint` that has technology specific subclasses and
can carry additional data for filters to use. Many other changes have
been made along the way including:

* A new EndpointSupplier interface that allows cleaner separation of
  supplying vs discovering endpoints. This allows cleaner class names
  and allows for better auto-configuration since a user can choose to
  provide their own supplier entirely.

* A `DiscoveredEndpoint` interface that allows the `EndpointFilter`
  to be greatly simplified. A filter now doesn't need to know about
  discovery concerns unless absolutely necessary.

* Improved naming and package structure. Many technology specific
  concerns are now grouped in a better way. Related concerns are
  co-located and concepts from one area no longer leakage into another.

* Simplified `HandlerMapping` implementations. Many common concerns have
  been pulled up helping to create simpler subclasses.

* Simplified JMX adapters. Many of the intermediary `Info` classes have
  been removed. The `DiscoveredJmxOperation` is now responsible for
  mapping methods to operations.

* A specific @`HealthEndpointCloudFoundryExtension` for Cloud Foundry.
  The extension logic used to create a "full" health endpoint extension
  has been made explicit.

Fixes gh-11428
Fixes gh-11581
2018-01-19 20:44:24 -08:00
Phillip Webb dc935fba48 Polish 2018-01-19 20:44:18 -08:00
Madhura Bhave d9ff51ccd3 Add StaticResourceRequest for WebFlux Security
Closes gh-11040
2018-01-20 10:00:08 +05:30
Madhura Bhave 5e2cc02499 Move servlet specific security auto-config 2018-01-20 09:41:50 +05:30
Stephane Nicoll 5c164d850e Upgrade to Spring Kafka 2.1.1.RELEASE
Closes gh-11524
2018-01-19 17:50:52 +01:00
Andy Wilkinson fedc4647e1 Use same InetAddress for client and server in endpoint tests
Previously, the server was created with out an explicitly configured
address. This lead to it using any local address which will prefer
IPv6 (::0) if it's available. By contrast, the client was created
with a base URL that specified localhost as the host. This meant the
the client would prefer to connect to IPv4. Normally this wouldn't
cause a problem as nothing would be listening on the port in the IPv4
stack so the client would then connect to the server being tested
using the IPv6 stack. However, if another process was listening to the
port in the IPv4 stack, the client would connect to the wrong server.
This could lead to an unexpected 404 response (if the wrong server
was an HTTP server) or a hang if it was not.

There's a chance, although I think it's unlikely, that the problem
described above is the cause of gh-10569. I think it's unlikely as
the hang tracked by gh-10569 only occurs when running the WebFlux
endpoint integration tests using Reactor Netty. If it was the problem
described above, there's no reason that I can think of why we
wouldn't have also seen it with the Web MVC endpoint integration
tests.
2018-01-19 15:23:47 +00:00
Brian Clozel fb7026b832 Add documentation for HTTP/2 support in Jetty
See gh-10902
2018-01-19 16:21:38 +01:00
Stephane Nicoll c926bed6f5 Polish "Fix modifiers order"
Closes gh-11681
2018-01-19 11:30:30 +01:00
igor-suhorukov e2d05607f2 Fix modifiers order
See gh-11681
2018-01-19 11:30:06 +01:00
Johnny Lim 9d24186942 Use this() in EndpointRequests
Closes gh-11690
2018-01-19 11:15:42 +01:00
Brian Clozel 247b7f0842 Fix WebFlux default error view for null exception messages
This commit prevents NullPointerExceptions when the default HTML error
view is being rendered with a `null` message.

Fixes gh-11677
2018-01-19 10:13:59 +01:00
Phillip Webb 0b81f78a2a Revert "Create CloudFoundry-specific EndpointWebExtension"
This reverts commit 7189f426ed.
2018-01-18 23:21:51 -08:00
Phillip Webb fc29f54868 Make Context implement AnnotationConfigRegistry
Update `AnnotationConfigReactiveWebServerApplicationContext` to
implement `AnnotationConfigRegistry`.

Fixes gh-11686
2018-01-18 23:21:51 -08:00
Phillip Webb f3379668ac Polish 2018-01-18 23:21:51 -08:00
Phillip Webb 6d93573db0 Merge branch '1.5.x' 2018-01-18 22:03:51 -08:00
Stephane Nicoll ba6be4f22f Merge branch '1.5.x' 2018-01-18 22:35:32 +01:00
Stephane Nicoll 8704cf1fe7 Harmonize metric property names
See gh-11667
2018-01-18 17:21:40 +01:00
Stephane Nicoll efd941bbe0 Merge branch '1.5.x' 2018-01-18 17:05:22 +01:00
Stephane Nicoll 6086bc714f Fix json structure 2018-01-18 17:04:37 +01:00
Stephane Nicoll aa748cb0ef Polish "Use System.lineSeparator()""
Closes gh-11665
2018-01-18 16:45:29 +01:00
Johnny Lim d8c83af987 Use System.lineSeparator()
See gh-11665
2018-01-18 16:45:09 +01:00
Stephane Nicoll 7002507304 Polish 2018-01-18 16:34:56 +01:00
Stephane Nicoll beaa49a2d6 Polish "Add auto-configuration for RabbitMQ metrics"
Closes gh-10887
2018-01-18 16:16:26 +01:00
Arnaud Cogoluègnes 58c8c4d56a Add auto-configuration for RabbitMQ metrics
See gh-10887
2018-01-18 16:11:50 +01:00
Andy Wilkinson 1d9f9716e9 Merge branch '1.5.x'
# Conflicts:
#	spring-boot-project/spring-boot-dependencies/pom.xml
2018-01-18 14:52:30 +00:00
Andy Wilkinson e1ec0562b2 Revert "Disable Reactor Netty's use of kqueue/epoll"
The failure continued to occur so this commit reverts commit
42c1ce65e9.

See gh-10569
2018-01-18 13:46:27 +00:00
Andy Wilkinson d5c9b9e12f Start building against snapshots for Spring Data Kay SR3
See gh-11666
2018-01-18 13:45:51 +00:00
Stephane Nicoll 5cb6c086b6 Rename micrometer instrumentation flags
Closes gh-11667
2018-01-18 14:16:40 +01:00
Stephane Nicoll 49b5fe0c29 Polish
As `validation-api` 2 is available by default, this commit adds the
integration test as a regular test case. The integration test is kept to
exercise what happens in a standard project.

See gh-11512
2018-01-18 14:05:24 +01:00
Stephane Nicoll 60f5cf10ba Merge branch '1.5.x' 2018-01-18 13:59:19 +01:00
Andy Wilkinson 849baa4c02 Do not require after in audit events endpoint
Closes gh-11605
2018-01-18 11:59:46 +00:00
Brian Clozel c233125f1d Don't render error view if response is committed
This commit prevents the default error view from rendering itself if the
response has been committed already. In this case, it is impossible to
change the HTTP response status and write a proper response - trying to
do so often results in a `IllegalStateException` since the response body
has already been written to.

Fixes gh-11580
2018-01-18 11:40:11 +01:00
Andy Wilkinson 42c1ce65e9 Disable Reactor Netty's use of kqueue/epoll
There is a suspicion that the use of epoll is causing the intermittent
failures being tracked by gh-10569. This commit disables the use of
epoll to see if it improves the situation.

See gh-10569
2018-01-18 10:18:13 +00:00
Stephane Nicoll 40c537daa0 Polish 2018-01-18 10:20:48 +01:00
Andy Wilkinson 87182a3a2b Stop configuring the Logback console appender to use UTF-8
Previously, the default Logback configuration set the console
appenders charset to UTF-8. This was inconsistent with the Logback
file appender and Log4j2's console and file appenders, all of which
used the platform's default.

This commit removes the configuration of the Logback console
appender's charset. This means that it will use the platform's
default charset, aligning it with the Logback file appender and
both Log4j2 appenders.

Closes gh-11611
2018-01-17 19:07:34 +00:00
Andy Wilkinson 54c0cf513b Polish 2018-01-17 19:03:23 +00:00
Andy Wilkinson 3904f49c9f Configure ServletContext before initializing S…C…Initializer beans
Previously, the ServletContext was configured after any
ServletContextInitializer beans had been initialized. This meant that
any configuration class that provided such a bean would be initialized
before the ServletContext was configured. If the configuration class
used the ServletContext in its initializtaion that it would see it in
its default, unconfigured state.

This commit reworks the configuration of the ServletContext so that
it happens before any ServletContextInitializer beans are initialized.

Closes gh-10699
2018-01-17 17:32:23 +00:00
Andy Wilkinson d8b3c7cc3c Make AnnotationConfigSWSApp…Context implement AnnotationConfigRegistry
Closes gh-11658
2018-01-17 17:30:16 +00:00
Johnny Lim e7185ea2b1 Polish
Closes gh-11655
2018-01-17 14:16:07 +01:00
Stephane Nicoll d43346d6c2 Polish "Fix potential resource leaks"
Closes gh-11624
2018-01-17 13:56:53 +01:00
igor-suhorukov 5a4238acfc Fix potential resource leaks
See gh-11624
2018-01-17 13:54:50 +01:00
Johnny Lim d27b46cf73 Fix a wrong import for SocketChannel
Closes gh-11648
2018-01-17 13:49:57 +01:00
Eddú Meléndez cecef7a7df Upgrade to JUnit Jupiter 5.0.3
Closes gh-11649
2018-01-17 13:48:06 +01:00
Stephane Nicoll f8af6c8134 Merge branch '1.5.x' 2018-01-17 13:42:56 +01:00
Andy Wilkinson ffc99b03dd Remove use of deprecated Gradle API from plugin's public API
This commit removes the use of the incubating PropertyState and
Provider API that was introduced in Gradle 4.0 and deprecated in
Gradle 4.3. A not-deprecated-but-still-incubating replacement was
introduced in Gradle 4.3. The short life of PropertyState and Provider
has made me wary of using an incubating Gradle API in our public API
as it may not be stable for long. Therefore, this commit does not move
to the replacement as it is incubating. Instead, it falls back to
using Gradle's convention mapping. This is internal API, but its use
is not part of our public API and I perceive the risk of using it to
be lower than using the deprecated and/or incubating API alternatives.

Closes gh-11640
2018-01-17 12:20:30 +00:00
Andy Wilkinson 5e17fc775c Test the Gradle plugin against Gradle 4.4.1
Closes gh-11654
2018-01-17 11:57:02 +00:00
Andy Wilkinson 2668e41dd5 Make it easier to just use Boot’s dependency management with Gradle
Closes gh-11059
2018-01-17 11:39:59 +00:00
Andy Wilkinson 3cf1fb6763 Polish formatting in Actuator API documentation 2018-01-16 20:46:42 +00:00
Andy Wilkinson 67a299020b Rework mappings endpoint
Improve the structure of the response and include mappings from
WebFlux and Servlet and Filter registrations in addition to the
mappings from Spring MVC.

Closes gh-9979
2018-01-16 18:26:59 +00:00
Brian Clozel 1f26a0314c Sanitize inputs in default reactive HTML error view
This commit uses HTML escaping to sanitize error inputs that are
displayed in the default reactive HTML error view.

Fixes gh-11582
2018-01-16 17:20:12 +01:00
Brian Clozel 381d759ef1 Support server.compression with reactive servers
This commit adds support for HTTP compression with reactive servers,
with the following exceptions:

* `server.compression.mime-types` and
`server.compression.exclude-user-agents` are not supported by Reactor
Netty at the moment

* `server.compression.min-response-size` is only supported by Reactor
Netty right now, since other implementations rely on the
`"Content-Length"` HTTP response header to measure the response size
and most reactive responses are using `"Transfer-Encoding: chunked"`.

Closes gh-10782
2018-01-16 16:01:34 +01:00
Stephane Nicoll bf88073f7e Tighten Liquibase auto-configuration to require Liquibase 3
Closes gh-11641
2018-01-16 12:02:03 +01:00
Stephane Nicoll 023bc13fb6 Merge branch '1.5.x' 2018-01-16 11:46:42 +01:00
Brian Clozel 1e648801bd Move spring.mvc.media-types to content-negotiation
This commit moves "spring.mvc.media-types" to the
"spring.mvc.content-negotiation.*" namespaces introduced in gh-11105.

Closes gh-11636
2018-01-16 11:35:49 +01:00
Stephane Nicoll 76057be9ac Merge branch '1.5.x' 2018-01-16 11:15:51 +01:00
Andy Wilkinson f7ddacf937 Update AuditEventRepository javadoc to describe behaviour of after
The behaviour was changed in 2b99962a. This commit updates the
javadoc to hopefully clarify that Instant.isAfter(Instant) is used.

Closes gh-11612
2018-01-16 10:10:40 +00:00
Andy Wilkinson 5b8a2f9675 Improve context hierarchy handling in Actuator endpoints
Previously, a number of Actuator endpoints ignored a context hierarchy
or assumed that it would always be linear. This commit reworks the
affected endpoints so that the no longer assume a linear hierarchy.

A side-effect of a non-linear hierarchy is that there may be multiple
different beans with the same name (in a linear hierarchy, a bean
with the same name as one in an ancestor context, replaces that bean).
The affected endpoints have also been updated so that, when bean names
are used as keys, those keys are grouped by application context. This
prevents a bean in one context from accidentially overwriting a bean
in another context.

Closes gh-11019
2018-01-16 09:53:52 +00:00
sdeleuze d4c91d2fe0 Improve Kotlin extensions doc about type erasure
Since type erasure can be fixed only when using
ParameterizedTypeReference based Java methods, TestRestTemplate
API documentation should be updated to specify which extensions
are subject to type erasure, and which are not.

Closes gh-11604
2018-01-16 10:19:12 +01:00
Gary Russell 0af67b86ed Polish Kafka documentation
Closes gh-11638
2018-01-16 08:48:34 +01:00
Brian Clozel 22c22a1ced Move server.session.* to server.servlet.session.*
Closes gh-11589
2018-01-15 17:50:32 +01:00
Stephane Nicoll 199d2e30d7 Polish 2018-01-15 15:15:34 +01:00
Andy Wilkinson 23d8d608c4 Polish 2018-01-15 13:35:46 +00:00
Stephane Nicoll b2ec7c58a6 Merge branch '1.5.x' 2018-01-15 12:13:24 +01:00
Stephane Nicoll e258884dd3 Polish doc
Closes gh-11529
2018-01-15 12:09:43 +01:00
Andy Wilkinson f7e408945e Use Instant for Session creation and last accessed times
Closes gh-10976
2018-01-15 10:59:22 +00:00
Brian Clozel 67e5897c40 Disable suffix pattern matching in Spring MVC
This commit disables by default suffix pattern matching in Spring MVC
applications. As described in the Spring MVC documentation (see
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping-suffix-pattern-match),
this is considered as best practice.

This change also introduces new configuration properties to achieve
similar results in a safer way (using query parameters) or to rollback
to the former default.

Closes gh-11105
2018-01-15 11:58:26 +01:00
Stephane Nicoll 2bf662f231 Remove hdrhistogram managed dependency
Closes gh-10923
2018-01-15 11:36:28 +01:00
Johnny Lim 77150f8dc9 Polish
Closes gh-11630
2018-01-15 10:20:31 +01:00
Stephane Nicoll 3f88906b97 Fix handling of ResponseStatusException
This commit updates DefaultErrorAttributes to handle
ResponseStatusException explicitly. This exception is used in a
WebFlux application to signal that the processing of the query has
failed with an HTTP status code and a reason phrase. The latter is now
properly mapped to the `message` attribute of the response body.

Closes gh-11614
2018-01-15 10:03:15 +01:00
Eddú Meléndez fb88a56af0 Upgrade to Spring Session 2.0.0.RELEASE
Closes gh-11619
2018-01-14 09:33:35 +01:00
Johnny Lim f6780bed65 Remove an unnecessary assertion
Closes gh-11622
2018-01-14 09:31:11 +01:00
Andy Wilkinson 2b99962a85 Replace use of Date with OffsetDateTime and Instant in Actuator
Closes gh-10976
2018-01-12 17:26:05 +00:00
Stephane Nicoll a99adb1047 Upgrade to Micrometer 1.0.0-rc.7
See gh-11598
2018-01-12 18:25:15 +01:00