Commit Graph

2685 Commits

Author SHA1 Message Date
Stephane Nicoll 83d732823d Merge branch '2.6.x' into 2.7.x
Closes gh-29136
2021-12-20 18:08:00 +01:00
Stephane Nicoll 653fdbd0a4 Configure comment prefixes
Closes gh-29095
2021-12-20 17:47:50 +01:00
Madhura Bhave 764531c326 Merge branch '2.6.x' into 2.7.x
Closes gh-29108
2021-12-17 17:51:29 -08:00
Madhura Bhave d9d161cd6b Allow previously authorized users to access the error page
Prior to this commit, the `ErrorPageSecurityFilter` verified if
access to the error page was allowed by invoking the
`WebInvocationPrivilegeEvaluator` with the Authentication from the
`SecurityContextHolder`.
This meant that access to the error page was denied for a `null` Authentication
 or `AnonymousAuthenticationToken` in cases where the error page required
authenticated access. This prevented authorized users from accessing the
error page in case the Authentication wasn't retrievable for the error dispatch,
which is the case for `@Transient` authentication or stateless session policy.

This commit updates the `ErrorPageSecurityFilter` to check access to the error page
only if the error is an authn or authz error in cases where an authentication object
is not found in the SecurityContextHolder. This makes the error response consistent
when bad credentials or no credentials are used while also allowing access to previously
authorized users.

Fixes gh-28953
2021-12-17 16:58:58 -08:00
Stephane Nicoll 64dd1f86c0 Merge branch '2.6.x' into 2.7.x
Closes gh-29104
2021-12-17 16:38:07 +01:00
Stephane Nicoll c077ebecf7 Merge branch '2.5.x' into 2.6.x
Closes gh-29103
2021-12-17 16:37:53 +01:00
Andy Wilkinson 2fec06ac7e Find annotation without initializing factory beans
Closes gh-28977
2021-12-17 16:08:30 +01:00
Phillip Webb 1015df088d Merge branch '2.6.x' into 2.7.x 2021-12-16 13:55:55 -08:00
Phillip Webb 587d6fa309 Polish 2021-12-16 13:55:42 -08:00
Phillip Webb f3bcbca841 Update copyright year of changed files 2021-12-16 13:05:17 -08:00
Scott Frederick 4cad4851da Merge branch '2.6.x' into 2.7.x
Closes gh-29088
2021-12-16 12:24:12 -06:00
Scott Frederick 92b096abbf Fix message interpolation when code is used as default message
When `setUseCodeAsDefaultMessage(true)` was set on a message source,
attempting to interpolate the default message returned from the message
source would result in the code being unusable by upstream message
resolvers.

Fixes gh-28930
2021-12-16 12:20:37 -06:00
Stephane Nicoll 9ca1cffab7 Merge branch '2.6.x' into 2.7.x
Closes gh-29016
2021-12-14 15:32:13 +01:00
Stephane Nicoll ba60e3d358 Merge branch '2.5.x'
Closes gh-29002
2021-12-14 15:31:45 +01:00
Stephane Nicoll 89635eafa3 Update copyright year of changed files
See gh-28862
2021-12-09 15:48:47 +01:00
Stefano Cordio a5c56043b9 Simplify AssertJ usage
See gh-28862
2021-12-09 15:39:02 +01:00
Artur Signell ad754abba3 Make ErrorPageSecurityFilter compatible with Servlet 3.1
See gh-28902
2021-12-09 12:36:35 +00:00
Stephane Nicoll 46a8673bf8 Merge branch '2.5.x'
Closes gh-28839
2021-11-29 09:44:31 +01:00
Stephane Nicoll 1876b4bcd7 Update copyright year of changed files
See gh-28809
2021-11-29 09:43:44 +01:00
Leo Li f3c93d30a8 Fix reference to matching-strategy property
See gh-28809
2021-11-29 09:39:40 +01:00
izeye c7921468fc Polish
See gh-28836
2021-11-29 09:38:07 +01:00
Phillip Webb beb68671bb Update copyright year of changed files 2021-11-24 10:23:32 -08:00
Madhura Bhave e6b5be900a Make ErrorPageSecurityFilter Servlet 3.1 compatible
Restore Servlet 3.1 compatibly by implementing `Filter` rather
than extending the 4.0 `HttpFilter` type.

Fixes gh-28790
2021-11-24 09:59:27 -08:00
Madhura Bhave f621937d3b Skip error page security filter for non-error dispatch type
Update `ErrorPageSecurityFilter` to defensively check that the
`DispatcherType` is `ERROR`. Although this check isn't necessary
for regular applications, it is needed if MockMvc is being used.

Fixes gh-28759
2021-11-24 09:55:59 -08:00
Madhura Bhave dd1d1482dc Deny unauthorized access to the error page
Fixes gh-26356

Co-authored-by Andy Wilkinson <wilkinsona@vmware.com>
2021-11-18 15:41:38 -08:00
Madhura Bhave 6b79d2860f Merge branch '2.5.x' into main
Closes gh-28724
2021-11-17 16:41:23 -08:00
Madhura Bhave 64270eca51 Convert environment used by SpringBootTestContextLoader
This commit aligns `SpringBootTest`s to also use `ApplicationEnvironment`
instead of `StandardEnvironment`. This prevents the side-effect of active
profiles from `@ActiveProfiles` from being added to the environment when
doGetActiveProfiles is called. In this case, calling `addActiveProfiles()`
in the environment post processor would result in `@ActiveProfiles` being
added to the environment first, resulting in the wrong order.

The additional call to `setActiveProfiles()` is also not necessary when using
ApplicationEnvironment because that call was put in place to prevent the side-effect
which `ApplicationEnvironment` does not have.

Fixes gh-28530
2021-11-17 16:40:53 -08:00
Andy Wilkinson 2a342ef416 Merge branch '2.5.x'
Closes gh-28662
2021-11-12 23:40:35 +00:00
Andy Wilkinson 5e4a502b2d Merge branch '2.4.x' into 2.5.x
Closes gh-28661
2021-11-12 20:31:25 +00:00
Andy Wilkinson 2cec3971d7 Prohibit unwanted dependencies in all modules not just starters
Closes gh-28658
2021-11-12 20:04:35 +00:00
izeye 5d8dce70dc Polish
See gh-28494
2021-11-01 08:58:40 +01:00
Andy Wilkinson e54b876536 Merge branch '2.5.x'
Closes gh-28487
2021-10-29 15:50:01 +01:00
Andy Wilkinson 5e42f27b36 Merge branch '2.4.x' into 2.5.x
Closes gh-28486
2021-10-29 15:49:49 +01:00
Andy Wilkinson e4e1958b65 Make Logback fall back to JVM's default charset
The charset "default" is an alias for US-ASCII, not the JVM's default
charset. This commit updates the built-in Logback configuration to
use Charset.defaultCharset().name() in place of "default" in the
Java-based configuration. In the XML-based configuration where
Charset.defaultCharset().name() cannot be called, we emulate its
behaviour [1] by using the file.encoding system property, falling back
to UTF-8 when it's not set.

Fixes gh-27230

[1] 19be6113dd/jdk/src/share/classes/java/nio/charset/Charset.java (L604-L617)
2021-10-29 14:40:05 +01:00
Stephane Nicoll ea8a8ecd0e Merge branch '2.5.x'
Closes gh-28467
2021-10-28 11:53:34 +02:00
Stephane Nicoll ce38d592f9 Merge branch '2.4.x' into 2.5.x
Closes gh-28466
2021-10-28 11:53:19 +02:00
Guillaume Husta a05b2207f8 Fix description of "logging.logback.rollingpolicy.max-history"
See gh-28448
2021-10-28 11:45:42 +02:00
Phillip Webb e25f216eab Merge branch '2.5.x'
Closes gh-28425
2021-10-21 11:28:33 -07:00
Phillip Webb daf36dff55 Merge branch '2.4.x' into 2.5.x
Closes gh-28424
2021-10-21 11:27:29 -07:00
Phillip Webb 2f6651c3cb Don't use markdown syntax in javadoc or error messages
Closes gh-28408
2021-10-21 11:24:54 -07:00
Phillip Webb ec79f14639 Drop AbstractJettyServletWebServerFactoryTests
Drop `AbstractJettyServletWebServerFactoryTests` and merge the existing
code into `JettyServletWebServerFactoryTests`.
2021-10-20 22:58:46 -07:00
Phillip Webb cf9156e497 Add SameSite cookie support for servlet web servers
Update Tomcat, Jetty and Undertow `ServletWebServerFactory`
implementations so that they can write SameSite cookie attributes.

The session cookie will be customized whenever the
`server.servlet.session.cookie.same-site` property is set.

Other cookies can be customized with the new `CookieSameSiteSupplier`
interface which can be registered using `@Bean` methods.

Closes gh-20971

Co-authored-by Andy Wilkinson <wilkinsona@vmware.com>
2021-10-20 22:58:31 -07:00
Phillip Webb b72ff25220 Relocate and unify reactive cookie properties
Relocate the recently introduced `spring.webflux.session` properties
to `server.reactive.session` and create a unified `Cookie` properties
class.

Reactive session properties now mirror the existing
`server.servlet.session` properties and better reflect the fact that
they are related to the server and not just for WebFlux.

See gh-26714
2021-10-20 22:09:33 -07:00
Phillip Webb 3c71637fa2 Polish 'Add more session properties for reactive web servers'
See gh-26714
2021-10-20 22:09:30 -07:00
Andy Wilkinson 6c43914652 Merge branch '2.5.x'
Closes gh-28383
2021-10-19 17:43:40 +01:00
Andy Wilkinson 76272ffb62 Merge branch '2.4.x' into 2.5.x
Closes gh-28382
2021-10-19 17:43:30 +01:00
Andy Wilkinson 54ce51e43c Polish "Fix typos in EnvironmentPostProcessor javadoc"
See gh-28376
2021-10-19 17:43:16 +01:00
fml2 ded396b728 Fix typos in EnvironmentPostProcessor javadoc
See gh-28376
2021-10-19 17:41:46 +01:00
Andy Wilkinson 89b40e1e00 Add support for Log4j2's composite configuration
Closes gh-27110
2021-10-19 10:01:30 +01:00
Phillip Webb 04123e0a0e Merge branch '2.5.x'
Closes gh-28377
2021-10-18 21:47:07 -07:00
Phillip Webb 19d3007806 Polish 2021-10-18 21:44:56 -07:00
Andy Wilkinson 31d88c3d3c Improve failure analysis action when circular references are allowed
Closes gh-27735
2021-10-18 16:02:13 +01:00
Phillip Webb 2034ad4827 Merge branch '2.5.x' 2021-10-13 18:48:18 -07:00
Phillip Webb 02b577390f Merge branch '2.4.x' into 2.5.x 2021-10-13 18:47:51 -07:00
Phillip Webb 0561992c2a Update copyright year of changed files 2021-10-13 18:45:38 -07:00
Stephane Nicoll cc8d7fc605 Polish contribution
See gh-28239
2021-10-13 09:10:11 +02:00
Leo Li 1770f065a5 Polish
See gh-28239
2021-10-13 09:07:33 +02:00
Andy Wilkinson 1a505964ee Merge branch '2.5.x'
Closes gh-28207
2021-10-06 10:03:24 +01:00
Andy Wilkinson 1931104d13 Merge branch '2.4.x' into 2.5.x
Closes gh-28206
2021-10-06 09:57:19 +01:00
Andy Wilkinson 9c9fbf400e Upgrade to Spring Java Format 0.0.29
Closes gh-28205
2021-10-06 09:52:45 +01:00
dreis2211 c5088a3bd3 Avoid explicit initialization of Atomics with their default values
See gh-28162
2021-10-05 15:37:00 +02:00
Stephane Nicoll 5d17257a52 Polish "Add Java InfoContributor"
See gh-28136
2021-10-05 15:11:58 +02:00
Madhura Bhave fb9f1eba41 Merge branch '2.5.x' into main
Closes gh-28172
2021-10-01 15:55:06 -07:00
Madhura Bhave 3249d05464 Merge branch '2.4.x' into 2.5.x
Closes gh-28171
2021-10-01 15:54:49 -07:00
Susmitha f94caed7e9 Update ConstructorBinding javadoc with usage information
See gh-28168
2021-10-01 15:53:43 -07:00
Andy Wilkinson 2d2cbff504 Avoid NoSuchMethodError from UCP's PoolDataSource.getPassword()
While still present and marked as deprecated, the getPassword()
method on UCP's PoolDataSource has been implemented to throw a
NoSuchMethodError making it useless for our purposes.

This commit updates DataSourceBuilder to avoid using the getter. This
means that a password must now be provided when trying to derive a
new DataSource from an existing PoolDataSource.

Closes gh-28127
2021-09-24 10:10:15 +01:00
Andy Wilkinson 5e426394db Add exception and analyzer for mutually exclusive config props
Add `MutuallyExclusiveConfigurationPropertiesException` and a related
failure analyzer so that a nice message can be displayed if more than
one mutually exclusive property is defined.

Closes gh-28121

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2021-09-23 16:18:03 -07:00
Phillip Webb 528ced4f0d Rename 'running' to 'ready' for ApplicationStartup
Rename 'spring.boot.application.running' to
'spring.boot.application.ready' to better align with `ReadinessState`.

Closes gh-28080
2021-09-23 12:54:22 -07:00
Andy Wilkinson 4fa61cbc60 Merge branch '2.5.x' 2021-09-22 18:37:11 +01:00
Andy Wilkinson 2ba593328f Order detector for AbstractDataSourceInitializers
Previously, the detector for AbstractDataSourceInitializers used the
default detector order. This resulted in the initializers detected
initializers running before Flyway. Constrastingly, the detector for
DataSourceScriptDatabaseInitializers uses a custom order so its
detected initializers would run after Flyway.

This commit aligns the order of the detector for
AbstractDataSourceInitializers with the order of the detector for
DataSourceScriptDatabaseInitializers. This ensures that script-based
initialization runs in the same order with respect to Flyway,
irrespective of which initializer implementation is driving it.

Fixes gh-28079
2021-09-22 18:30:44 +01:00
Phillip Webb 98a0e07dd5 Polish "Add startup time metrics"
See gh-27878
2021-09-21 14:45:00 -07:00
Phillip Webb 55a1ec72cc Update copyright year of changed files 2021-09-21 11:25:50 -07:00
Phillip Webb 5ba69634c9 Merge branch '2.4.x' into 2.5.x 2021-09-21 11:17:55 -07:00
Phillip Webb dfd36673f7 Update copyright year of changed files 2021-09-21 11:17:19 -07:00
Stephane Nicoll e0465f7357 Use RootBeanDefinition consistently
Closes gh-28077
2021-09-21 16:36:45 +02:00
Stephane Nicoll d68b6bb2f1 Polish "Add testing for AbstractFailureAnalyzer.findCause"
See gh-27862
2021-09-21 10:05:15 +02:00
smoothbear a2eed676a2 Add testing for AbstractFailureAnalyzer.findCause
See gh-27862
2021-09-21 09:52:10 +02:00
dreis2211 cf0fcafd13 Polish
See gh-27940
2021-09-21 08:08:29 +02:00
Andy Wilkinson b69ef0c881 Upgrade to Oracle Database 21.3.0.0
Closes gh-28054
2021-09-20 17:44:57 +01:00
Stephane Nicoll c62a6819fe Polish "Add startup time metrics"
See gh-27878
2021-09-16 13:33:08 +02:00
bono007 2e67963bfe Add startup time metrics
See gh-27878
2021-09-16 13:19:20 +02:00
Andy Wilkinson 358ab2a8d5 Merge branch '2.5.x'
Closes gh-28034
2021-09-16 10:51:14 +01:00
Andy Wilkinson a4f1d32203 Register application shutdown hook lazily
Previously, SpringApplicationShutdownHook would always register a
shutdown hook, even if SpringApplication was configured not to
use a shutdown hook, such as in a war deployment. This could
result in a memory leak when the war was undeployed. The shutdown
hook registered by SpringApplicationShutdownHook would remain
registered, pinning the web application's class loader in memory.

This commit updates SpringApplicationShutdownHook so that it
registers a shutdown hook with the JVM lazily, upon registeration
of the first application context.

Fixes gh-27987
2021-09-16 10:38:29 +01:00
Andy Wilkinson 69e793ab37 Merge branch '2.5.x'
Closes gh-28033
2021-09-16 09:56:26 +01:00
Andy Wilkinson afb81f14ea Merge branch '2.4.x' into 2.5.x
Closes gh-28032
2021-09-16 09:55:45 +01:00
Andy Wilkinson 1900a11f8a Fix Undertow's resource loading when filename contains reserved chars
Fixes gh-9283
2021-09-16 09:55:26 +01:00
Stephane Nicoll 8c819c94d6 Upgrade to Tomcat 9.0.53
Closes gh-27964
2021-09-13 11:04:57 +02:00
Stephane Nicoll 2004c062df Upgrade to Tomcat 9.0.53
Closes gh-27963
2021-09-13 11:04:02 +02:00
Stephane Nicoll ab81e3c05c Upgrade to Tomcat 9.0.53
Closes gh-27961
2021-09-13 10:28:42 +02:00
dreis2211 e1afc91ae2 Polish javadoc comments
See gh-27925
2021-09-10 07:53:49 +02:00
dreis2211 242d730f51 Deprecate DataSourceInitializationMode
See gh-27926
2021-09-10 07:51:32 +02:00
Stephane Nicoll e10ebb17e0 Polish "Fix tests on non English systems"
See gh-27887
2021-09-08 08:07:09 +02:00
dreis2211 32e51966dd Fix tests on non English systems
See gh-27887
2021-09-08 07:59:35 +02:00
Stephane Nicoll b4b71ec015 Add bind method to ConfigurationProperties bean definition
This commit reworks the configuration properties registrar to use
RootBeanDefinition and a standard attribute rather than relying on
a package private sub-class. This allows other components to inspect
the metadata if necessary.

Closes gh-27821
2021-09-06 10:28:03 +02:00
Stephane Nicoll 542e6ab0d3 Merge branch '2.5.x'
Closes gh-27879
2021-09-06 08:33:14 +02:00
Stephane Nicoll d6cc1f6d7d Polish "Use more precise variables to detect Azure App Service"
See gh-27819
2021-09-06 08:28:58 +02:00
Julien Dubois 69b23470c7 Use more precise variables to detect Azure App Service
See gh-27819
2021-09-06 08:12:22 +02:00
Stephane Nicoll e25553e3c3 Merge branch '2.5.x'
Closes gh-27874
2021-09-05 17:02:43 +02:00
Stephane Nicoll 3dab5ff2c0 Merge branch '2.4.x' into 2.5.x
Closes gh-27873
2021-09-05 17:02:17 +02:00
Henning Pöttker 831e28b001 Fix typo in javadoc
See gh-27856
2021-09-05 17:01:31 +02:00