2441 Commits

Author SHA1 Message Date
Andy Wilkinson
f60f3cb38e Exclude property beans from method validation
Exclude `@ConfigurationProperties` beans from method validation so
that `@Validated` can be used on final classes without the method
validation post-processor throwing an exception.

This commit introduces a `FilteredMethodValidationPostProcessor` class
which will use `MethodValidationExcludeFilters` to exclude beans from
method validation processing. Using `@EnableConfigurationProperties`
will automatically register an appropriate filter.

Closes gh-21454
2020-10-27 15:43:00 -07:00
Andy Wilkinson
1c4b4cb0cd Provide config properties for configuring WebFlux's locale resolution
Previously, the locale context resolver used with WebFlux could only be
configured by provided a custom LocaleContextResolver bean. By
constrast, when using Spring MVC, the spring.mvc.locale and
spring.mvc.locale-resolver properties could be used to configure the
locale and the resolver (fixed or Accept header) respectively.

This commit introduces spring.web.locale and spring.web.locale-resolver
properties and deprecates their spring.mvc equivalents. The new
properties can be used to configure locale resolution with either
Spring MVC or WebFlux.

Closes gh-23449
2020-10-27 11:12:00 +00:00
Phillip Webb
ef89eb6dfb Add @ConditionalOnDefaultWebSecurity annotation
Add a dedicate condition annotation to detect when Spring Security is
available but has not been configured by the user. The new annotation
helps simplify quite a few of our auto-configuration classes.

See gh-23421
2020-10-26 23:47:14 -07:00
Madhura Bhave
0818f27f44 Configure WebSecurity using WebSecurityCustomizer
Replace `WebSecurityConfigurer` and `WebSecurityConfigurerAdapter`
configurations with `WebSecurityCustomizer` or `SecurityFilterChain`
beans.

Closes gh-23421
2020-10-26 23:47:14 -07:00
Stephane Nicoll
e6c63b5b4e Polish
See gh-23914
2020-10-27 04:25:17 +01:00
Andy Wilkinson
fafc0a91e3 Register @WebListeners in a way that allows them to register components
Previously, @WebListeners were discovered via custom component scanning
and then registered programmatically via the ServletContext. The servlet
spec requires any ServletContextListener registered in this manner to be
prohibited from programatically configuring servlets, filters, and
listeners. This left us not strictly complying with the servlet spec
as a ServletContextListener registered via a @WebListener annotation
should be able to programatically configure other components.

This commit updates WebListenerHandler to register each @WebListener
component directly with Jetty, Tomcat, or Undertow rather than via the
ServletContext API. This ensure that any @WebListener-annoated
ServletContextListener registered via servlet component scanning is
able to programatically register servlets, filters, and listeners.

There is a small chance that this will be a breaking change for some
users:

1. The ServletListenerRegistrationBeans that were previously defined
   for each @WebListener will now be
   WebListenerHandler.WebListenerRegistrars
2. Each @WebListener-annotated class will now be instantiated by
   Jetty, Tomcat, or Undertow. Jetty and Tomcat both require the class
   to be public and have a public default constructor. Previously,
   a package-private class or default constructor could be used as the
   instantiation was performed by Spring Framework. Undertow is not
   affected as it can instantiate a package-private type.

Fixes gh-18303
2020-10-26 13:26:52 -07:00
Stephane Nicoll
9ab3abb728 Add support for SAML2 relying party registration's decryption credentials
Closes gh-23705
2020-10-26 15:43:35 +01:00
Andy Wilkinson
708c43a8d1 Upgrade to Flyway 7.0.4
Closes gh-23892
2020-10-26 13:38:58 +00:00
Stephane Nicoll
e0f123e676 Do not use servlet session timeout for reactive web applications
This commit fixes the auto-configuration of Spring Session to use
"server.servlet.session.timeout" as a fallback for Servlet-based web
applications only.

Closes gh-23752
2020-10-26 11:58:49 +01:00
Stephane Nicoll
cb31d9547c Merge branch '2.3.x' 2020-10-24 07:40:48 +02:00
Stephane Nicoll
d1e503602b Polish 2020-10-24 07:39:50 +02:00
Brian Clozel
5fceb9d5b7 Change favicon StaticResourceLocation
Prior to this commit, the `StaticResourceLocation` for favicons would
point to `"/**/favicon.ico"`. This location does not reflect the current
web development landscape, since the png format and size variants are
not supported here. Also, the `"**"` pattern can be costly at runtime
and is deprecated by the new path pattern support in Spring Framework
(see gh-22833).

This commit changes the default locations to `"/favicon.*","/*/icon-*"`,
supporting common use cases such as `"/favicon.ico"`, `"/favicon.png"`
and `"/icons/icon-48x48.png"`.

Closes gh-23126
2020-10-23 12:03:32 +02:00
Stephane Nicoll
d0975d659f Polish "Remove RabbitMQ AutoConfig Boolean Coercion"
See gh-23799
2020-10-23 08:35:17 +02:00
Gary Russell
32ce453997 Remove RabbitMQ AutoConfig Boolean Coercion
See gh-23799
2020-10-23 08:32:41 +02:00
Andy Wilkinson
2d8528d5bd Adapt to deprecation of StringUtils.isEmpty(Object)
See gh-23774
2020-10-22 17:09:33 +01:00
Stephane Nicoll
17e12ea025 Polish "Add configuration options for RabbitMQ's batch listener config"
See gh-23766
2020-10-21 08:50:03 +02:00
Gary Russell
3aa247f1ca Add configuration options for RabbitMQ's batch listener config
See gh-23766
2020-10-21 08:50:03 +02:00
Stephane Nicoll
e77dc60744 Add configuration properties for SAML2 relying party registration's ASM
This commit allows to configure the location and binding of the
Assertion Consumer Service used by a SAML2 relying party.

Closes gh-23746
2020-10-20 16:42:30 +02:00
Stephane Nicoll
72eaf93dba Polish assertions
See gh-23762
2020-10-20 14:37:15 +02:00
izeye
0e50e87e58 Polish
See gh-23762
2020-10-20 14:28:15 +02:00
Andy Wilkinson
a0afb73923 Merge branch '2.3.x'
Closes gh-23751
2020-10-19 14:32:38 +01:00
Andy Wilkinson
a754b791a2 Merge branch '2.2.x' into 2.3.x
Closes gh-23750
2020-10-19 14:32:23 +01:00
Andy Wilkinson
11bc62fb83 Stop using PostConstruct to default session timeout to ServerProperties'
Fixes gh-23716
2020-10-19 14:31:01 +01:00
Andy Wilkinson
4a38401cef Align relying party entity ID property with Spring Security
Closes gh-23745
2020-10-19 14:02:04 +01:00
Stephane Nicoll
dd74810c80 Revert "Fix detection logic for embedded databases"
This reverts commit c4a5a347028b827ea53975d1ec80f52a14223c5c.

See gh-23721
2020-10-19 12:25:00 +02:00
Asha Somayajula
c4a5a34702 Fix detection logic for embedded databases
Closes gh-23721
2020-10-17 07:51:24 +02:00
Stephane Nicoll
c0b267feb4 Polish "Fix detection logic for embedded databases"
See gh-23693
2020-10-16 16:32:29 +02:00
Asha Somayajula
ab02084e7b Fix detection logic for embedded databases
See gh-23693
2020-10-16 15:54:54 +02:00
Andy Wilkinson
d0c6dbc2c7 Rename eagerInitFilters to align with Undertow's naming
Closes gh-23674
2020-10-14 18:03:06 +01:00
Stephane Nicoll
b960fa3237 Polish "Add configuration options for Kafka Stream's CleanupConfig"
See gh-23636
2020-10-14 14:30:10 +02:00
Adrien Bennadji
f4799c7484 Add configuration options for Kafka Stream's CleanupConfig
See gh-23636
2020-10-14 14:26:37 +02:00
Johnny Lim
4a26e11268 Polish
See gh-23634

Closes gh-23634
2020-10-13 12:44:00 -07:00
Andy Wilkinson
a64f2699cc Configure Undertow not to presever path on forward by default
Closes gh-23619
2020-10-13 19:03:36 +01:00
Andy Wilkinson
5d5afbc70d Merge branch '2.3.x'
Closes gh-23677
2020-10-13 13:38:28 +01:00
Andy Wilkinson
0abe38d478 Merge branch '2.2.x' into 2.3.x
Closes gh-23676
2020-10-13 13:18:53 +01:00
Andy Wilkinson
7fc345f587 Apply server.undertow.eager-filter-init to factory
Fixes gh-23675
2020-10-13 13:02:36 +01:00
Stephane Nicoll
2577c67185 Fix mapping of outputQueryResults property
Closes gh-23645
2020-10-13 13:20:51 +02:00
Stephane Nicoll
679bd34ea4 Upgrade to Flyway 7.0.2
Closes gh-23645
2020-10-13 10:16:01 +02:00
Stephane Nicoll
d7cf8fae5c Fix formatting 2020-10-09 09:22:51 +02:00
Stephane Nicoll
34c4c3f235 Expose cache metrics for Redis
This commit adds support for Redis cache metrics. Users can opt-in for
statistics using the "spring.cache.redis.enable-statistics" property.

Closes gh-22701
2020-10-09 09:03:23 +02:00
Stephane Nicoll
5beeeac4b3 Polish "Prefer JdbcTransactionManager over DataSourceTransactionManager"
See gh-23672
2020-10-08 15:59:34 +02:00
Marten Deinum
f9d50ee86a Prefer JdbcTransactionManager over DataSourceTransactionManager
Spring 5.3 introduced the JdbcTransactionManager with exception
translation on commit and rollback. This commit updates the
auto-configuration to use this implementation rather than
DataSourceTransactionManager.

See gh-23672
2020-10-08 15:59:16 +02:00
Phillip Webb
2c487f7cb8 Polish 2020-10-06 19:24:38 -07:00
Andy Wilkinson
1d610fe1c8 Add configuration properties for Flyway 7's new config options
Closes gh-23579
2020-10-05 15:26:20 +01:00
Andy Wilkinson
847aecf621 Upgrade to Flyway 7.0.0
Closes gh-23514
2020-10-05 15:26:19 +01:00
Stephane Nicoll
ebc9c575e3 Allow to customize RSocketServer's fragment size
Closes gh-23247
2020-10-05 13:58:57 +02:00
Stephane Nicoll
5feaf2bc1a Polish "Polish empty string checks"
See gh-23550
2020-10-05 10:42:19 +02:00
Santhoshkumar. P
5cb07e292d Polish empty string checks
See gh-23550
2020-10-05 10:38:47 +02:00
Stephane Nicoll
294af45bb3 Replace reflection call in HttpMessageConverters
Closes gh-23485
2020-10-05 10:26:22 +02:00
dreis2211
ecee9c0f9b Avoid unnecessary explicit initialization of Atomics
Constructor calls like new AtomicInteger(0) cause a volatile write that
can be saved in cases where the constructor parameter is the default
value.

See gh-23575
2020-10-02 16:43:34 +02:00