Commit Graph

4596 Commits

Author SHA1 Message Date
Yanming Zhou ac18e3015c Use `.isEmpty()` where feasible
See gh-38739
2023-12-19 22:38:05 -08:00
Phillip Webb 2158f4cc43 Polish 'Use authParamString to configure Pulsar authentication'
See gh-38839
2023-12-16 22:23:37 -08:00
Chris Bono 4c0a19e8c0 Use authParamString to configure Pulsar authentication
Update `PulsarPropertiesMapper` to use JSON encoded parameters rather
than a `Map` since the `Map` method is deprecated in Pulsar. This
commit simply takes the auth params map and converts them to the
expected encoded JSON string of auth parameters.

See gh-38839
2023-12-16 22:19:45 -08:00
Phillip Webb 26dc14031e Update `LoadedPemSslStore` to use lazy loading
Update `LoadedPemSslStore` so that it loads content lazily. This
restores the behavior of Spring Boot 3.1 and allows bundles to be
defined with files that don't exist as long as they are never accessed.

Fixes gh-38659
2023-12-14 22:03:07 -08:00
Phillip Webb 1d10e51755 Adapt to upstream Spring Security changes 2023-12-14 20:33:09 -08:00
Andy Wilkinson afad358047 Align reactive web security more closely with servlet web security
There are some notable differences in the behavior of Spring
Security's reactive and servlet-based web security. Notably,
Servlet-based web security (`@EnableWebSecurity`) works without
any authentication manager, rejecting requests as not authorized.
By contrast reactive-based web security (`@EnableWebFluxSecurity`)
fails to start up when there's no authentication manager, either
provided directly as a bean or derived from a
ReactiveUserDetailsService. There are also further differences at
runtime where empty Monos from all ReactiveAuthenticationManagers
results in an internal error and a 500 response whereas a similar
situation in the servlet implementation results in a 401.

Previously, to accommodate these differences in behavior, Spring
Boot's auto-configuration would behave differently. In the Servlet
case, web security would be enabled whenever the necessary
dependencies were on the classpath. In the reactive case, web
security would back off in the absence of an authentication manager
to prevent a start up failure. While this difference is rooted in
Spring Security, it is undesirable and something that we want to
avoid Spring Boot users being exposed to where possible.
Unfortunately, the situation is more likely to occur than before
as ReactiveUserDetailsServiceAutoConfiguration now backs off more
readily (gh-35338). This makes it more likely that the context will
contain neither a reactive authetication manager not a reactive
user details service.

This commit reworks the auto-configurations related to reactive
security. ReactiveSecurityAutoConfiguration will now auto-configure
an "empty" reactive authentication manager that denies access through
Mono.error in the absence of a ReactiveAuthenticationManager,
ReactiveUserDetailsService, or SecurityWebFilterChain. The last of
these is to allow for the situation where a filter chain has been
defined with an authentication manager configured directly on it.
This configuration of an authentication manager allows
`@EnableWebFluxSecurity` to be auto-configured more readily,
removing one of the differences between reactive- and Servlet-based
security.

Corresponding updates to the auto-configurations for reactive OAuth2
support have also been made. They no longer try to auto-configure
`@EnableWebFluxSecurity`, relying instead upon
ReactiveSecurityAutoConfiguration, which they are ordered before, to
do that instead.

Closes gh-38713
2023-12-13 12:44:04 +00:00
Andy Wilkinson 964ccbb000 Revert "Do not enable WebFlux security unless other configuration is active"
This reverts commit beba1f176a.

See gh-38713
2023-12-13 11:17:08 +00:00
Moritz Halbritter 01f59608ac Merge branch '3.1.x'
Closes gh-38752
2023-12-12 16:23:33 +01:00
Moritz Halbritter b8021dbc65 Exclude Rabbit Stream when testing RabbitAutoConfiguration
The stream auto-configuration is tested in RabbitStreamConfigurationTests,
and excluding it prevents the creation of the "rabbitStreamEnvironment"
Environment bean, which delays the application context close by 1 second
because it has to wait for some Netty resources to gracefully shut down.

Closes gh-38750
2023-12-12 16:12:22 +01:00
Andy Wilkinson beba1f176a Do not enable WebFlux security unless other configuration is active
Following the changes in gh-37504, the reactive resource server
auto-configuration could enable WebFlux security in situations where
it was otherwise in active. This could then result in an application
failing to start as no authentication manager is available.

This commit updates the configurations that enable WebFlux security
so that they fully back off unless their related configurations are
active. Previously, only the configuration of the
SecurityWebFilterChain would back off. This has been expanded to
cover `@EnableWebFluxSecurity` as well. This has required splitting
the configuration classes up so that the condition evaluation order
can be controlled more precisely. We need to ensure that the JWT
decoder bean or the opaque token introspector bean has been defined
before evaluation of the conditions for `@EnableWebFluxSecurity`.
Without this control, the import through `@EnableWebFluxSecurity` in
one location where the conditions do not matchcan prevent a
successful import in another where they do.

Fixes gh-38713
2023-12-11 12:46:29 +00:00
Moritz Halbritter cc665dd529 Merge branch '3.1.x'
Closes gh-38727
2023-12-11 09:18:25 +01:00
Donghun Shin f922b3de03 Rename local variable in BatchAutoConfiguration
See gh-38674
2023-12-11 08:25:39 +01:00
Andy Wilkinson 6dff3c5978 Adapt to change in Framework's disconnected client detection
See gh-38666
2023-12-06 14:18:40 +00:00
Moritz Halbritter f9a1eb000e Merge branch '3.1.x'
Closes gh-38658
2023-12-05 11:51:03 +01:00
Lars Uffmann 5981a3fd33 Build against UCP and JDBC driver for Oracle Database variant ucp11
See gh-38654
2023-12-05 11:40:35 +01:00
Brian Clozel 0321a8a05b Configure ObservationRegistry on JmsListener
Prior to this commit, we set in gh-37388 the ObservationRegistry on the
auto-configured JmsTemplate bean. This enables observations and context
propagation when sending JMS messages.

This commit applies the same to the `DefaultJmsListenerContainerFactory`
and the `DefaultJmsListenerContainerFactoryConfigurer`, in order to
enable observations on `@JmsListener` annotated methods.

This commit also refactors the support implemented in gh-37388 to avoid
relying on a bean post processor and instead set the observation
registry directly in the main auto-configuration: while Micrometer core
is an actuator-only dependency, Micrometer Observation API is a compile
dependnecy for spring-jms itself and there is no need to separate
concerns there.

Fixes gh-38613
2023-12-01 09:36:00 +01:00
Moritz Halbritter fdbd65a2f5 Only apply awaitTerminationPeriod if awaitTermination is set
See gh-38528
2023-11-30 10:29:12 +01:00
Moritz Halbritter 6744cc2887 Apply awaitTerminationPeriod to SimpleAsyncTaskScheduler
Closes gh-38530
2023-11-30 10:25:33 +01:00
Moritz Halbritter e454470bf9 Apply awaitTerminationPeriod to SimpleAsyncTaskExecutor
Closes gh-38528
2023-11-30 09:25:49 +01:00
Andy Wilkinson 3e4e59a8f0 Restore compatibility with Liquibase 4.23
Closes gh-38522
2023-11-28 17:41:47 +00:00
Johnny Lim f9f73aa146 Polish
See gh-38508
2023-11-23 09:39:01 +01:00
Phillip Webb 9f031b04e5 Merge branch '3.1.x'
Closes gh-38507
2023-11-22 11:13:12 -08:00
Phillip Webb bc504a8a03 Fix @ConditionalOnBean with annotation early FactoryBean initialization
Update `OnBeanCondition` with a variant of `getBeanNamesForAnnotation`
that does not cause early `FactoryBean` initialization.

Fixes gh-38473
2023-11-22 11:10:59 -08:00
Moritz Halbritter b1da6f941f Merge branch '3.1.x' 2023-11-22 10:29:28 +01:00
Moritz Halbritter eddb17473b Fix deprecation clause on MongoPropertiesClientSettingsBuilderCustomizer 2023-11-22 10:29:12 +01:00
Johnny Lim 175b6473c7 Polish
See gh-38389
2023-11-22 10:16:19 +01:00
Lars Uffmann adb841c45e Update JobLauncherApplicationRunner to use getIdentifyingParameters
See gh-38327
2023-11-13 12:12:34 +01:00
Moritz Halbritter c66322491d Merge branch '3.1.x'
Closes gh-38339
2023-11-13 11:50:57 +01:00
Moritz Halbritter 24cb05cb59 Merge branch '3.0.x' into 3.1.x
Closes gh-38338
2023-11-13 11:49:51 +01:00
Lars Uffmann e41b36273f Remove unnecessary JobOperator bean definition
See gh-38325
2023-11-13 11:46:38 +01:00
Brian Clozel 67c5d10051 Process multipart properties for PartEvent support
Prior to this commit, some properties in the `spring.webflux.multipart`
namespace were ignored for the streaming use case because those were not
supported in streaming mode with `PartEvent`.

As of Spring Framework 6.1, the `max-parts` and
`max-disk-usage-per-part` properties can be supported and this commit
maps those properties accordingly.

Fixes gh-37642
2023-11-10 11:36:13 +01:00
Andy Wilkinson 9247104830 Merge branch '3.1.x'
Closes gh-38286
2023-11-09 20:31:53 +00:00
Andy Wilkinson b6a9c67719 Avoid adding Jetty's upgrade filter to non-Jetty servers
Fixes gh-38181
2023-11-09 20:30:35 +00:00
Claudio Nave 4a6564c0a9 Add Liquibase `show-summary` and `show-summary-output` properties
Update `LiquibaseProperties` and `LiquibaseAutoConfiguration` to
support the recently added `setShowSummary` and
`setShowSummaryOutput` methods.

See gh-38274
2023-11-09 11:48:36 -08:00
Claudio Nave 61aecdedd6 Remove Liquibase javax.activation excludes
Liquibse no longer declares a dependency on `javax.activation`
(see https://github.com/liquibase/liquibase/issues/4487) so we
can now remove our exclusions.

See gh-38274
2023-11-09 11:44:31 -08:00
Andy Wilkinson 82c9ab4cbd Merge branch '3.1.x'
Closes gh-38268
2023-11-08 17:10:19 +00:00
Andy Wilkinson 1e1effe131 Merge branch '3.0.x' into 3.1.x
Closes gh-38267
2023-11-08 16:59:15 +00:00
Andy Wilkinson 6d46c24db7 Merge branch '2.7.x' into 3.0.x
Closes gh-38266
2023-11-08 15:58:40 +00:00
Andy Wilkinson 7c73a034b6 Improve backwards- and forwards-compatibility of Flyway auto-config
Closes gh-38164
2023-11-08 15:17:49 +00:00
Moritz Halbritter d59b385304 Merge branch '3.1.x'
Closes gh-38226
2023-11-06 10:27:50 +01:00
Moritz Halbritter 3560a13d57 Merge branch '3.0.x' into 3.1.x
Closes gh-38225
2023-11-06 10:27:42 +01:00
Yanming Zhou d7ab153559 Use switch expression where feasible
See gh-38217
2023-11-06 10:27:04 +01:00
Moritz Halbritter a944815e3c Merge branch '3.1.x'
Closes gh-38221
2023-11-06 08:58:16 +01:00
Eddú Meléndez 674f8fbb8d Polish RabbitAutoConfiguration
See gh-38216
2023-11-06 08:57:19 +01:00
Scott Frederick 55ab56f8d9 Polish "Add observationEnabled properties for Apache Kafka"
See gh-38057
2023-11-02 17:05:17 -05:00
Zhiyang.Wang1 ff9d9de1ee Add observationEnabled properties for Apache Kafka
See gh-38057
2023-11-02 17:05:17 -05:00
Scott Frederick 99986a2fdd Polish SSL internals 2023-11-02 14:41:06 -05:00
Moritz Halbritter d3f177be71 Polish SSL 2023-11-02 09:36:06 +01:00
Phillip Webb 9b71ef4114 Polish and refactor some SSL internals
Polish and refactor some of the internal SSL code to make it easier to
add additional functionality in the future.
2023-11-01 16:14:59 -07:00
Phillip Webb 30a7426e86 Apply key property to the keystore and not to the truststore
Update `PropertiesSslBundle` so that key properties are now
only applied to the keystore and not the truststore.

Closes gh-38125
2023-11-01 16:10:51 -07:00
Phillip Webb 5dc5c2a4bc Rename `KeyVerifier` to `CertificateMatcher`
Rename `KeyVerifier` to `CertificateMatcher` and refactor some
of the internals. This commit also adds test helper classes to
help simplify some of the tests.

See gh-38173
2023-11-01 16:10:31 -07:00
Phillip Webb 1b61bc1f20 Move PEM verification to spring-boot-autoconfigure
Move `KeyVerifier` to spring-boot-autoconfigure to reduce the
public API required in `PemSslStoreBundle`.

This commit also moves the verify property so that is can be set
per store.

Closes gh-38173
2023-11-01 16:10:16 -07:00
Phillip Webb 2c6fca8df7 Allow alias and password to be configured on a per PEM store basis
Closes gh-38124
2023-11-01 16:02:33 -07:00
Andy Wilkinson 8f2ec22738 Merge branch '3.1.x'
Closes gh-38152
2023-10-31 11:50:42 +00:00
Andy Wilkinson 1fcf1fcc20 Merge branch '3.0.x' into 3.1.x
Closes gh-38151
2023-10-31 11:50:32 +00:00
Andy Wilkinson 8f4ea6834d Merge branch '2.7.x' into 3.0.x
Closes gh-38150
2023-10-31 11:50:18 +00:00
Andy Wilkinson 020c2b364e Fix handling of value that overflows an int
Closes gh-38146
2023-10-31 11:47:14 +00:00
Andy Wilkinson d2325d1110 Upgrade to Oracle Database 23.3.0.23.09
Closes gh-38121
2023-10-30 20:42:24 +00:00
Andy Wilkinson 5765f9410c Upgrade to Liquibase 4.24.0
Closes gh-38120
2023-10-30 20:41:49 +00:00
Andy Wilkinson 4f7e4712dd Merge branch '3.1.x'
Closes gh-38019
2023-10-25 10:45:07 +01:00
Andy Wilkinson 4faabcfcdd Merge branch '3.0.x' into 3.1.x
Closes gh-38018
2023-10-25 10:44:38 +01:00
Andy Wilkinson b33ee84146 Merge branch '2.7.x' into 3.0.x
Closes gh-38017
2023-10-25 10:44:03 +01:00
Andy Wilkinson 8778884f5d Clarify role of WebMvcRegistrations and WebMvcConfigurer
Closes gh-31232
2023-10-25 10:42:25 +01:00
Andy Wilkinson a9469d9c8e Adapt to changes in Framework's internals
See gh-37995
2023-10-23 18:07:38 +01:00
Johnny Lim b5d4983829 Polish
See gh-37984
2023-10-23 11:15:27 +02:00
Phillip Webb 3eeb1b2849 Merge branch '3.1.x' 2023-10-19 23:21:42 -07:00
Phillip Webb 9f3afb3636 Merge branch '3.0.x' into 3.1.x 2023-10-19 23:21:20 -07:00
Phillip Webb 7c864804d5 Merge branch '2.7.x' into 3.0.x 2023-10-19 23:21:08 -07:00
Phillip Webb d47f8bf945 Update copyright year of changed files 2023-10-19 23:20:43 -07:00
Phillip Webb d638bbb0ba Merge branch '3.1.x'
Closes gh-37967
2023-10-19 21:25:44 -07:00
Phillip Webb 1d456e09d2 Merge branch '3.0.x' into 3.1.x
Closes gh-37966
2023-10-19 21:12:52 -07:00
Phillip Webb a0b999c8b4 Merge branch '2.7.x' into 3.0.x
Closes gh-37965
2023-10-19 20:55:51 -07:00
Phillip Webb abdad1cabe Constently use assertThatExceptionOf... assertions
Closes gh-37964
2023-10-19 20:17:26 -07:00
Phillip Webb 93b562e632 Fix PulsarProperties lookupTimeout
Prefer `null` to `-1` for the default timeout.

See gh-34763
2023-10-18 20:52:12 -07:00
Andy Wilkinson ec6415f04b Add SSL bundle support to Apache Kafka auto-configuration
Closes gh-37629
Co-authored-by: Scott Frederick <sfrederick@vmware.com>
2023-10-18 16:34:28 -05:00
Andy Wilkinson 851e6def76 Fix tests on Windows
See gh-37808
2023-10-18 14:08:41 +01:00
Andy Wilkinson 02c49b0287 When virtual threads are enabled, configure Pulsar to use them
Closes gh-36347
2023-10-17 15:59:41 +01:00
Andy Wilkinson d796087dfa Polish "Add properties for configuring EnumFeature and JsonNodeFeature"
See gh-37885
2023-10-16 15:39:25 +01:00
Eddú Meléndez 8edb4b9729 Add properties for configuring EnumFeature and JsonNodeFeature
Both `EnumFeature` and `JsonNodeFeature` implement `DataTypeFeature`
which was recently added in Spring Framework. This commits introduces
support to allow the configuration via properties.

See spring-projects/spring-framework#31380

See gh-37885
2023-10-16 15:00:32 +01:00
Andy Wilkinson 19fd88b25b Implement SSL hot reload for Netty and Tomcat
Closes gh-37808
2023-10-16 14:08:26 +01:00
Brian Clozel 339f75d309 Fix GraphQL WebSocket HandlerMapping bean ordering
Prior to this commit, the GraphQL WebSocket HandlerMapping bean would be
ordered at position "2", before the RouterFunction variant defined by
Spring Framework at position "3".

Since then, the Spring Framework team changed the default order value
for this one at "-1", see spring-projects/spring-framework#30278.
This prevents the WebSocket upgrade, as the request is handled by the
RouterFunction instead of the WebSocket handler.

This commit updates the handlermapping order and introduces a test to
prevent issues in the future.

Fixes gh-37892
2023-10-16 12:11:31 +02:00
Andy Wilkinson 932fe4fcf8 Polish "Avoid ObjectMappear creation in WebSocketMessagingAutoConfiguration"
See gh-37861
2023-10-13 10:41:07 +01:00
Johnny Lim 5397ad0822 Avoid ObjectMappear creation in WebSocketMessagingAutoConfiguration
See gh-37861
2023-10-13 10:39:51 +01:00
Andy Wilkinson db50de3c1d Upgrade to MongoDB 4.11.0
Closes gh-37874
2023-10-13 09:14:17 +01:00
Andy Wilkinson 6fbc328b4c Polish "Add support for configuring non-standard JMS acknowledge modes"
See gh-37576
2023-10-12 10:56:43 +01:00
Vedran Pavic d72fb8e127 Add support for configuring non-standard JMS acknowledge modes
Prior to this commit, `spring.jms.listener.session.acknowledge-mode`
and `spring.jms.template.session.acknowledge-mode` accepted only a
predefined set of values representing standard JMS acknowledge modes.

This commit adds support for also using arbitrary integer values to
these configuration properties, which allows vendor-specific JMS
acknowledge modes to be configured.

See gh-37576
2023-10-12 08:36:30 +01:00
Scott Frederick 5556739c8c Add SSL bundle support to Rabbit auto-configuration 2023-10-11 15:39:51 -05:00
Andy Wilkinson bdaf7a7603 Merge branch '3.1.x'
Closes gh-37830
2023-10-11 15:06:09 +01:00
Andy Wilkinson 411586347c Merge branch '3.0.x' into 3.1.x
Closes gh-37829
2023-10-11 15:04:21 +01:00
Andy Wilkinson 781ac2ece2 Merge branch '2.7.x' into 3.0.x
Closes gh-37828
2023-10-11 15:02:36 +01:00
Andy Wilkinson 5a75fae23b Polish "Polish"
See gh-37745
2023-10-11 14:58:04 +01:00
Johnny Lim 303015ea2d Polish
See gh-37745
2023-10-11 14:57:38 +01:00
Moritz Halbritter 6874a2fb9a Polish "Remove @ConditionalOnMissingBean from RestTemplateBuilderConfigurer"
See gh-37746
2023-10-11 14:03:12 +02:00
saravanakumar Ramasamy 882e29dc7f Remove @ConditionalOnMissingBean from RestTemplateBuilderConfigurer
See gh-37746
2023-10-11 13:39:44 +02:00
Phillip Webb 4ab104f5af Use type safe JdbcClient query
Update `JdbcClientAutoConfigurationTests` to use a type safe query
since Spring Framework now returns `Object` types when no type is
specified (see Spring Framework issue 31403).

See gh-37710
2023-10-10 16:29:37 -07:00
Andy Wilkinson 1d410dccea Adapt to breaking API change in Framework
See gh-37710
2023-10-10 17:21:33 +01:00
Andy Wilkinson 8a97ff31ae Merge branch '3.1.x'
Closes gh-37806
2023-10-10 11:28:00 +01:00
Andy Wilkinson 1087827b9a Merge branch '3.0.x' into 3.1.x
Closes gh-37805
2023-10-10 11:27:37 +01:00
Andy Wilkinson 5fcdee6bb5 Merge branch '2.7.x' into 3.0.x
Closes gh-37804
2023-10-10 11:26:39 +01:00
Andy Wilkinson 6df5389d76 Use RedisSeralizer.java(ClassLoader) factory method
Closes gh-37800
2023-10-10 11:25:22 +01:00