Commit Graph

2101 Commits

Author SHA1 Message Date
Johnny Lim 83ed0c7783 Make UserDetailsServiceAutoConfiguration.getOrDeducePassword() private
Closes gh-12295
2018-03-02 10:41:11 +01:00
Phillip Webb 7bc535e4fa Polish 2018-02-28 10:59:26 -08:00
Andy Wilkinson 9b46221345 Escape backslashes so they are preserved during Properties parsing
Closes gh-12285
2018-02-28 16:34:05 +00:00
Stephane Nicoll 0f652cdf4f Fix injection point with proxied DataSource
Prior to this commit, the `ApplicationContext` couldn't start with a
JDK-proxied `HikariDataSource` as the JMX auto-configuration was
attempting to inject a (too narrowed) `HikariDataSource`.

This commit rather injects a regular `DataSource` and attempt to unwrap
it as a `HikariDataSource`.

Closes gh-12271
2018-02-28 15:37:07 +01:00
Stephane Nicoll 5fa71a1f94 Switch test to ApplicationContextRunner 2018-02-28 14:13:45 +01:00
Stephane Nicoll 4180762d6d Polish contribution
Closes gh-12236
2018-02-28 09:01:59 +01:00
igor-suhorukov 56cbc65e7b Polish
See gh-12236
2018-02-28 08:58:46 +01:00
Phillip Webb c23b0e99f1 Fix failing PathRequestTests
Fix test failing due to commit d66496787d.

See gh-12238
2018-02-27 17:06:21 -08:00
Phillip Webb d66496787d Propagate exceptions in security matchers
Update `ApplicationContextRequestMatcher` and
`ApplicationContextServerWebExchangeMatcher` to use a supplier for
the context, rather than the context itself.

This allow exceptions to be propagated to subclasses which may choose
to deal with them.

See gh-12238
2018-02-27 16:29:14 -08:00
Andy Wilkinson dc36360155 Polish 2018-02-27 21:25:48 +00:00
Phillip Webb 3e4da3cc37 Polish 2018-02-27 12:53:01 -08:00
Andy Wilkinson c7ed5c3d4a Upgrade to EhCache 3.5.0
Closes gh-12256
2018-02-27 20:45:54 +00:00
Stephane Nicoll 6676967cc1 Polish 2018-02-27 16:47:55 +01:00
Phillip Webb 29c3be3590 Polish 2018-02-26 10:26:02 -08:00
Stephane Nicoll 306c79f0de Merge branch '1.5.x' 2018-02-26 18:03:32 +01:00
igor-suhorukov 98f4692c62 Polish
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.

Closes gh-12211
2018-02-25 10:59:02 +01:00
Johnny Lim d441a8a89a Polish
Closes gh-12205
2018-02-24 11:53:25 +01:00
Andy Wilkinson 1314678890 Nest @EnableWebFluxSecurity to avoid overzealous Wildfly warnings
Closes gh-12174
2018-02-23 20:50:20 +00:00
Andy Wilkinson 782ab2803e Polish documentation regarding target class proxying
Closes gh-12196
2018-02-23 14:52:43 +00:00
Stephane Nicoll 9b61df6a2b Polish 2018-02-23 15:18:46 +01:00
Stephane Nicoll 13b736b1cd Migrate remaining duration-based properties for Rabbit
Closes gh-12192
2018-02-23 15:16:57 +01:00
Stephane Nicoll 976a23d977 Fix duration unit of spring.messages.cache-duration
Closes gh-12183
2018-02-23 13:38:20 +01:00
Stephane Nicoll 92d1c6126b Harmonize `accesslog.enabled` flag for Undertow
Closes gh-12178
2018-02-23 11:26:33 +01:00
Stephane Nicoll 09ff815f00 Harmonize metadata
Closes gh-12177
2018-02-23 11:02:28 +01:00
Phillip Webb 4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Phillip Webb cd5266ac03 Polish 2018-02-22 20:25:28 -08:00
Brian Clozel dcf61abe30 Fix Reactive Server auto-configuration ordering
This commit ensures that Tomcat is the first reactive server configured
if the Tomcat dependency is on classpath.

Spring Boot chose Reactor Netty as the default for the reactive web
starter, but the Reactor Netty dependency can be used also for its HTTP
client. In case developers are adding Tomcat, Undertow or Jetty on their
classpath, we must configure those and consider Reactor Netty for the
client only.

Fixes gh-12176
2018-02-22 18:04:53 +01:00
Johnny Lim 2fe86da95b Use isTrue() and isFalse() for AssertJ
Closes gh-12170
2018-02-22 09:55:40 +01:00
Andy Wilkinson e7176c63f5 Stop DataSource initialization from preventing Hikari instrumentation
Closes gh-12129
2018-02-21 10:32:41 +00:00
Phillip Webb 46021928ba Rework common server customization
Update the configurable embedded web server factory interfaces to
extend `ConfigurableWebServerFactory` so that the can be used in a
`WebServerFactoryCustomizer`.

Extract server specific customization to their own auto-configuration
and align reactive/servlet server auto-configuration.

Closes gh-8573
2018-02-20 16:27:15 -08:00
Phillip Webb 05faac2b09 Polish 2018-02-20 15:53:25 -08:00
Andy Wilkinson b5e2c5ec1c Polish 2018-02-20 19:58:39 +00:00
Stephane Nicoll ce01a9145b Polish 2018-02-20 18:45:36 +01:00
Stephane Nicoll 20f104766b Add missing default values for enums 2018-02-20 17:33:32 +01:00
Stephane Nicoll 6f59dd6b17 Polish "Update documentation to reference webjars-locator-core"
Closes gh-12135
2018-02-20 16:37:34 +01:00
Nikola Kološnjaji 4da4a4d385 Update documentation to reference webjars-locator-core
See gh-12135
2018-02-20 16:33:19 +01:00
Stephane Nicoll 44b7673ee6 Polish 2018-02-20 11:04:52 +01:00
Phillip Webb 20109e27be Add ApplicationConversionService and fix binder
Create a new `ApplicationConversionService` similar in design to the
DefaultFormattingConversionService from Spring Framework. The new
conversion service provides a central place for custom conversion logic
supported by Spring Boot.

Also replace the `BindingConversionService` with an internal
`BindConverter` class that now invokes the `SimpleTypeConverter`
directly. Binding for `@ConfigurationProperties` has been updated so
that any custom property editors registered with the BeanFactory can
be used.

Fixes gh-12095
2018-02-19 20:25:47 -08:00
Phillip Webb 61f44179cb Relocate XA wrapper types
Move `XADataSourceWrapper` to `jdb` and `XAConnectionFactoryWrapper` to
`jms` so that they are packaged in a similar way to the underlying XA
types.

Fixes gh-12061
2018-02-19 20:22:03 -08:00
igor-suhorukov fe023817c7 Polish static finals
Closes gh-12083
2018-02-19 20:10:58 -08:00
Johnny Lim 88b184ca23 Polish 2018-02-19 20:00:20 -08:00
Andy Wilkinson da5bebf574 Revert "Use Jersey BOM in dependency management"
This reverts commit da7bf05c87.

Closes gh-12103
2018-02-18 09:52:19 +00:00
Phillip Webb 9e75680e6f Polish 2018-02-16 18:11:54 -08:00
Madhura Bhave 51de220b55 Enable CSRF protection by default
Fixes gh-11758
2018-02-16 13:31:51 -08:00
Brian Clozel 7ed4273fc3 Fix Redis Cache tests after key prefix changes
Update Redis Cache tests after changes in DATAREDIS-715.
2018-02-16 14:43:45 +01:00
Andy Wilkinson fe4c8f95ed Rename ReactiveWebServerAutoConfiguration
Closes gh-12086
2018-02-16 10:02:35 +00:00
Vedran Pavic da7bf05c87 Use Jersey BOM in dependency management
Closes gh-12082
2018-02-16 08:25:20 +00:00
Brian Clozel 0c1aac14a0 Move server.display-name configuration property
The `server.display-name` configuration property is used to configure
the application display name for Servlet-based applications.

This commit moves that property to:
`server.servlet.application-display-name` and keeps the same defaults.

Closes gh-8624
2018-02-15 15:28:28 +01:00
Phillip Webb 6771cc9674 Polish 2018-02-13 14:41:12 -08:00
Brian Clozel 8d22a79eb6 Polish 2018-02-13 18:21:31 +01:00
sdeleuze e399cf6918 Improve WebFlux error logging
This commit avoids printing the stacktrace for ResponseStatusException
in order to be consistent with WebFlux ResponseStatusExceptionHandler
and because this stacktrace is usually not very useful in Reactive
world and mainly pollutes the logs, only the message is logged in that
case.

It also logs a WARN message for Bad Request (400) HTTP responses in
order to have a feedback when an exception is thrown due to client error
(unable to deserialize request body for example).

See related SPR-15083 issue on Spring Framework side.
2018-02-13 18:21:31 +01:00
Stephane Nicoll d468a0714e Polish "Polish modifier order"
Closes gh-12019
2018-02-13 09:50:20 +01:00
Johnny Lim 87bf0b26df Polish modifier order
See gh-12019
2018-02-13 09:49:59 +01:00
Stephane Nicoll 31da4cc35d Polish "Remove redundant casts"
Closes gh-12011
2018-02-13 09:34:08 +01:00
igor-suhorukov 71351de694 Remove redundant casts
See gh-12011
2018-02-13 09:33:49 +01:00
Phillip Webb 74cede5cdc Migrate integration tests to context runner
Migrate `IntegrationAutoConfigurationTests` to use the
`ApplicationContextRunner`.
2018-02-12 17:49:54 -08:00
Phillip Webb f34aa6f4d8 Migrate to Spring Integration Micrometer support
Remove custom `SpringIntegrationMetrics` and instead provide
auto-configuration to the direct Micrometer support added in Spring
Integration 5.0.2.

Closes gh-11985
2018-02-12 13:24:29 -08:00
Phillip Webb 0348889fd7 Polish 2018-02-12 10:03:06 -08:00
Stephane Nicoll ca5ebea24b Polish 2018-02-12 14:07:58 +01:00
Stephane Nicoll 9aa751a949 Make an explicit link to MongoDataAutoConfiguration
Closes gh-12001
2018-02-12 14:03:43 +01:00
Andy Wilkinson 1b156fc2c3 Polish 2018-02-12 11:26:53 +00:00
Andy Wilkinson 6d1d9eb816 Polish 2018-02-12 10:53:30 +00:00
Stephane Nicoll 2f13449b26 Polish "Improve FailureAnalyzer for embedded datasource"
Closes gh-11953
2018-02-12 11:11:36 +01:00
Patryk Kostrzewa e66745a98a Improve FailureAnalyzer for embedded datasource
See gh-11953
2018-02-12 11:11:36 +01:00
Phillip Webb 3ec778fb64 Polish 2018-02-09 11:31:53 -08:00
Stephane Nicoll a97a762086 Only set mapping resources when present
This commit sets a mapping resources list only when there is at least an
element in it. This allows the default fallback of finding an "orm.xml"
file to kick in when no customization has been applied.

Closes gh-11964
2018-02-09 12:01:08 +01:00
Phillip Webb 5de46c3186 Polish 2018-02-08 16:35:10 -08:00
Andy Wilkinson 5522174e96 Provide package info for all packages included in javadoc 2018-02-08 16:50:37 +00:00
Andy Wilkinson a09c64e18c Polish 2018-02-08 11:15:36 +00:00
Andy Wilkinson 76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Madhura Bhave 0a446cb962 Refactor Spring Security auto-configuration classes
The auto-configuration for a `UserDetailsService` and the web bits
has been split into two.

Closes gh-11915
Fixes gh-11891
2018-02-07 16:12:46 -08:00
Andy Wilkinson 9a456924e4 Remove - from path-match and content-negotiation properties
Closes gh-11913
2018-02-07 15:09:32 +00:00
Phillip Webb a631619f63 Allow subpath H2 console matching
Fixes gh-11926
2018-02-06 13:25:17 -08:00
Phillip Webb eab1705351 Restore EmbeddedLdapAutoConfiguration condition
Restore a `@Condition` guard to `EmbeddedLdapAutoConfiguration`.

See gh-11764
2018-02-04 19:39:55 -08:00
Phillip Webb eab0b84a80 Polish 'Add support for multi baseDn;
Update multi baseDn support to use the recently introduced
`@Delimter` annotation

Closes gh-11764
2018-02-04 10:43:26 -08:00
Eddú Meléndez 270dc2cd72 Add support for multi baseDn
Update LDAP properties and auto-configuration to support multiple
base DN values.

See gh-11764
2018-02-04 10:41:57 -08:00
Eddú Meléndez 44ad630de3 Migrate LDAP tests to use ApplicationContextRunner 2018-02-04 10:41:23 -08:00
Lukas Eder 44cd3352a5 Detect jOOQ SQLDialect through jOOQ's JDBCUtils
This change updates SqlDialectLookup to delegate to jOOQ's JDBCUtils
rather than creating an additional mapping between
org.springframework.boot.jdbc.DatabaseDriver and org.jooq.SQLDialect.

This has the following advantages:

1. jOOQ's `SQLDialect` to URL mappings are already maintained by jOOQ,
   so no additional changes will be necessary to Spring Boot in the
   future.
2. Delegating to jOOQ means that the mapping also works for the
   commercial jOOQ distributions, e.g. when working with DB2, Oracle,
   SQL Server, etc., as the JDBCUtils of the commercial distribution
   also contains the relevant logic to map to e.g. `SQLDialect.DB2`,
   `SQLDialect.ORACLE`, `SQLDialect.SQLSERVER` (which are not
   available from the open source distribution linked by Spring Boot
   by default).

Closes gh-11466
2018-02-02 13:02:36 +00:00
Andy Wilkinson 00489c74ea Start building against Spring Data Kay SR4 snapshots
The fix in Spring Data Redis for sentinel configuration means that
two Jedis sentinel tests now attempt to connect to a Sentinel. As a
result the tests fail. Running a Redis Sentinel in a Docker container
appears to be non-trivial. As an alternative, this commit updates the
tests to capture the JedisConnectionFactory prior to its
initialization (which is the failure trigger) and then assert that its
configuration is as expected.

See gh-11884
Closes gh-11855
2018-02-02 11:12:37 +00:00
Andy Wilkinson 9a87424809 Use ApplicationContextRunner in RedisAutoConfigurationJedisTests 2018-02-02 11:12:22 +00:00
Andy Wilkinson 875091ed85 Polish “Remove or use unused method parameters”
Closes gh-11812
2018-02-02 09:34:19 +00:00
igor-suhorukov 717bd2c580 Remove or use unused method parameters 2018-02-02 09:34:19 +00:00
Phillip Webb c3ec316890 Move Application* and *FileWriter classes
Move `ApplicationHome`, `ApplicationPid` and `ApplicationTemp` to the
`system` package. Since `system` package is now much lower level, the
existing `FileWriter` implementations also needed to move to prevent
package tangles.

Fixes gh-8614
2018-02-01 16:44:42 -08:00
Andy Wilkinson 4a1bea1fed Polish 2018-02-01 20:03:02 +00:00
Phillip Webb 7d5e41f7dc Polish 2018-02-01 10:25:33 -08:00
dreis2211 3e84f5bdbe Remove obsolete comment
Closes gh-11874
2018-02-01 09:00:32 +01:00
Johnny Lim 3cead7693d Polish
Closes gh-11871
2018-02-01 08:35:42 +01:00
Madhura Bhave 71e9db012b Convert tests to use ApplicationContextRunner 2018-01-31 19:03:09 -08:00
Madhura Bhave 905666e797 Document usage of `AuthenticationEventPublisher`
Closes gh-11420
2018-01-31 18:41:08 -08:00
Stephane Nicoll 1106c582a7 Remove error-level metadata for Spring Mobile
While Spring Mobile support has been removed from Spring Boot, the
auto-configuration has been relocated to a separate module that uses
the same keys.

Flagging those keys as deprecated means that the IDE will be confused
when the extra jar is present on the classpath as it advertizes, as
it should, support fo them.

Closes gh-11844
2018-01-30 15:28:28 +01:00
Stephane Nicoll 726a1d075e Polish metadata for spring.flyway.sql-migration-suffix 2018-01-30 14:41:06 +01:00
Stephane Nicoll 87c82310cf Merge branch '1.5.x' 2018-01-30 10:42:45 +01:00
Phillip Webb c90a5a9e9e Polish 2018-01-29 21:35:56 -08:00
Madhura Bhave 134628a62d Add PathRequest to reactive security for parity 2018-01-29 18:34:46 -08:00
Madhura Bhave e80c22cbf8 Add RequestMatcher for H2 console
Fixes gh-11704
2018-01-29 18:34:46 -08:00
Phillip Webb 3a12f98bab Migrate callbacks to LambdaSafe util
Migrate existing code to the new `LambaSafe` callback handler.

Closes gh-11584
2018-01-29 14:31:10 -08:00
Andy Wilkinson 6582afea4a Polish 2018-01-29 21:04:41 +00:00
Andy Wilkinson 244a287484 Merge branch '1.5.x' 2018-01-29 19:51:50 +00:00
Phillip Webb af50a18da9 Polish 2018-01-29 09:47:03 -08:00
Stephane Nicoll c2a2999799 Use proper classloader for value serialization
Closes gh-11822
2018-01-29 13:55:05 +01:00
dreis2211 c1675c2d5f Use InvocationOnMock.getArgument() where possible
Closes gh-11818
2018-01-29 08:06:00 +01:00
Johnny Lim 6d68806275 Polish
Closes gh-11805
2018-01-27 05:22:04 +01:00
Phillip Webb b234501af3 Polish 2018-01-26 11:39:41 -08:00
Andy Wilkinson 192fe929c7 Polish "Use custom DataSource if Flyway or Liquibase has user or url"
Closes gh-11751
2018-01-26 14:51:43 +00:00
Dominic Gunn 5d3cd23eed Use custom DataSource if Flyway or Liquibase has user or url
This commit enables a more flexible Liquibase/Flyway configuration by
allowing for a combination of the provider's and the primary
DataSource's configuration to be used. This gives developers the
flexibility to specify only a user or a url and having
Liquibase/Flyway fall back to individual datasource properties rather
than ignoring the Liquibase/Flyway properties and falling back to the
default data source.

See gh-11751
2018-01-26 14:51:43 +00:00
Stephane Nicoll 1c195f5b9a Polish "Migrate server customizer to PropertyMapper"
Closes gh-11772
2018-01-26 13:48:07 +01:00
yulin 19542b975f Migrate server customizer to PropertyMapper
See gh-11772
2018-01-26 13:48:07 +01:00
Stephane Nicoll 98c667c2d5 Polish "Use PropertyMapper to configure WebServerFactory"
Closes gh-11773
2018-01-26 11:19:03 +01:00
Huang YunKun 7d4e558f8e Use PropertyMapper to configure WebServerFactory
See gh-11773
2018-01-26 11:08:23 +01:00
Madhura Bhave 3a95a7531a UserDetailsService not created when OAuth configured
Fixes gh-10531
2018-01-26 15:10:21 +05:30
Phillip Webb adfb6dc128 Polish 2018-01-25 13:20:29 -08:00
Andy Wilkinson cedb6b2f17 Revert "Clean up the logging system later in context close processing"
This reverts commit 8619256d2a.

See gh-11676
2018-01-25 13:15:41 +00:00
Andy Wilkinson 4c23afdcd8 Polish 2018-01-25 11:04:16 +00:00
Andy Wilkinson e2cb7a7545 Align default scopes for Google with changes in Spring Security 5.0.1
Closes gh-11573
2018-01-25 10:58:05 +00:00
Andy Wilkinson 8619256d2a Clean up the logging system later in context close processing
Previously, the logging system was cleaned up in response to the
root context's ContextClosedEvent being received. This event is
published early in a context's close processing. As a result, the
logging system is in cleaned up state while, for example, disposable
beans are being destroyed.

This commit reworks the logic that triggers logging system clean up
to use a disposable bean instead. Disposable beans are called in
reverse-registration order. The logging clean up bean is registered as
early as possible so that it should be the last disposable bean to
be called.

Closes gh-11676
2018-01-25 10:33:56 +00:00
Stephane Nicoll a2a31894a8 Fix typo 2018-01-25 08:19:25 +01:00
Phillip Webb d61ba241b5 Move "testdb" naming to DataSourceProperties
Move the "testdb" naming logic to `DataSourceProperties` and expose
the `deduceDatabaseName` method so they can be used in
auto-configuration.

See gh-11719
2018-01-24 20:43:00 -08:00
Stephane Nicoll b67903a04a Keep "testdb" default datasource name internal
Previously, Hikari's pool name was auto-configured with the value of
`spring.datasource.name` that defaults  to `testdb`, which brings some
confusion.

This commit removes the default `testdb` value on
`spring.datasource.name` as it is a sane default only for an embedded
datasource. It is applied whenever applicable instead.

Closes gh-11719
2018-01-24 17:41:32 -08:00
dreis2211 542c3b7c1e Remove usage of Vector collection
Closes gh-11759
2018-01-24 16:36:45 -08:00
igor-suhorukov 093ca0a687 Use EnumMap whenever possible
Replace regular Map instances with EnumMap to reduce memory consumption.

Closes gh-11760
2018-01-24 16:24:47 -08:00
Phillip Webb ab6ad6aa4b Polish 2018-01-24 16:09:14 -08:00
Stephane Nicoll 960989cfe6 Polish "Add support for anonymousReadOnly in LdapProperties"
Closes gh-11744
2018-01-24 10:21:33 +01:00
Stephane Nicoll af0bdc893b Add support for anonymousReadOnly in LdapProperties
See gh-11744
2018-01-24 09:59:03 +01:00
Eddú Meléndez 633aefa844 Move tests to use ApplicationContextRunner 2018-01-24 09:58:35 +01:00
Brian Clozel 145d46e093 Polish 2018-01-23 15:52:44 +01:00
Brian Clozel be7c0a15f7 Move reactive ErrorAttributes into spring-boot
Closes gh-11714
2018-01-23 11:55:34 +01:00
andrey.onufreyko b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
2018-01-22 16:35:06 -08:00
dreis2211 5f66c09844 Narrow scope of some variables
Closes gh-11743
2018-01-22 16:01:02 -08:00
Stephane Nicoll 126f8783a2 Polish 2018-01-20 11:07:07 +01: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 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
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 f3379668ac Polish 2018-01-18 23:21:51 -08: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
Stephane Nicoll 40c537daa0 Polish 2018-01-18 10:20:48 +01: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
Johnny Lim d27b46cf73 Fix a wrong import for SocketChannel
Closes gh-11648
2018-01-17 13:49:57 +01: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
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
Brian Clozel 22c22a1ced Move server.session.* to server.servlet.session.*
Closes gh-11589
2018-01-15 17:50:32 +01:00
Andy Wilkinson 23d8d608c4 Polish 2018-01-15 13:35:46 +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
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
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
Stephane Nicoll 4a9123d6e3 Detect user-defined RedisCacheConfiguration
This commits improves the cache auto-configuration for Redis by looking
up a custom "RedisCacheConfiguration" bean that allows to take full
control over the `RedisCacheManager`.

Closes gh-11599
2018-01-11 11:52:08 +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
Stephane Nicoll b2eae0006d Polish "Make GsonAutoConfiguration align with JacksonAutoConfiguration"
Closes gh-11591
2018-01-11 10:36:58 +01:00
Johnny Lim 50518514b0 Make GsonAutoConfiguration align with JacksonAutoConfiguration
See gh-11591
2018-01-11 10:16:35 +01: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
Stephane Nicoll df647605af Merge branch '1.5.x' 2018-01-09 13:28:08 +01: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 286a3bb10a Polish GSON customization support
Closes gh-11498
2018-01-08 23:13:46 -08:00
ioann ba552f1d24 Allow GSON customization via properties or beans
Update GSON support to allow customization with either properties or
customize beans.

See gh-11498
2018-01-08 22:37:55 -08: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 fb614c64da Revert "Build against Spring Security 5.0.1 SNAPSHOT"
This reverts commit 2c52b9e87a
since the SNAPSHOT BOM doesn't appear to be published.

See gh-11573
2018-01-08 18:09:07 -08:00
Phillip Webb 2d76aad03e Further refine test containers 2018-01-08 17:24:42 -08:00
Phillip Webb 201da97774 Further refine test containers 2018-01-08 16:32:39 -08:00
Phillip Webb 2c52b9e87a Build against Spring Security 5.0.1 SNAPSHOT
See gh-11573
2018-01-08 15:19:06 -08:00
Phillip Webb 19ce0aa4f0 Refine BackgroundPreinitializer
Update `BackgroundPreinitializer` to start initialization earlier. Also
refine the startup order and initialize Charsets.

Fixes gh-11570
See gh-11412
2018-01-08 15:19:06 -08:00
Phillip Webb 25609c060e Polish 2018-01-08 15:19:06 -08:00
Madhura Bhave 9a6c339243 Use TestContainers util from spring-boot-test-support
See gh-10516
2018-01-08 14:05:15 -08:00
Andy Wilkinson 996b3ef7f2 Refine test containers 2018-01-08 14:05:05 -08:00
Andy Wilkinson 12e1fcbfab Do not pass null credential from ConnectionString to Mongo builder 2018-01-08 15:21:14 +00:00
Andy Wilkinson c7f5f0735d Stop reusing the Cluster when waiting for Cassandra to start
See gh-10516
2018-01-08 14:13:21 +00:00
Andy Wilkinson 927003e0b7 Polish 2018-01-08 13:59:14 +00:00
Stephane Nicoll b98c7ed9f8 Add InvalidConfigurationPropertyValueException
This commit adds a new exception type that denotes the value of a
configuration key is invalid, alongside a FailureAnalyzer that reports
a human-readable report when such exception is thrown on startup.

ResourceNotFoundException being a (useless) specialization of this new
exception, its usage has been refactored to use the more general
exception type.

Closes gh-10794
2018-01-08 14:24:57 +01:00
Stephane Nicoll b7f60c2ded Configure NettyStreamFactoryFactory by default if available
Closes gh-11526
Closes gh-10961
2018-01-08 10:46:51 +01:00
Stephane Nicoll 06572b0101 Polish 2018-01-08 10:10:50 +01:00
Brian Clozel 2bf15f814e Polish
This commit fixes the `responseCommitted` test in
`DefaultErrorWebExceptionHandlerIntegrationTests` and reworks the whole
test class to use the `ContextRunner` infrastructure.

Fixes gh-11519
2018-01-05 18:55:13 +01:00
Stephane Nicoll c4db22007c Polish "Add support for additional Kafka listener properties"
Closes gh-11502
2018-01-05 14:35:04 +01:00
Gary Russell 6fcbf80b31 Add support for additional Kafka listener properties
See gh-11502
2018-01-05 14:11:34 +01:00
Andy Wilkinson 94d5836618 Merge branch '1.5.x' 2018-01-05 12:02:11 +00:00
Stephane Nicoll 59d5ed5842 Add support for advanced customization of Hibernate settings
As HibernateJpaConfiguration is package private, it is no longer
possible to extend the default Spring Boot configuration to apply
advanced settings. The most notable use case for this is the
customization of Hibernate properties using instance value vs. string
value that can be set using the "spring.jpa.properties" namespace.

This commit adds a HibernatePropertiesCustomizer callback interface that
can be implemented to tune Hibernate properties at will.

Closes gh-11211
2018-01-05 12:19:22 +01:00
Stephane Nicoll 641013787d Polish 2018-01-05 11:40:26 +01:00
Stephane Nicoll ac004eabf3 Update copyright header
See gh-11510
2018-01-05 10:30:43 +01:00
Johnny Lim 37d8eedae3 Polish
Closes gh-11510
2018-01-05 10:29:22 +01:00
Madhura Bhave e28915bd4b Make integration tests self-contained
Fixes gh-10516
2018-01-04 11:26:40 -08:00
Phillip Webb bee5fa7fc6 Polish 2018-01-03 13:24:04 -08:00
Phillip Webb 37fe7bc8f6 Update validator background initializer
Update the validator background initializer to actually create
the validator.

Closes gh-11412
2018-01-03 13:19:31 -08:00
Madhura Bhave 716543828a Refactor some tests to use ApplicationContextRunner 2018-01-03 11:07:19 -08:00
Johnny Lim 24b5a78e39 Polish
Closes gh-11448
2017-12-30 17:21:13 +01:00
Madhura Bhave a46d1416ee Reinstate required parameter 2017-12-29 13:16:26 -08:00
Madhura Bhave 8102dc78cb Remove redundant throws declarations 2017-12-29 12:10:13 -08:00
Stephane Nicoll cfa3cab988 Polish "Improve Spring Data Web configuration properties"
Closes gh-11403
2017-12-28 15:22:47 +01:00
Marcel Overdijk be93eabc6b Improve Spring Data Web configuration properties
See gh-11403
2017-12-28 15:04:23 +01:00
Stephane Nicoll c709ff8e3b Polish "Apply customize() to createCredentialNetworkMongoClient()"
Closes gh-11376
2017-12-28 12:39:54 +01:00
Johnny Lim 90369996a9 Apply customize() to createCredentialNetworkMongoClient()
See gh-11376
2017-12-28 12:39:06 +01:00
Stephane Nicoll f57ff3a777 Merge branch '1.5.x' 2017-12-27 17:15:01 +01:00
Johnny Lim 3c5ccb1166 Polish
Closes gh-11418
2017-12-26 09:47:10 +01:00
Johnny Lim 4cc598ac5e Replace contains() with indexOf()
Closes gh-11373
2017-12-23 14:00:27 +01:00
Johnny Lim e4f0ad2165 Polish
Closes gh-11372
2017-12-23 13:11:53 +01:00
dreis2211 a434e5cc5f Fix JsonbHttpMessageConvertersConfiguration javadoc
Closes gh-11368
2017-12-23 12:54:50 +01:00
Phillip Webb 1ea921bfdd Migrate to OAuth2Client to use PropertyMapper
See gh-9018
2017-12-22 09:55:21 -08:00
Phillip Webb ba86b68484 Polish 2017-12-22 09:48:30 -08:00
Phillip Webb 6eabe8235c Add optional javax.money dependency
Add an optional dependency to `javax.money` to Eclipse errors in
`WebConversionService`.

See gh-5523
See gh-11402
2017-12-22 09:48:29 -08:00
Christoph Dreis 1a7fd6c359 Fix typo
Closes gh-11388
2017-12-22 18:12:06 +01:00
Brian Clozel 2fa0539e7f Support date conversion format for java.time types
Prior to this change, the Spring MVC auto-configuration would add a new
formatter to convert `java.util.Date` to/from `String` using the
configured configuration property `spring.mvc.date-format`.

This commit adds a new `WebConversionService` class that registers
date formatters with a custom date format, or register the default ones
if no custom configuration is provided.
This avoids duplicating equivalent formatters in the registry.

With this change, date types from `java.util`, `org.joda.time` and
`java.time` are now all supported.

This commit also replicates this feature for WebFlux applications by
adding a new `spring.webflux.date-format` configuration property.

Closes gh-5523
Closes gh-11402
2017-12-22 16:07:33 +01:00
Madhura Bhave ec26488ff1 Allow encoding default password in reactive user details
See gh-10963
2017-12-20 10:29:20 -08:00
Madhura Bhave 1b93f84912 Allow encoded password for default user
If raw password is provided, add {noop} prefix.
If prefix is present or PasswordEncoder bean is provided,
use the password as is.

Closes gh-10963
2017-12-18 14:34:02 -08:00
Phillip Webb 5e9cfea5a8 Migrate to auto-configurations to PropertyMapper
Update auto-configuration classes that have extensive property mapping
code to make use of the new `PropertyMapper` utility.

Fixes gh-9018
2017-12-15 18:32:07 -08:00
Phillip Webb befdbaaaa9 Polish 2017-12-15 14:57:25 -08:00
Stephane Nicoll 7566a197b0 Fix type for spring.data.cassandra.contact-points
Closes gh-11354
2017-12-15 10:13:40 +01:00
Stephane Nicoll dddf2c0013 Polish "Expose default RabbitMQ credentials in the metadata"
Closes gh-6863
2017-12-14 15:41:15 +01:00
Zoltan Altfatter 878a2e1a49 Expose default RabbitMQ credentials in the metadata
See gh-6863
2017-12-14 15:41:08 +01:00
Stephane Nicoll 0e20ed1d68 Merge branch '1.5.x' 2017-12-14 11:01:22 +01:00
Stephane Nicoll 797ad13bfa Merge branch '1.5.x' 2017-12-14 09:35:50 +01:00
Phillip Webb 3273859fde Polish 2017-12-13 14:32:55 -08:00
Stephane Nicoll a626f5462d Consistent use of @AliasFor
Closes gh-10836
2017-12-13 14:42:16 +01:00
Stephane Nicoll 47c8b5731a polish 2017-12-13 14:41:39 +01:00
dreis2211 a93a4e8715 Use String.equalsIgnoreCase() where possible
Closes gh-11330
2017-12-13 09:02:45 +01:00
Thiago Hirata f3055f2685 UserNameAttribute for custom OAuth2 provider
The UserNameAttribute field for a custom OAuth2 provider was
ignored when building the ClientRegistration.

Closes gh-10672
2017-12-12 12:40:33 -08:00
Stephane Nicoll 23218add90 Polish 2017-12-12 11:57:30 +01:00
Stephane Nicoll 68c8f7bae6 Add support for useRelativeRedirects customization
Closes gh-10597
2017-12-12 10:32:58 +01:00
Stephane Nicoll 6a4a0e3f29 Polish "Make RabbitTemplate exchange and routingKey configurable"
Closes gh-10978
2017-12-12 09:09:08 +01:00
Arlo O'Keeffe 4e31d2041a Make RabbitTemplate exchange and routingKey configurable
See gh-10978
2017-12-12 08:52:48 +01:00
Stephane Nicoll 408368a1f9 Polish "Allow graceful shutdown of Atomikos"
Closes gh-11237
2017-12-12 08:30:24 +01:00
nklmish 46d94aba4f Allow graceful shutdown of Atomikos
See gh-11237
2017-12-12 08:18:42 +01:00
Stephane Nicoll 2da6675c42 Polish
See gh-10963
2017-12-12 08:16:00 +01:00
Madhura Bhave 47ed096981 Make default username and password configurable
Closes gh-10963
2017-12-11 15:15:47 -08:00
Stephane Nicoll 5ef9364085 Polish 2017-12-11 17:55:12 +01:00
Johnny Lim 96250743b5 Add missing "abstract" keywords
Closes gh-11303
2017-12-09 15:29:15 -08:00
Madhura Bhave 954cf72de4 Fix javadoc 2017-12-08 15:32:40 -08:00
Johnny Lim 6d54072e04 Remove "final" keywords
Closes gh-11294
2017-12-08 11:13:07 -08:00
Andy Wilkinson c0e3ae9042 Polish 2017-12-07 18:27:52 +00:00
Andy Wilkinson 996a7cf013 Upgrade to Flyway 5.0.0
Closes gh-11287
2017-12-07 18:21:55 +00:00
Johnny Lim 2c204f2154 Polish
Closes gh-11242
2017-12-02 09:03:59 +01:00
Stephane Nicoll 5dc28ec446 Merge branch '1.5.x' 2017-11-30 18:01:36 +01:00
Phillip Webb d7251f52a4 Polish 2017-11-29 09:09:53 -08:00
Andy Wilkinson 80543250a2 Rework properties for enabling Spring Data repositories
Rather than using two properties to enable or disable reactive and
imperative repositories for a particular store, this commit introduces
a new repository type condition that's backed by a single
spring.data.<store>.repositories.type property. The type can be
auto (automatically enables whatever's available), imperative (enables
imperative repositories), none (enables nothing), or reactive (enables
reactive repositories). The default is auto.

Repositories do not have a reactive option (such as JPA) continue to
have a spring.data.<store>.repositories.enabled property that takes a
boolean value.

Closes gh-11134
2017-11-29 13:02:45 +00:00
Brian Clozel 8b98db401c Polish
Closes gh-11090
2017-11-29 12:00:00 +01:00
Brian Clozel de208cd372 Do not handle WebFlux errors if response is committed
If the WebFlux handler commits the response but still sends an error
signal in the reactive pipeline, Spring Boot error handling should not
try to handle that error: once committed, it is impossible to change the
response status or the response headers. Writing to the body might also
lead to invalid responses.

This commit skips error handling if the response is committed and
delegates to Spring Framework's `HttpWebHandlerAdapter` which will log
the error.

Fixes gh-11168
2017-11-29 11:45:12 +01:00
Brian Clozel e3c3bb0076 Rename spring.cache.control to spring.cache.cachecontrol
Closes #11090
2017-11-29 11:14:31 +01:00
Johnny Lim 952224ef56 Polish
Closes gh-11193
2017-11-29 10:50:42 +01:00
Stephane Nicoll 33bd7ccc91 Merge branch '1.5.x' 2017-11-29 10:47:52 +01:00
Brian Clozel ee62633e33 Auto-Configure Freemarker in WebFlux
This commit adds support for basic auto-configuration for the Freemarker
template engine in WebFlux.

A few configuration properties in the `spring.freemarker.*` namespace
aren't supported yet, since they mostly apply to MVC (Servlet request
and session attributes).

Closes gh-10094
2017-11-29 10:37:39 +01:00
Phillip Webb 960083bd33 Polish 2017-11-28 16:21:09 -08:00
Craig Walls 64d02f8bb5 Remove Spring Social starters and auto-configuration
See gh-11117
2017-11-28 14:53:36 +00:00
Andy Wilkinson 22a426fe39 Polish 2017-11-28 10:50:28 +00:00
Andy Wilkinson ecdbc52fc5 Make log4j-core available to Elasticsearch tests
Elasticsearch server requires log4j-core but we don't want the entire
module to have a test dependency on log4j-core as it already uses
Logback. This commit uses the modified class path runner to make
log4j-core available specifically to the Elasticsearch-related tests.

See gh-11166
2017-11-27 13:36:06 +00:00
Stephane Nicoll 89054d32fa Polish "Fix CouchbaseReactiveRepositoriesAutoConfigurationTests"
Closes gh-11151
2017-11-27 10:59:21 +01:00
Eddú Meléndez ef3d44f680 Fix CouchbaseReactiveRepositoriesAutoConfigurationTests
See gh-11151
2017-11-27 10:56:35 +01:00
Stephane Nicoll 9543327406 Polish "Use BeanIds.SPRING_SECURITY_FILTER_CHAIN"
Closes gh-11162
2017-11-27 10:32:28 +01:00
Johnny Lim 70d92037bd Use BeanIds.SPRING_SECURITY_FILTER_CHAIN
See gh-11162
2017-11-27 10:31:32 +01:00
Johnny Lim d9828a0aaa Polish
See gh-11143
2017-11-27 10:14:18 +01:00
Johnny Lim dea95b2b67 Make CouchbaseReactiveRepositoriesAutoConfigureRegistrar package-private
Closes gh-11142
2017-11-26 11:30:17 +01:00
Johnny Lim 7d94695936 Harmonize CouchbaseReactiveRepositoriesAutoConfiguration conditions
Closes gh-11138
2017-11-24 16:51:29 +01:00
Andy Wilkinson 16b090c9bc Polish 2017-11-24 15:46:19 +00:00
Andy Wilkinson 7674841946 Log condition evaluation delta upon DevTools restart 2017-11-24 14:49:53 +00:00
Andy Wilkinson b3c5a050ad Polish message for matching beans produced by OnBeanCondition 2017-11-24 12:01:20 +00:00
Andy Wilkinson 51b56782a3 Apply customizers to build when created embedded Mongo client
Closes gh-11132
2017-11-24 10:59:29 +00:00
Stephane Nicoll 5ebed451e0 Remove dead code 2017-11-23 17:55:58 +01:00
Johnny Lim 01a48412d2 Polish
Closes gh-11126
2017-11-23 16:00:55 +00:00
Stephane Nicoll 0a5f064d39 Improve error metadata for Autoconfigure module 2017-11-23 16:11:48 +01:00
Stephane Nicoll 877ed041e7 Polish 2017-11-23 13:38:11 +01:00
Stephane Nicoll 13ccf45008 Polish
See gh-10884
2017-11-23 13:28:44 +01:00
Andy Wilkinson f12de333f5 Merge branch '1.5.x' 2017-11-23 11:46:42 +00:00
Andy Wilkinson 69fb433eb7 Merge branch '1.5.x' 2017-11-23 11:35:12 +00:00
Stephane Nicoll 59df2909b8 Format 2017-11-23 10:16:32 +01:00
Stephane Nicoll cc2d882d08 Polish
See gh-11090
2017-11-23 10:14:24 +01:00
Phillip Webb 93ae71cf93 Switch Jackson write-dates-as-timestamps default
Update `JacksonAutoConfiguration` so that `write-dates-as-timestamps`
now defaults to `false`.

Fixes gh-11079
2017-11-22 22:02:17 -08:00
Phillip Webb d99625fa78 Rename properties that have `-` in their prefix
Rename `reactive-repositories` to `reactiverepositories` and replace
`spring.resources.cache-control` with `spring.resources.cache.control`.

Fixes gh-11090
2017-11-22 16:48:21 -08:00
Andy Wilkinson 4bf1640198 Allow beans to be used as Hibernate naming strategies
Previously, custom Hibernate naming strategies could only be
configured via properties. This allowed a fully-qualified classname to
be specified, but did not allow a naming strategy instance to be used.

This commit updates HibernateJpaConfiguration to use
ImplicitNamingStrategy and PhysicalNamingStrategy beans if they
exist. If both a bean exists and the equivalent property has been set,
the bean wins.
2017-11-22 17:29:13 +00:00
Johnny Lim 858d325577 Fix getter and setter for sMaxAge 2017-11-22 23:21:18 +09:00
Andy Wilkinson 2b1d1cd317 Polish "Auto-configure templated welcome page"
Closes gh-10545
2017-11-21 15:21:57 +00:00
Bruce Brouwer cc855f4462 Auto-configure templated welcome page
See gh-10545
2017-11-21 15:21:48 +00:00
Andy Wilkinson 08c85c1fba Separate welcome page handler mapping and its tests from auto-config
Closes gh-11094
2017-11-21 14:44:29 +00:00
Andy Wilkinson ff3d7c2ca1 Polish 2017-11-21 12:23:16 +00:00
Phillip Webb 4d5de829cb Fix checkstyle error 2017-11-20 19:58:31 -08:00
Phillip Webb e82913dd5a Align appendix edits with source code
Port editing changes from append to java source files to ensure that
IDE meta-data also reflects the improvements.

Closes gh-10870
2017-11-20 15:47:49 -08:00
Phillip Webb e01c92a38a Polish 2017-11-20 12:44:39 -08:00
Phillip Webb 64c5e8b6ed Rename @DurationUnit -> @DefaultDurationUnit
Rename `@DurationUnit` to `@DefaultDurationUnit` to make it clearer
that it only changes the unit if one isn't specified by the user.

Closes gh-11078
2017-11-20 12:18:14 -08:00
Phillip Webb 6f3ca459ea Align MongoReactiveSessionConfiguration conditions
Align `MongoReactiveSessionConfiguration` `@ConditionalOnClass` with
`MongoSessionConfiguration`

See gh-11063
2017-11-20 12:07:03 -08:00
Andy Wilkinson 8a3502bdde Polish "Improve Spring Session auto-configuration tests"
See gh-11063
2017-11-20 17:13:35 +00:00
Vedran Pavic d8e3960631 Improve Spring Session auto-configuration tests
Closes gh-11063
2017-11-20 17:13:35 +00:00
Brian Clozel b7753a1f29 Polish 2017-11-20 17:38:49 +01:00
tinexw e2bc90b6bb Add CacheControl config keys in spring.resources.*
This commit adds several configuration keys for customizing the
"Cache-Control" HTTP response header when serving static resources.

New keys are located in the "spring.resources.cache-control.*"
namespace; anything configured there will prevail on existing
"spring.resources.cache-period=" values, so as to mirror Spring MVC's
behavior.

Fixes gh-9432
2017-11-20 17:36:21 +01:00
Vedran Pavic b6d9ae7efa Align Session auto-config with Redis namespace config support
See gh-11084
2017-11-20 11:16:34 +01:00
Phillip Webb 8f4bf233b4 Update configuration properties to use Duration
Update appropriate configuration properties to use the `Duration`
type, rather than an ad-hoc mix of milliseconds or seconds.

Configuration properties can now be defined in a consistent and readable
way. For example `server.session.timeout=5m`.

Properties that were previously declared using seconds are annotated
with `@DurationUnit` to ensure a smooth upgrade experience. For example
`server.session.timeout=20` continues to mean 20 seconds.

Fixes gh-11080
2017-11-19 21:52:57 -08:00
Stephane Nicoll 303b812363 Properly document default for useNewIdGeneratorMappings
Closes gh-11064
2017-11-19 13:14:12 +01:00
Phillip Webb e147982045 Add FilteredClassLoader
Add `FilteredClassLoader` to replace `HideClassesClassLoader` and
`HidePackagesClassLoader`.

Fixes gh-10303
2017-11-18 23:20:00 -08:00
Phillip Webb 2f6aca222e Fix checkstyle violation
Fix public constructor accidentally added in commit 72862b565c.

See gh-10387
2017-11-18 20:43:59 -08:00
Phillip Webb 72862b565c Polish location check with vendor placeholder
Closes gh-10387
2017-11-18 20:29:43 -08:00
Eddú Meléndez 1ee47cec31 Support location check with vendor placeholder
Update location check logic triggered if `flyway.check-location=true`
to resolve any vendor placeholders in `flyway.locations`.

See gh-10387
2017-11-18 20:28:52 -08:00
Phillip Webb 4c29c35cbb Polish Kafka transaction support property
Closes gh-11076
2017-11-18 10:20:07 -08:00
nklmish 6d396b973f Add Kafka transaction support property
Add `spring.kafka.producer.transaction-id-prefix` property that will be
passed to `DefaultKafkaProducerFactory.setTransactionIdPrefix(...)`

See gh-11076
2017-11-18 10:15:39 -08:00
Johnny Lim 73c65286ea Polish 2017-11-18 10:07:30 -08:00
Stephane Nicoll c4070e093c Polish 2017-11-18 09:05:28 +01:00
Johnny Lim 1783a072ad Remove explicit constructor super() calls
Closes gh-11068
2017-11-17 16:44:16 -08:00
Phillip Webb a6cefc5ba0 Polish 2017-11-17 14:18:31 -08:00
Madhura Bhave 551c08ebfe Update conditions for OAuth security config
Closes gh-11070
2017-11-17 12:43:48 -08:00
Madhura Bhave d1766509f1 Rename clientReg redirectUri to redirectUriTemplate
To keep it consistent with changes made in Spring Security

Closes gh-11038
2017-11-17 10:16:38 -08:00
Vedran Pavic 44eebcaff5 Fix `SessionAutoConfiguration` ordering
This commit updates `SessionAutoConfiguration` to ensure it is processed
after `MongoDataAutoConfiguration` and
`MongoReactiveDataAutoConfiguration`, instead of `MongoAutoConfiguration`
and `MongoReactiveAutoConfiguration`. This is required in order for
MongoDB Session auto-configuration to work, since
`MongoSessionConfiguration` and `MongoReactiveSessionConfiguration` are
conditional on `MongoOperations` and `ReactiveMongoOperations` beans,
respectively.

Closes gh-11054
2017-11-17 10:02:52 +01:00
Johnny Lim e8563c54dd Polish
Closes gh-11050
2017-11-17 09:56:16 +01:00
Stephane Nicoll 5728d9614e Use a List rather than an array for consistency
Closes gh-11029
2017-11-17 09:14:45 +01:00
Stephane Nicoll a0374c0c31 Polish "Add 'enableSpringElCompiler' to ThymeleafProperties"
Closes gh-10869
2017-11-16 15:56:52 +01:00
Kazuki Shimizu cf350cf85b Add 'enableSpringElCompiler' to ThymeleafProperties
See gh-10869
2017-11-16 15:46:01 +01:00
Johnny Lim cbb483735d Polish
Closes gh-10948
2017-11-16 10:36:20 +01:00
dreis2211 1e4941e29a Use StandardCharsets where possible
Closes gh-11036
2017-11-16 10:34:44 +01:00
Phillip Webb 3035df59cc Use a String[] so sential nodes are trimmed
Update `RedisProperties` to use an actual String[] for sentinal nodes
rather than a simple String. This allows us to lean on the updated
binder to automatically trim the elements.

Fixes gh-11029
2017-11-15 16:19:59 -08:00
Phillip Webb f647f5689f Polish 2017-11-15 12:47:47 -08:00
Stephane Nicoll bbdff1a5bf Polish "Add support for reactive Spring Data Couchbase"
Closes gh-10812
2017-11-14 17:49:02 +01:00
Alex Derkach 568cd6472b Add support for reactive Spring Data Couchbase
See gh-10812
2017-11-14 16:55:03 +01:00
Stephane Nicoll 1830dcf103 Rename AutoConfigurationReportEndpoint to ConditionsEndpoint
This commit further aligns the change to ConditionEvaluationReport by
renaming the 'autoconfig' endpoint to 'conditions'.

Closes gh-2945
2017-11-14 15:25:07 +01:00
Andy Wilkinson 07462be090 Polish 2017-11-11 16:29:12 +00:00
Stephane Nicoll dac7d9c174 Rename AutoConfigurationReportLoggingInitializer to ConditionEvaluationReportLoggingListener
Closes gh-2945
2017-11-10 16:20:13 +01:00
Stephane Nicoll 26158c1ee2 Add default order for JobLauncherCommandLineRunner
Closes gh-2943
2017-11-10 16:06:39 +01:00
Stephane Nicoll 46ef178f04 Polish "Improve cache auto-configuration for Redis"
Closes gh-10944
2017-11-10 14:42:50 +01:00
Ryon a4ed406ee8 Improve cache auto-configuration for Redis
Expose key prefix, TTL and null value settings for spring-data-redis'
RedisCacheConfiguration in Spring .properties/yml configuration files.

Example:

spring.cache.redis.ttl=PT15M
spring.cache.redis.keyPrefix=foo
spring.cache.redis.useKeyPrefix=false
spring.cache.redis.cacheNullValues=false

See gh-10795
2017-11-10 11:30:46 +01:00
Johnny Lim bd0dcfb172 Utilize StandardCharsets
Closes gh-10972
2017-11-10 09:49:13 +01:00
Andy Wilkinson f4570710c1 Make Tomcat auto-config back off when UpgradeProtocol is absent
Closes gh-10960
2017-11-09 14:42:14 +00:00
dreis2211 93b1ebb7fa Use Integer::compare in AutoConfigurationSorter
Closes gh-10959
2017-11-09 09:50:38 +01:00
Phillip Webb 1e7d85a632 Polish 2017-11-06 10:11:50 -08:00
Andy Wilkinson 60afbdc868 Polish 2017-11-06 11:44:53 +00:00
Johnny Lim c05a299520 Polish
Closes gh-10921
2017-11-06 12:28:43 +01:00
Phillip Webb fa191d8c73 Align ReactiveWebApplicationContext with framework
Refactor `ReactiveWebApplicationContext` implementations to align closer
with the `WebApplicationContext` implementations defined in
Spring Framework.

The following classes are now provided:

  - `AnnotationConfigReactiveWebApplicationContext` -- A refreshable
    reactive web context with support for `@Configuration` classes.

  - `GenericReactiveWebApplicationContext` -- A non-refreshable reactive
    GenericApplicationContext.

  - `ReactiveWebServerApplicationContext` --  A non-refreshable reactive
    GenericApplicationContext with support for server discovery.

  - `AnnotationConfigReactiveWebServerApplicationContext` -- A
    non-refreshable reactive `GenericApplicationContext` with support
    for `@Configuration` classes and server discovery.

These classes roughly align to the following Servlet equivalents:

  - `AnnotationConfigWebApplicationContext` (Spring Framework)
  - `GenericWebApplicationContext` (Spring Framework)
  - `ServletWebServerApplicationContext` (Spring Boot)
  - `AnnotationConfigServletWebServerApplicationContext` (Spring Boot)

An additional `ConfigurableReactiveWebEnvironment` interface as also
been introduced, primarily for `@ConditionalOnWebApplication` to use.

Fixes gh-10852
2017-11-03 19:07:23 -07:00
Phillip Webb b6166dc12a Move `Assume` to spring-boot-test-support
Fixes gh-10866
2017-11-03 19:07:23 -07:00
Phillip Webb 427d262297 Polish 2017-11-03 19:07:23 -07:00
Brian Clozel fa0926b178 Error handling for WebFlux should log HTTP 5xx errors
This commit ensures that all errors handled by the
`DefaultErrorWebExceptionHandler` (Spring WebFlux error convetion
support) logs an error with request information and exception
stacktrace.

This is limited to errors that result in an HTTP 5xx error.
Exceptions that extend `ResponseStatusException` and set a non-5xx
status will not be logged.

Closes gh-10904
2017-11-03 16:40:59 +01:00
Brian Clozel 58db841c8f Add Http2 configuration properties
This commit adds a new configuration properties class for configuring
HTTP/2 protocol support.
By default, this protocol is disabled as enabling it requires several
manual changes:

* configuring a web server for proper TLS and ALPN support
* configuring a proper SSL certificate

See gh-10043
2017-11-03 13:56:06 +01:00
Phillip Webb f440fc6d25 Formatting 2017-11-02 15:04:39 -07:00
Andy Wilkinson 76df3fc496 Use explicit classpath: prefix for Flyway location
Flyway implicitly adds classpath: to locations without a prefix but
resource loader fails to find migratons on the classpath without the
prefix.

Add an explicit classpath: prefix so that both Flyway and the resource
loader used to check the locations can find the migration location.

See gh-10807
2017-11-02 18:54:04 +00:00
Eddú Meléndez dcc6d8d6ff Align default of flyway.check-location with equivalent Liquibase prop
Closes gh-10807
2017-11-02 17:19:48 +00:00
Andy Wilkinson 2ae4678b1e Drop support for Spring Mobile
Closes gh-10884
2017-11-02 14:39:46 +00:00
Vedran Pavic 3d44ef0872 Add support for configuring Spring Session cleanup cron
This commit adds support for configuring cron expression used for
expired session cleanup job in Redis and JDBC session stores.

Closes gh-10818
2017-11-02 11:56:11 +01:00
Phillip Webb c55b5d7111 Polish 2017-11-01 23:14:52 -07:00
Phillip Webb 44d8e09aac Polish endpoint parameter name discovery
Move logic from `ParameterNameMapper` into `ReflectiveOperationInvoker`
in order to reduce the surface area of the public API.

Also rename some classes for consistency.
2017-11-01 23:14:52 -07:00
Madhura Bhave 905e311ef2 Update javadoc 2017-11-01 18:20:14 -07:00
Madhura Bhave b2efef2eed Detect `springSecurityFilterChain` using name 2017-11-01 17:39:58 -07:00
Madhura Bhave 083cf50685 Change condition for adding @EnableWebSecurity
Instead of looking for the presence of `WebSecurityConfiguration`,
this commit checks for the presence of a `Filter` with the name
springSecurityFilterChain. This allows users to configure the Filter
without adding `WebSecurityConfiguration`, making it more flexible.
`springSecurityFilterChain` is somewhat of a contract in Spring Security
and it relies on the name being `springSecurityFilterChain`.

Closes gh-10849
2017-11-01 16:43:49 -07:00
Stephane Nicoll 74677629ff Remove handling of spring.git.properties
Closes gh-10857
2017-11-01 09:13:32 +01:00
Madhura Bhave 1e9fca0b76 Register a bean for OAuth2AuthorizedClientService
Closes gh-10837
2017-10-31 11:20:38 -07:00
Andy Wilkinson 93a67e6b4a Polish 2017-10-30 23:11:18 +00:00
Andy Wilkinson f59fbe6f81 Update test to align with media type change in HATEOAS 0.24
See gh-10828
2017-10-30 17:01:25 +00:00
Andy Wilkinson 5df473a651 Add env-based configuration of TTL of Tomcat's static resource cache
Closes gh-9670
2017-10-30 16:05:43 +00:00
Stephane Nicoll 654cee5a94 Polish 2017-10-30 16:26:04 +01:00
Stephane Nicoll 822ca00001 Merge branch '1.5.x' 2017-10-30 16:24:41 +01:00
Andy Wilkinson a276356328 Add auto-configuration for Spring Session's reactive support
Closes gh-9850
2017-10-30 15:19:41 +00:00
Andy Wilkinson bdab4aa97e Auto-configuration of reactive Spring Session 2017-10-30 15:19:41 +00:00
Andy Wilkinson 5aa66305a8 Log warning when open-in-view is implicitly enabled for JPA or Neo4j
Closes gh-7107
2017-10-30 12:37:38 +00:00
Stephane Nicoll edefacf7ac Adapt to Spring Security change 2017-10-30 08:59:09 +01:00
Stephane Nicoll 5649e8c92a Polish 2017-10-29 16:53:33 +01:00
Stephane Nicoll e7cb0be6d8 Adapt to Spring Security change
This commit updates `WebFluxSecurityConfiguration` to look for a
`WebFilterChainProxy` rather than the default configuration that
`@EnableWebFluxSecurity` triggers. The latter is now package private.
2017-10-29 16:52:11 +01:00
Stephane Nicoll cba430818f Adapt to change in latest Spring Security snapshot 2017-10-28 08:02:39 +02:00
Stephane Nicoll a34ff67a1d Merge branch '1.5.x' 2017-10-28 07:58:45 +02:00
Stephane Nicoll caf4c4c6dd Make use of Batch's new API for accessing job parameters
Closes gh-10135
2017-10-27 14:53:25 +02:00
Andy Wilkinson 194e03c913 Polish mock verification and formatting
See gh-10773
2017-10-27 09:43:25 +01:00
Andy Wilkinson 37392c0ec8 Adapt to changed default login redirect URL in OAuth 2 Client support
See https://github.com/spring-projects/spring-security/issues/4687
See gh-10705
2017-10-27 09:19:57 +01:00
Stephane Nicoll dbb1e222ab Initialize only an embedded datasource by default
This commit renames spring.datasource.initialize to
spring.datasource.initialization-mode and use the
DataSourceInitializationMode enum. By default, only an embedded
datasource is initialized.

Closes gh-10773
2017-10-27 09:50:37 +02:00
Stephane Nicoll b720c2141c Rename DatabaseInitialization to DataSourceInitialization
Closes gh-10779
2017-10-26 16:26:08 +02:00
Stephane Nicoll 852ad093b2 Add support for @SendTo with kafka listener
This commit makes sure that the `replyTemplate` is set if a
KafkaTemplate is available in the context which effectively add support
for `@SendTo`.

Closes gh-10669
2017-10-25 18:04:08 +02:00
Stephane Nicoll 97c1365e24 Remove Http401AuthenticationEntryPoint
Closes gh-10715
2017-10-25 14:03:14 +02:00
Stephane Nicoll b23f68b0d5 Merge branch '1.5.x' 2017-10-25 13:59:54 +02:00
Vedran Pavic ac10fa31cd Upgrade to Hazelcast 3.9
Closes gh-10764
2017-10-25 08:56:35 +02:00
Madhura Bhave 182b6f0d29 Fix OAuth2 client tests as per upstream changes 2017-10-24 14:43:20 -07:00
Andy Wilkinson 66b55defa0 Adapt to password encoder changes in Spring Security
Closes gh-10762
2017-10-24 21:50:19 +01:00
Andy Wilkinson 2b426c30a6 Polish “Remove explicit type arguments”
Closes gh-10494
2017-10-24 14:44:26 +01:00
Johnny Lim 6168fae720 Remove explicit type arguments
See gh-10494
2017-10-24 14:44:20 +01:00
Andy Wilkinson a256602c7b Polish 2017-10-24 14:41:03 +01:00
Stephane Nicoll 2b69e3c6d5 Fix metadata of spring.mustache.suffix
Closes gh-10752
2017-10-23 19:46:18 +02:00
Andy Wilkinson 90ecb29667 Align with spring-security-jwt-jose being renamed to s-s-auth2-jose
Closes gh-10750
2017-10-23 15:58:37 +01:00
Madhura Bhave 64b9451e2f Fix OAuth2 client tests following upstream changes 2017-10-20 11:57:13 -07:00
Johnny Lim 44ae148ecd Polish
Closes gh-10700
2017-10-20 08:15:57 +02:00
Madhura Bhave 8600bd7294 Upgrade to Spring Security 5.0.0.BUILD-SNAPSHOT
Following some changes in the latest snapshot this includes:
- Some updates to oauth2 client auto-config
- Security auto-config no longer relies on GlobalAuthenticationConfigurerAdapter
- Remove reactive security starter

Closes gh-10704
2017-10-19 15:39:01 -07:00
Madhura Bhave eb446d07d9 Default provider to registration-id if not present
Closes gh-10671
2017-10-19 13:03:57 -07:00
Stephane Nicoll c2f649df54 Add support for JPA mapping resources
Closes gh-10684
2017-10-19 17:35:38 +02:00
Stephane Nicoll c4026806a6 Polish 2017-10-19 17:14:49 +02:00
Andy Wilkinson 688da652ac Polish 2017-10-17 15:41:55 +01:00
dreis2211 3b71393e0a Use Assert.state() with Supplier where possible
See gh-10658
2017-10-17 15:35:59 +02:00
Johnny Lim 5aa32b3d0f Polish
Closes gh-10636
2017-10-17 15:29:13 +02:00
Stephane Nicoll 22de4303c5 Polish "When pool autocommit is disabled, inform Hibernate"
Closes gh-9737
2017-10-17 11:39:44 +02:00
Craig Andrews d0e70e90de When pool autocommit is disabled, inform Hibernate
Starting with Hibernate 5.2.10, the JPA property
`hibernate.connection.provider_disables_autocommit` should be set to true
when the datasource has autocommit disabled in order to improve
performance.

See gh-9737
2017-10-17 09:19:47 +02:00
Brian Clozel 68db43cf44 Support error conventions in Spring WebFlux
This commit adds support for Spring Boot error conventions with WebFlux.
The Spring MVC support for that is based on an `Controller` that's
mapped on a specific `"/error"` path and configured as an error page in
the Servlet container. With WebFlux, this support leverages a
`WebExceptionHandler`, which catches exceptions flowing through the
reactive pipeline and handles them.

The `DefaultErrorWebExceptionHandler` supports the following:
* return a JSON error response to machine clients
* return error HTML views (templates, static or default HTML view)

One can customize the error information by contributing an
`ErrorAttributes` bean to the application context.

Spring Boot provides an `ErrorWebExceptionHandler` marker interface and a
base implementation that provides high level constructs to handle
errors, based on the Spring WebFlux functional flavor.
The error handling logic can be completely changed by providing a custom
`RouterFunction` there.

Fixes gh-8625
2017-10-16 21:55:05 +02:00
Andy Wilkinson 44acef2ae2 Merge branch '1.5.x' 2017-10-13 12:43:00 +01:00
Phillip Webb 748e0779b6 Update copyright year for changed files 2017-10-10 11:56:13 -07:00
Phillip Webb d62d829c19 Polish 2017-10-10 11:55:47 -07:00
Madhura Bhave a06ec4a877 Mongo Uri overrides host and port
Fixes gh-4017
2017-10-10 09:23:49 -07:00
Phillip Webb 8be7d3cab4 Polish 2017-10-08 08:08:07 -07:00
Stephane Nicoll a662b779b3 Fix build failure
Spring Session JDBC no longer providers a JdbcTemplate so our tests
need to make sure to include our own auto-configuration for it.
2017-10-07 09:45:12 +02:00
Madhura Bhave 0402223fd0 Replace CommonOAuth2Provider
Closes gh-10543
2017-10-06 11:58:24 -07:00
Madhura Bhave 3ced8412b5 Replace AuthorizationGrantType & ClientAuthenticationMethod
Closes gh-10506
2017-10-06 09:34:13 -07:00
Daniel Fernández e69a93bf47 Minor documentation improvements at ThymeleafProperties 2017-10-06 09:12:28 +02:00
Daniel Fernández 6a52a1a6a0 Added configuration test for spring.thymeleaf.reactive.max-chunk-size 2017-10-06 09:12:28 +02:00
Daniel Fernández 7de6472477 Added configuration parameters at ThymeleafProperties for "fullModeViewNames" and "chunkedModeViewNames" 2017-10-06 09:12:28 +02:00
Phillip Webb 526fc1f351 Fix imports following upstream change 2017-10-05 17:57:31 -07:00
Andy Wilkinson 2bb54f16fb Polish 2017-10-05 10:54:26 +01:00
Phillip Webb b87f9c11f1 Fix POMs for the updated build/release process
Fix POMs following project relocations and apply CI friendly Maven
conventions.

See gh-9316
2017-10-04 16:34:38 -07:00
Phillip Webb 0ba4830b4f Relocate projects to spring-boot-project
Move projects to better reflect the way that Spring Boot is released.

The following projects are under `spring-boot-project`:

  - `spring-boot`
  - `spring-boot-autoconfigure`
  - `spring-boot-tools`
  - `spring-boot-starters`
  - `spring-boot-actuator`
  - `spring-boot-actuator-autoconfigure`
  - `spring-boot-test`
  - `spring-boot-test-autoconfigure`
  - `spring-boot-devtools`
  - `spring-boot-cli`
  - `spring-boot-docs`

See gh-9316
2017-10-04 16:34:23 -07:00