Commit Graph

119 Commits

Author SHA1 Message Date
Phillip Webb
9e1c78da99 Update copyright year of changed files 2021-06-08 18:03:46 -07:00
Madhura Bhave
b26e842050 Configure CORS in default security configuration for MVC
Fixes gh-11987
2021-05-19 14:40:57 -07:00
Andy Wilkinson
444474926c Configure JTA tests to write logs beneath build/
Closes gh-26440
2021-05-14 11:40:43 +01:00
Andy Wilkinson
2dd94b5554 Polish "Use try-with-resources statement"
See gh-26449
2021-05-13 11:37:10 +01:00
weixsun
5ba9db391f Use try-with-resources statements
See gh-26449
2021-05-13 11:36:14 +01:00
Phillip Webb
f29c707e6c Increase SampleSessionApplicationTests timeout
Increase timeout in `SampleSessionApplicationTests` to fix flaky local
builds.
2021-04-13 21:05:26 -07:00
Andy Wilkinson
4d3d56abfe Try to stabilize SampleSessionWebFluxApplicationTests
userDefinedMappingsSecureByDefault in
SampleSessionWebFluxApplicationTests may fail with an NPE if the
session times out before the initial response is sent due to the absence
of a SESSION cookie in the response. The test uses a short session
timeout (2 seconds) and we've seen the problem occur on CI when,
presumably, a noisy neighbour has caused some CPU starvation.

This commit increases the timeout to 5 seconds to reduce the chance of
a short period of CPU starvation causing the test to fail.

Closes gh-25572
2021-03-10 14:06:40 +00:00
Andy Wilkinson
8f72ca6521 Use ResourceConfig customization to register endpoints with Jersey
Previously, actuator endpoints were registered with Jersey upon
injection of the ResourceConfig bean into a registrar class rather than
using a ResourceConfigCustomizer. This was done to fix a problem
when running the Actuator on a separate port where the main application
context's customizers were also applied to the management context,
breaking the singleton contract for those resources. This approach
meant that the registration could be performed at any point after the
ResourceConfig had been created. When Jersey's configured as a Filter
this resulted in the registration failing as the attempt was being made
after the Filter lifecyle callbacks which make the ResourceConfig
immutable.

This commit reworks the endpoint registration to be performed using a
ManagementContextResourceConfigCustomizer, a resource config customizer
that's only applied to the ResourceConfig that's used by the Actuator.
When there's a separate management context, this ResourceConfig is
created by the Actuator's auto-configuration and the management context
resource config customizers are applied to it during its creation. The
main application's customizers are not applied. When the actuator is
using the same context as the main application, this ResourceConfig is
created by the main application. In this case a
ResourceConfigCustomizer is defined that delegates to all
ManagementContextResourceConfigCustomizers, allowing them to register
the actuator endpoints with the main ResourceConfig.

Fixes gh-25262
2021-02-26 14:25:24 +00:00
dreis2211
8bacbff629 Remove spring-boot-smoke-test-jta-jndi
See gh-25434
2021-02-25 18:02:25 +00:00
Andy Wilkinson
67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb
939b5dfc26 Add junit-platform-launcher dependency
Update `build.gradle` files to ensure that `junit-platform-launcher` is
a `testRuntimeOnly` dependency. This ensures that tests can be run from
Eclipse.

Closes gh-25074
2021-02-01 15:31:28 -08:00
Madhura Bhave
9928d74a9e Revert fix to enable cors for actuator endpoints
The fix causes a Jersey application to fail in the absence
of a `CorsFilter` or `CorsConfigurationSource` bean.

See gh-11987
2021-01-04 12:25:43 -08:00
Madhura Bhave
09e07428cc Configure CORS in default security configuration for MVC
Fixes gh-11987
2020-12-16 14:55:36 -08:00
Phillip Webb
5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb
837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
Stephane Nicoll
9e901b6e07 Upgrade to Testcontainers 1.15.0
Closes gh-24103
2020-11-10 16:24:16 +01:00
Stephane Nicoll
23ad2b4156 Rationalize Testcontainers image versions
This commit rationalizes the Docker image names used in integration
tests.

Closes gh-24107
2020-11-10 16:04:27 +01:00
Stephane Nicoll
b7a8b0f19b Hacking
See gh-23740
2020-10-20 09:32:40 +02:00
Phillip Webb
ba2ab3363b Merge branch '2.2.x' into 2.3.x 2020-08-18 15:38:53 -07:00
Phillip Webb
4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Stephane Nicoll
980ddcffd0 Merge branch '2.2.x' into 2.3.x
Closes gh-22849
2020-08-10 16:05:13 +02:00
Stephane Nicoll
dd9c9fd171 Polish "Migrate legacy endpoint that have a dash in their id"
See gh-21615
2020-08-10 14:53:18 +02:00
Gabriele Bianchet-David
0f9f10f97e Migrate legacy endpoint that have a dash in their id
See gh-21615
2020-08-10 14:42:46 +02:00
Andy Wilkinson
8f27ad9726 Remove version from name of Ant-built jar
Previously, the project version was included in the name of the
Ant-built jar and the integration test assumed that there would be a
single jar in the output directory. This assumption did not hold true
if the project's version had changed and the project had been built
again without a clean. This resulted in two jars, one for the previous
version and one for the current version, in the output directory. This
caused a test failure.

This commit updates the build.xml to remove the version from the name
of the Ant-built jar and updates the integration test to find it.

Closes gh-22782
2020-08-07 09:49:14 +01:00
Andy Wilkinson
4a828c7db1 Merge branch '2.1.x' into 2.2.x 2020-07-25 09:10:50 +01:00
Andy Wilkinson
0de466e06e Require dependency on s-b-dependencies to use its constraints
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.

This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.

Fixes gh-21911
2020-06-16 08:50:21 +01:00
Phillip Webb
29f5468ada Use java 8 compiler
Update Ant smoke test to explicitly use Java 8.
2020-06-11 12:26:08 -07:00
Andy Wilkinson
6e68101b9f Upgrade to Postgresql 42.2.13
Closes gh-21859
2020-06-10 17:04:03 +01:00
Andy Wilkinson
4fdd1a64c9 Merge branch '2.2.x' into 2.3.x
Closes gh-21718
2020-06-05 13:41:21 +01:00
Andy Wilkinson
1a52009cfb Migrate CustomServletPathSampleActuatorTests to JUnit Jupiter
Closes gh-21717
2020-06-05 13:40:30 +01:00
dreis2211
b498d3903f Upgrade to Testcontainers 1.14.2
See gh-21581
2020-05-27 14:49:09 +02:00
Andy Wilkinson
3f56f97e03 Merge branch '2.2.x'
Closes gh-21472
2020-05-15 16:21:33 +01:00
Andy Wilkinson
4a896f2272 Merge branch '2.1.x' into 2.2.x
Closes gh-21471
2020-05-15 16:20:23 +01:00
Phillip Webb
038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Stephane Nicoll
c3c7fc0f43 Polish smoke test with removal of View support in Couchbase
See gh-21383
2020-05-11 16:17:18 +02:00
Scott Frederick
a30740f8d2 Separate server properties for message and errors
Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
2020-04-29 17:56:47 -05:00
Stephane Nicoll
ee913503b4 Tolerate Hazelcast 4
This commit updates HazelcastHealthIndicator and
HazelcastCacheMeterBinderProvider so that they work with
Hazelcast 4 while retaining compatibility with Hazelcast 3. Reflection
is used when necessary.

This commit also adds a smoke test that validates those features are
working when Hazelcast 4 is on the classpath.

Closes gh-21169
2020-04-29 13:39:54 +02:00
Stephane Nicoll
5afe4743cb Remove deprecated configuration properties
This commit removes the following deprecated properties:

* `server.connection-timeout`
* `server.use-forward-headers`
* `server.jetty.max-http-post-size`
* `server.tomcat.max-http-post-size`

Closes gh-20991
2020-04-19 15:49:05 +02:00
Scott Frederick
70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
2020-04-16 10:46:36 -05:00
Phillip Webb
ed2d90248c Rename singleSignOn property to singlesignon
Rename the SAML `singleSignOn` nested property to `singleSignOn` so
that we don't get problems when using uppercase environment variable
names.

See gh-20584
2020-04-07 14:14:58 -07:00
Stephane Nicoll
b7ac83a830 Fix typo 2020-04-03 17:03:57 +02:00
Madhura Bhave
8659102650 Add configuration options for SAML authentication requests
Closes gh-20584
2020-04-02 13:19:56 -07:00
Phillip Webb
9795262dc1 Polish 2020-04-01 11:20:56 -07:00
Stephane Nicoll
960ab159e4 Document how to initialize a database with R2DBC
This commit adds a section to the reference guide on how to initialize
a database using R2DBC. 2 smoke tests are also added to validate this
behaviour with Flyway and Liquibase.

Closes gh-20742
2020-03-31 13:15:06 +02:00
Phillip Webb
16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
Stephane Nicoll
579a6ac254 Adapt tests for support for Java 14
See gh-20576
2020-03-19 14:54:33 +01:00
Stephane Nicoll
5893786cbb Polish "Add 'threads' configuration group for embedded containers"
See gh-19475
2020-03-19 13:13:45 +01:00
Stephane Nicoll
988d650304 Adapt server not running check
The upgrade to the Couchbase SDK v3 changed how errors are reported
when the cluster is not available. This commit updates the check to
look for the new exception in the hope a more solid check can be found
shortly.
2020-03-17 17:55:57 +01:00
Stephane Nicoll
abe43b2e83 Upgrade to Couchbase SDK v3
This commit upgrades to the Couchbase SDK v3 which brings the following
breaking changes:

* Bootstrap hosts have been replaced by a connection string and the
authentication is now mandatory.
* A `Bucket` is no longer auto-configured. The
`spring.couchbase.bucket.*` properties have been removed
* `ClusterInfo` no longer exists and has been replaced by a dedicated
API on `Cluster`.
* `CouchbaseEnvironment` no longer exist in favour of
`ClusterEnvironment`, the customizer has been renamed accordingly.
* The bootstrap-related properties have been removed. Users requiring
custom ports should supply the seed nodes and initialize a Cluster
themselves.
* The endpoints-related configuration has been consolidated in a
single IO configuration.

The Spring Data Couchbase provides an integration with the new SDK. This
leads to the following changes:

* A convenient `CouchbaseClientFactory` is auto-configured.
* Repositories are configured against a bucket and a scope. Those can
be set via configuration in `spring.data.couchbase.*`.
* The default consistency property has been removed in favour of a more
flexible annotation on the repository query methods instead. You can now
specify different query consistency on a per method basis.
* The `CacheManager` implementation is provided, as do other stores for
consistency so a dependency on `couchbase-spring-cache` is no longer
required.

See gh-19893

Co-authored-by: Michael Nitschinger <michael@nitschinger.at>
2020-03-17 17:00:09 +01:00
Andy Wilkinson
c917b61484 Reinstate leading / in default value for spring.liquibase.change-log
Unfortunately, while redundant for new applications, removing the
leading slash adversely affected existing application upon upgrades as
it caused Liquibase to re-apply every change log.

Closes gh-20177
2020-03-10 21:22:27 +00:00