Commit Graph

3090 Commits

Author SHA1 Message Date
Stephane Nicoll 033939e3c0 Add error metadata for Security-related keys 2017-09-14 15:47:20 +02:00
Andy Wilkinson 736a209e78 Upgrade to Spring Session 2.0.0.M4
Closes gh-10125
2017-09-14 06:38:51 +01:00
Brian Clozel 9dd3fb70e2 Remove Servlet-specific static locations
This commit removes the Servlet root context from the default values for
the `spring.resources.static-locations` configuration property. Servlet
and non-Servlet applications are sharing this property.

The Servlet root context is automatically configured as a resource
location for Spring MVC based applications.

Closes gh-9240
2017-09-13 15:31:05 +02:00
Stephane Nicoll 4670cc7795 Relax use of spring.session.store-type
This commit makes the "spring.session.store-type" property optional,
adding an additional check when it is not present that validates only
one supported implementation is available on the classpath.

As Spring Session has been modularized, the chance that multiple
implementations are available on the classpath are lower. When only
one implementation is present, we attempt to auto-configure it. When
more than one implementation is present and no session store is
configured, a NonUniqueSessionRepositoryException is thrown.

Closes gh-9863
2017-09-13 11:20:34 +02:00
Spring Buildmaster 30eb937a83 Next Development Version 2017-09-12 10:54:22 +00:00
Andy Wilkinson 6671a19cef Rework Lettuce configuration to use new client pooling config API
Closes gh-9538
2017-09-12 11:00:23 +01:00
Andy Wilkinson 02bc73b8e1 Polish 2017-09-12 10:23:39 +01:00
Andy Wilkinson 3882552b43 Polish 2017-09-12 10:22:35 +01:00
Phillip Webb 46dfe38b60 Rework security request matchers
Update the security request matchers so that a bean is no longer needed
when the matcher is used. Matchers can now be build by starting from
the `EndpointRequest` or `StaticResourceRequest` classes. For example:

http.authorizeRequests()
  .requestMatchers(EndpointRequest.to("status", "info")).permitAll()
  .requestMatchers(EndpointRequest.toAnyEndpoint()).hasRole("ACTUATOR")
  .requestMatchers(StaticResourceRequest.toCommonLocations()).permitAll()

Closes gh-7958
2017-09-12 00:11:29 -07:00
Phillip Webb 2e51b48cd9 Refactor actuator package locations
Restructure actuator packages to improve structure. The following
changes have been made:

 - Separate actuator and actuator auto-configuration into different
   modules.
 - Move endpoint code into `spring-boot-actuator`.
 - Move `Endpoint` implementations from a single package into
   technology specific packages.
 - Move `HealthIndicator` implementations from a single package into
   technology specific packages.
 - As much as possible attempt to mirror the `spring-boot` package
   structure and class naming in `spring-boot-actuator` and
   `spring-boot-actuator-autoconfigure`.
 - Move `DataSourceBuilder` and DataSource meta-data support from
   `spring-boot-actuator` to `spring-boot`.

Fixes gh-10261
2017-09-12 00:11:20 -07:00
Phillip Webb 0f99b29b1a Temporarily remove security matchers
Temporarily back out `SpringBootSecurity` to enable easier
package refactoring.

See gh-10261
2017-09-12 00:02:34 -07:00
Stephane Nicoll 1cd3b0cabe Remove auto-configuration for MapSessionRepository
This commit removes auto-configuration for Spring Session's simple in
memory support.

Closes gh-10253
2017-09-11 18:16:40 +02:00
Stephane Nicoll 6de364f2df Configure SessionRepositoryFilter with a custom SessionRepository
This commit makes sure that customizations on the
SessionRepositoryFilter are also applied when the user provides its
own SessionRepository.

Closes gh-10254
2017-09-11 17:54:34 +02:00
Stephane Nicoll b8eff0a0f6 Migrate tests to ApplicationContextRunner 2017-09-11 16:08:54 +02:00
Andy Wilkinson d92bc902b6 Merge branch '1.5.x' 2017-09-11 11:53:58 +01:00
Andy Wilkinson 5938df52ea Stop auto-config of MethodValidationPP triggering early init
Previously, if a user's configuration class provided a custom
Validator bean, that configuration class would be initialized very
early so that the Validator could be used to create the
auto-configured MethodValidationPostProcessor. This early
initialization could problems as it may prevent any of the
configuration class's dependencies from being post-processed.

This commit updates the injection of the Validator bean to be lazy,
thereby preventing the creation of the auto-configured
MethodValidationPostProcessor from triggering early initialization.

Closes gh-9416
2017-09-11 11:52:38 +01:00
Stephane Nicoll 46470b5196 Remove outdated additional metadata 2017-09-10 18:59:49 +02:00
Andy Wilkinson 2e19f0b3e5 Upgrade to Jersey 2.26
Closes gh-10217
2017-09-07 20:09:24 +01:00
Stephane Nicoll afc3fc50dc Merge branch '1.5.x' 2017-09-07 10:49:50 +02:00
Stephane Nicoll db18abc542 Fix Elasticsearch template condition if no client is defined
This commit makes sure to backoff if a Client bean is not available.

Closes gh-10143
2017-09-07 10:32:21 +02:00
Stephane Nicoll 5fc01880bc Polish 2017-09-07 09:55:50 +02:00
Johnny Lim 30262e3bc1 Polish
Closes gh-10168
2017-09-06 12:52:24 +02:00
Brian Clozel 27c1b5eb4c Add "onClass" condition on web server auto-configurations
This commit adds new Conditional annotations on auto-configurations
creating the Servlet/Reactive web servers. These conditions only depend
on request primitives used by the servers themselves and aren't
framework specific.

Closes gh-10163
2017-09-05 11:51:11 +02:00
Stephane Nicoll 2d79d63a9d Resume building against Spring Framework 5 snapshots
See gh-10123
Closes gh-9949
2017-09-05 09:48:17 +02:00
Andy Wilkinson 8df852bf71 Change default order of AutoConfigureOrder to 0
Previously, AutoConfigureOrder defaulted to Ordered.LOWEST_PRECEDENCE.
This made is impossible for an individual auto-configuration to
indicate that it wanted to go "last", i.e. after any
auto-configuration classes that didn't not specify an order, or
specified an order other than LOWEST_PRECEDENCE.

This commit changes to default to 0, allowing a single
 auto-configuration to easily indicate that it should go last.

 Closes gh-10142
2017-09-01 13:24:58 +01:00
Phillip Webb 80f023f996 Polish 2017-08-30 15:48:18 -07:00
Andy Wilkinson 7fc12bc8a3 Polish 2017-08-30 17:34:07 +01:00
Stephane Nicoll afda0ec129 Default Hibernate DDL auto to none with Flyway/Liquibase
This commit adds a strategy interface to specific if a given DataSource
has its schema managed. The Hibernate auto-configuration uses it to set
it to "none" if a mechanism to initialize the DataSource is
found and "create-drop" otherwise.

Both Flyway and Liquibase implements that strategy interface and
register it in the context accordingly.

Closes gh-9262
2017-08-30 12:42:24 +02:00
Johnny Lim db76112700 Polish
See gh-10109
2017-08-30 10:33:53 +02:00
Phillip Webb 2c97d3a5e9 Polish 2017-08-29 15:59:32 -07:00
Madhura Bhave 64ffcfc83f Document JWK property
Closes gh-10022
2017-08-29 12:51:14 -07:00
Stephane Nicoll 26b93e9454 Polish
See gh-10084
2017-08-29 14:03:50 +02:00
Stephane Nicoll 1897d76cda Merge branch '1.5.x' 2017-08-29 14:00:23 +02:00
Paul Vorbach 04ca7f137d Identify and fix incomplete assertions
Several calls to assertThat lacked a following assertion most often due
to wrong use of parenthesis.

See gh-10084
2017-08-29 13:49:28 +02:00
Johnny Lim 118f65556f Remove unused ExpectedExceptions
Closes gh-10101
2017-08-29 13:19:04 +02:00
Stephane Nicoll f52003f9ed Merge branch '1.5.x' 2017-08-29 09:25:05 +02:00
Madhura Bhave d03b8e14f1 Fix Windows test failures 2017-08-28 15:57:41 -07:00
Madhura Bhave 919dfd3f90 Remove unused properties and constants
Since the autoconfig totally backs off in the presence
of a WebSecurityConfigurerAdapter, there is no need to
order them ahead of/after the one provided by Spring Boot.

See gh-7958
2017-08-28 15:53:35 -07:00
Stephane Nicoll f6134a8862 Polish 2017-08-28 11:38:10 +02:00
Madhura Bhave 9b5e5f32e1 ClientId not always required for client credentials
Fixes gh-10013
2017-08-27 23:23:00 -07:00
Madhura Bhave e08ddbf838 Rework security autoconfiguration
This commit combines security autoconfigurations for
management endpoints and the rest of the application. By default,
if Spring Security is on the classpath, it turns on @EnableWebSecurity.
In the presence of another WebSecurityConfigurerAdapter this backs off
completely. A default AuthenticationManager is also provided with a user
and generated password. This can be turned off by specifying a bean of
type AuthenticationManager, AuthenticationProvider or UserDetailsService.

Closes gh-7958
2017-08-27 23:15:18 -07:00
Stephane Nicoll 77edebe094 Polish
Closes gh-10076
2017-08-25 16:34:19 +02:00
Stephane Nicoll 0d7cde7a5d Add deprecated metadata for Neo4j
See gh-10076
2017-08-25 16:33:52 +02:00
Stephane Nicoll 8a12a6ce36 Add deprecated metadata for Thymeleaf
See gh-10076
2017-08-25 16:28:18 +02:00
Stephane Nicoll 64231eaa9e Add deprecated metadata for Sendgrid
See gh-10076
2017-08-25 16:24:29 +02:00
Stephane Nicoll b57e66fbe5 Add deprecated metadata for Redis pool
See gh-10076
2017-08-25 16:20:50 +02:00
Stephane Nicoll b2950b568c Add deprecated metadata for datasource initialization
See gh-10076
2017-08-25 16:16:44 +02:00
Stephane Nicoll b574e5c1e6 Add deprecated metadata for Hibernate
See gh-10076
2017-08-25 16:09:02 +02:00
Stephane Nicoll dde652781e Add deprecated metadata for multipart
See gh-10076
2017-08-25 16:08:05 +02:00
Stephane Nicoll 1fefe24de8 Add deprecated metadata for server-related properties
See gh-10076
2017-08-25 16:05:58 +02:00
Stephane Nicoll 88656b31c9 Add deprecated metadata for Liquibase
See gh-10076
2017-08-25 15:01:32 +02:00
Stephane Nicoll e5c5fe9fc5 Add deprecated metadata for Flyway
See gh-10076
2017-08-25 14:58:54 +02:00
Stephane Nicoll 0a7a4c60aa Remove deprecated `error.path` property 2017-08-24 13:41:37 +02:00
Stephane Nicoll 4dc5022203 Polish 2017-08-24 13:41:14 +02:00
Stephane Nicoll f8e08f79ed Add DispatcherType enum for configuration purpose
This commit creates our own version of javax.servlet.DispatcherType for
configuration purpose as we can use the other one now the servlet api
is optional.

Closes gh-9856
2017-08-24 10:28:59 +02:00
Stephane Nicoll 8383648a14 Revert "Expose SpringBootCondition's logger"
Closes gh-10000
2017-08-23 17:04:16 +02:00
Johnny Lim 14c9f91aab Polish
Closes gh-10054
2017-08-22 16:28:03 +02:00
Stephane Nicoll 394371eb73 Polish "Harmonize database initializers"
Closes gh-9752
2017-08-18 18:14:22 +02:00
Vedran Pavic 14b7be8325 Harmonize database initializers
This commit updates database initializers configuration to enable them
automatically only when an embedded `DataSource` is used. Related
configuration properties have been updated to use a more expressive
`DatabaseInitializerMode` enum rather than `Boolean` flag.

See gh-9752
2017-08-18 14:55:48 +02:00
Stephane Nicoll 29078c78f2 Merge branch '1.5.x' 2017-08-18 12:08:20 +02:00
Stephane Nicoll fa037610f8 Add missing class check on Neo4jDataAutoConfiguration
Neo4jDataAutoConfiguration is meant to kick in when Spring Data Neo4J is
on the classpath. Yet, we were only checking for the presence of neo4j
itself and the transaction manager provided by spring-tx.

This commit makes sure to back off if Spring Data Neo4J is not present.

Closes gh-10038
2017-08-18 12:07:59 +02:00
Stephane Nicoll 30014785a4 Merge branch '1.5.x' 2017-08-17 13:29:24 +02:00
Stephane Nicoll dbaaf2a5fa Improve conditions on FreeMarkerWebConfiguration
This commit makes sure to prevent the Freemarker web auto-configuration
to kick in if `spring-webmvc` is not on the classpath.

Closes gh-10027
2017-08-17 13:28:45 +02:00
Stephane Nicoll fa85308ab9 Polish "Expose SpringBootCondition's logger"
Closes gh-10000
2017-08-14 11:44:40 +02:00
Oleg Zhurakousky 58826644d1 Expose SpringBootCondition's logger
See gh-10000
2017-08-14 11:42:14 +02:00
Andy Wilkinson fcec8a9b0b Merge branch '1.5.x' 2017-08-09 11:28:35 +01:00
Andy Wilkinson e08d09f5a3 Polish "Fix logged property names when initializing OAuth2 client"
See gh-9944
2017-08-09 11:26:56 +01:00
Christian Bühler 6babd41f19 Fix logged property names when initializing OAuth2 client
Closes gh-9944
2017-08-09 11:23:51 +01:00
Andy Wilkinson abf39915e8 Polish 2017-08-04 11:12:33 +01:00
Andy Wilkinson 5c06bd5ab9 Merge branch '1.5.x' 2017-08-03 21:23:28 +01:00
Johnny Lim 56f47e1a50 Polish
Closes gh-9938
2017-08-03 21:17:10 +01:00
Andy Wilkinson 7bd285dd93 Polish 2017-08-03 14:39:46 +01:00
Madhura Bhave ea087b9bac Move liquibase config properties to spring.liquibase
Closes gh-9897
2017-08-01 10:24:47 -07:00
Madhura Bhave f9e316306a Move Flyway config properties to spring.flyway
Closes gh-9896
2017-08-01 10:24:47 -07:00
Andy Wilkinson 7cc4410613 Merge branch '1.5.x' 2017-08-01 15:47:23 +01:00
Gytis Trikleris f43ad00129 Delay Narayana recovery manager until it's started explicitly
Closes gh-9641
2017-08-01 15:42:40 +01:00
Phillip Webb fd1dfbb247 Add missing TestPropertyValues 'apply' calls
Update a few usages of `TestPropertyValues` so that `apply` is called
consistently.
2017-07-31 20:56:35 -07:00
Phillip Webb e1602fe59a Polish 2017-07-31 20:46:56 -07:00
Eddú Meléndez 87ba8d2e14 Upgrade to Jackson 2.9.0
Closes gh-9912
2017-07-31 09:39:23 +02:00
Phillip Webb 30ff329e3d Polish 2017-07-28 10:11:49 -07:00
Stephane Nicoll ebbe29cc85 Migrate HazelcastJpaDependencyAutoConfigurationTests to context runner
This commit also makes sure to generate unique embedded data source and
disable datasource initialization as this is not required by those
tests.

See gh-9889
2017-07-28 11:05:09 +02:00
Stephane Nicoll 49d249bdf4 Disable Aop auto-config if aspectjweaver is not present
This commit adds an additional class check to AopAutoConfiguration as
it is main role is to configure `@EnableAspectJAutoProxy` which won't
work properly if `aspectjweaver` is not present.

Closes gh-9880
2017-07-28 10:43:08 +02:00
Phillip Webb 9127c48fb5 Fixup warnings 2017-07-27 16:39:49 -07:00
Phillip Webb a869d25dbb Polish 2017-07-27 16:16:35 -07:00
Stephane Nicoll 22deceb7f2 Migrate tests to ApplicationContextRunner 2017-07-27 14:54:14 +02:00
Andy Wilkinson 56b817e8ad Merge branch '1.5.x' 2017-07-27 10:30:23 +01:00
Andy Wilkinson d62c26c971 Ensure that preinitialization has completed before run returns
Previously, background preinitialization was started in response to
an ApplicationEnvironmentPreparedEvent and would complete at an
undetermined time later. This opened a window where SpringApplication
run could return and background preinitialization could still be
in progress. If, within this window, something attempted to configure
the logging system, an IO failure could occur as logging on the
background preinitialization thread would attempt to use resources
that had been closed.

This commit updates BackgroundPreinitializer so that it waits for
preinitialization to have completed when it receives an application
ready or application failed event. This prevents SpringApplication
run from returning while preinitialization is still in progress,
closing the window described above.

With info level logging enabled it appears that background
preinitialization consistently completes before the application ready
event is published. As a result, waiting should have no adverse effect
on performance in normal circumstances. With logging configured such
that background preinitialization outputs a large volume of log
messages (enabling trace logging for the root logger, for example), it
will be slowed down sufficiently for waiting to be necessary.

Closes gh-5669
2017-07-27 10:18:21 +01:00
Andy Wilkinson 42eec50e90 Perform background preinitialization once per class loader
Background preinitialization triggers static initialization of a
number of components that are slow to initialize. As the
initialization is static, it's only necessary once per class loader.

Previously, a new background preinitialization thread would be
created and started for each ApplicationEnvironmentPreparedEvent.
This commit updates the preinitializer to only create and start the
thread if preinitialization has not already been started for the
current class loader.

Closes gh-9869
2017-07-27 10:18:21 +01:00
Spring Buildmaster 17a5bb0be4 Next development version 2017-07-27 08:00:21 +00:00
Phillip Webb 89ad0660d1 Make ApplicationContextRunner immutable
Update `ApplicationContextRunner` so that it is totally immutable.
Methods now return new instances rather than changing existing state.

See gh-9875
2017-07-26 17:50:34 -07:00
Phillip Webb ad9f28110c Make TestPropertyValues immutable
Update `TestPropertyValues` so that it is totally immutable. Methods
now return a new instance rather than changing existing state.

See gh-9875
2017-07-26 17:49:31 -07:00
Phillip Webb 07556cda51 Restructure `boot.test.context` package
Split up `org.springframework.boot.test.context` into distinct packages
for `runner` and `assertj`.

See gh-9875
2017-07-26 17:47:59 -07:00
Phillip Webb 497457c397 Rename ApplicationContextTester -> Runner
Rename `ApplicationContextTester` and related classes to
`ApplicationContextRunner` and refactor existing tests to use correctly
named variables.

See gh-9875
2017-07-26 17:46:06 -07:00
Andy Wilkinson 5616915621 Polishing 2017-07-26 17:40:29 +01:00
Stephane Nicoll 9891462ac4 Migrate test to WebApplicationContextTester 2017-07-26 11:25:04 +02:00
Spring Buildmaster 41c5c0e7c9 Next development version 2017-07-26 08:30:55 +00:00
Stephane Nicoll 996e6bf48c Reset Neo4j tests to use the default driver again
This commit resets the artificial use of the http driver now the bolt
driver doesn't check if the connection to the Neo4J server is valid
on startup.

See neo4j/neo4j-java-driver#380

Closes gh-9500
2017-07-26 10:06:36 +02:00
Andy Wilkinson 02e836b7a7 Allow Session's repository filter to be configured via the environment
Closes gh-8301
2017-07-25 09:26:14 +01:00
Emanuel Campolo 2626a3a795 Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible
using method references).

See gh-9781
2017-07-25 00:53:38 -07:00
Emanuel Campolo 798fe5ed53 Collapse catch clauses
Use multi-catch for exceptions whenever possible.

See gh-9781
2017-07-25 00:53:37 -07:00