639 Commits

Author SHA1 Message Date
dreis2211
5f66c09844 Narrow scope of some variables
Closes gh-11743
2018-01-22 16:01:02 -08:00
Andy Wilkinson
77596fa8e6 Polish 2018-01-22 21:15:48 +00:00
Andy Wilkinson
a41e28eea2 Merge branch '1.5.x' 2018-01-22 21:00:26 +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
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
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
68cc373daa Polish 2018-01-20 11:37:39 +01: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
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
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
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
Andy Wilkinson
e1ec0562b2 Revert "Disable Reactor Netty's use of kqueue/epoll"
The failure continued to occur so this commit reverts commit
42c1ce65e9507ef9267feadfa34da02e82409b13.

See gh-10569
2018-01-18 13:46:27 +00: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
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
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
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
76057be9ac Merge branch '1.5.x' 2018-01-16 11:15:51 +01:00
Andy Wilkinson
23d8d608c4 Polish 2018-01-15 13:35:46 +00:00
Johnny Lim
77150f8dc9 Polish
Closes gh-11630
2018-01-15 10:20:31 +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
8aaf95b792 Polish 2018-01-12 11:40:35 +01:00
Johnny Lim
136e26e307 Fix typo in DynamicRegistrationBean class name
Closes gh-11606
2018-01-12 01:44:45 +01:00
Andy Wilkinson
a051e30fe0 Publish an event after refresh but before runners are called
This commit partially reverts the changes made in ec470fbe. While
the started message continues to be logged before any application and
command line runners are called, the publishing of
ApplicationReadyEvent now happens after the runners have been called.
Additionally, a new event, named ApplicationStartedEvent, has been
introduced. This new event is published after the context has been
refreshed but before any application and command line runners are
called.

Closes gh-11484

The reworking of the events described above also means that either
an ApplicationReadyEvent or an ApplicationFailedEvent will be
published and the latter should never be published once the former
has been published.

Closes gh-11485
2018-01-11 11:26:53 +00:00
Brian Clozel
6ecdd6e9c1 Add SSL client Auth support with Reactor Netty
This commit adds SSL client Authentication support
to Reactor Netty and adds the relevant tests to
`AbstractReactiveWebServerFactoryTests` for all servers.

Fixes gh-11488
2018-01-11 11:15:29 +01:00
Brian Clozel
98ac2218db Apply server.undertow.* config to reactive servers
This commit applies `server.undertow.*` configuration properties
to Undertow when configured as a reactive web server.

See gh-11500
2018-01-11 11:15:23 +01:00
Brian Clozel
15bc718248 Apply server.jetty.* config to reactive servers
This commit applies `server.jetty.*` configuration properties
to Jetty when configured as a reactive web server.

It also removes some infrastructure support for Jetty 8, which
is not supported anymore in Spring Boot 2.0 (partial fix for
gh-11504).

See gh-11500
2018-01-11 11:15:17 +01:00
Brian Clozel
d264af8142 Apply server.tomcat.* config to reactive servers
This commit applies most `server.tomcat.*` configuration
properties to Tomcat when set up as a reactive web server.

Some Servlet-specific properties are not applied:

* server.tomcat.additional-tld-skip-patterns
* server.tomcat.redirect-context-root
* server.tomcat.use-relative-redirects

Fixes gh-11334
2018-01-11 11:15:02 +01:00
Andy Wilkinson
2059922735 Make ContextIdApplicationContextInitializer produce unique IDs
Closes gh-11023
2018-01-10 12:53:03 +00:00
Madhura Bhave
e57aafd63d Provide EndpointRequest for WebFlux-based Security
Closes gh-11022
2018-01-09 16:06:36 -08:00
Phillip Webb
b078698f20 Update copyright year of changed files 2018-01-09 12:13:27 -08:00
Phillip Webb
b3ec2c9d1d Polish 2018-01-09 12:12:59 -08:00
Johnny Lim
b8706c47d6 Use instance equality for Class
Closes gh-11534
2018-01-09 09:30:36 +01:00
Johnny Lim
0f0c6e0729 Polish
Closes gh-11536
2018-01-09 09:28:56 +01:00
Phillip Webb
9cb5f3da89 Create DynamicRegistrationBean
Extract functionality from the `RegistrationBean` into a new class
designed to work with dynamic registration. Servet and Filter
registration beans now extend from `DynaimcRegistrationBean`, where as
`ServletListenerRegistrationBean` extends directly from
`RegistrationBean`.

This refactor allows the removal of `ServletListenerRegistrationBean`
deprecated methods.

Fixes gh-11344
2018-01-08 22:05:00 -08:00
Phillip Webb
79fc8838fd Propagate Map conversion failures
Align `MapBinder` with `IndexedBinder` so that if a value is specified
any converter exception are propagated.

See gh-11493
2018-01-08 15:19:06 -08:00
Phillip Webb
25609c060e Polish 2018-01-08 15:19:06 -08:00
Phillip Webb
a62a27e686 Polish InvalidConfigurationPropertyValueException 2018-01-08 15:05:52 -08:00
Phillip Webb
937a62e0b8 Polish ConfigurationPropertiesBinder
Remove unused code and polish implementation so that the binder is not
created on each invocation.
2018-01-08 15:05:52 -08:00
Madhura Bhave
41c02b307b Try to convert value in MapBinder
Fixes gh-11493
2018-01-08 10:17:55 -08:00
Andy Wilkinson
927003e0b7 Polish 2018-01-08 13:59:14 +00:00
Stephane Nicoll
8941dc746e Polish 2018-01-08 14:38:10 +01:00