Commit Graph

1620 Commits

Author SHA1 Message Date
Stephane Nicoll
ae095b2c1b Disable JMX Integration support if necessary
This commit fixes `IntegrationAutoConfiguration` to actually rely on the
auto-configured `MBeanServer` rather than attempting to create it again.

If JMX support is disabled, no attempt to register integration-related
MBeans is made.

Closes gh-5309
2016-03-29 11:27:24 +02:00
Stephane Nicoll
b1b84a358d Fix Artemis embedded mode condition
This commit prevents the Artemis embedded mode to kick-in if the
`EmbeddedJMS` class it not in the classpath. The previous condition would
match if only `artemis-server` was on the classpath while
`artemis-jms-server` is actually required.

Closes gh-5452
2016-03-21 11:55:59 +01:00
Spring Buildmaster
225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Phillip Webb
936a96746a Fix missing Javadoc @param 2016-02-25 22:13:03 -08:00
Phillip Webb
4fd778fed8 Polish CacheManagerCustomizers 2016-02-25 20:05:16 -08:00
Stephane Nicoll
ad57d99fe5 Cleanup HazelcastInstance in test
If a JCache provider is started with hazelcast and the default settings,
the underlying `HazelcastInstance` is disposed at the end of the
process, not when the `CacheManager` is closed.

This commit fixes the only test that use such setup.

See also https://github.com/hazelcast/hazelcast/issues/7606

Closes gh-5209
2016-02-25 14:25:28 +01:00
Andy Wilkinson
6075682e64 Polishing
- Code formatting
 - Javadoc warnings
 - Deprecation warnings
2016-02-24 17:05:54 +00:00
Stephane Nicoll
5febd497da Support customization of CacheManager
This commit allows to customize the auto-configured `CacheManager` by
exposing a bean of type `CacheManagerCustomizer`. The implementation may
reference the type of a `CacheManager` to determine in which case it has
to be invoked.

Several implementations can be provided and ordered using the regular
`Ordered` interface and `@Order` annotation.

Closes gh-5039
2016-02-24 14:00:38 +01:00
Stephane Nicoll
c4205d04b3 Rework ListenerContainerFactory configurers
Rework commit b726974 to avoid exposing setters that would permit anyone
to change Spring Boot's defaults. Also, since these are configurers of a
specific instance, they should be named accordingly.

Closes gh-5138
2016-02-23 14:43:33 +01:00
Andy Wilkinson
b4cda625c4 Break cycle caused by JndiDataSourceAutoConfiguration
There's a long cycle when Spring Data REST, Data JPA and Actuator
are used in an app that retrieves its DataSource from JNDI. The cycle
is:

- WebMvcAutoConfiguration
- HttpMessageConverters
- MappingJackson2HttpMessageConverter (needs an ObjectMapper)
- SpringBootRepositoryRestMvcConfiguration
- ObjectMapper
- RepositoryResourceMappings (part of a custom Jackson module)
- Repositories
- EntityManagerFactory (Triggered by application's Spring Data JPA repository)
- HibernateJpaAutoConfiguration
- JndiDataSourceAutoConfiguration
- MBeanExporter (Used to prevent export of DataSource MBean that's already in JMX)
- EndpointMBeanExportAutoConfiguration
- ObjectMapper (Used to format JSON produced by the exported endpoints)

Spring Data Rest caused the ObjectMapper to depend on JPA. JPA depends
on the DataSource. JnidDataSourceAutoConfiguration depends on the
MBeanExporter. Actuator's MBeanExporter requires an ObjectMapper to
produce JSON strings.

This commit breaks the cycle by making JndiDataSourceAutoConfiguration
access the MBeanExporter lazily. Rather than using `@Lazy`. which does
not work with `@Autowired(required=false)`, the application context
is injected and the MBeanExporter is retrieved manually when it is
needed.

Closes gh-4980
2016-02-22 16:01:23 +00:00
Stephane Nicoll
094f7aa20e Fix Hazelcast Cache auto-configuration ordering
Spring Boot supports the automatic configuration of an additional
HazelcastInstance if one already exists and an explicit property has been
set to use a different configuration for caching. So three cases are
supported really: no `HazelcastInstance` exists so we need to create one
anyway or an `HazelcastInstance` already exists; in that latter case, we
should either reuse it or create a new one.

Unfortunately, the conditions that checked those three use cases were
not ordered consistently and we could easily get in a situation where
both conditions were evaluated.

This commit makes sure that we  first check if an `HazelcastInstance`
exists and then (and only then) we create the missing `HazelcastInstance`
used for caching. The tests have also been improved to validate the
proper `HazelcastInstance` is used for caching.

Closes gh-5181
2016-02-22 14:28:34 +01:00
Phillip Webb
a9afe0a944 Formatting 2016-02-19 16:07:10 -08:00
Andy Wilkinson
d69e0486c1 Allow Thymeleaf's LayoutDialect to be overridden
Closes gh-5151
2016-02-15 21:27:34 +00:00
Stephane Nicoll
b726974bca Allow to easily customize ListenerContainerFactory
Previously, if one wants to create a custom `JmsListenerContainerFactory`
or `RabbitListenerContainerFactory`, a bunch of code from the auto-
configuration must be duplicated.

This commit introduces two services to configure such factory for JMS
and AMQP with the same sensible defaults that were applied by the
auto-configufrations.

Closes gh-5138
2016-02-12 16:16:44 +01:00
Andy Wilkinson
fc2e51a773 Preserve ordering when auto-configuring WebSocket MessageConverters
Previously, WebSocketMessagingAutoConfiguration added a single
additional converter. This was a MappingJackson2MessageConverter
configured with the auto-configured ObjectMapper.
AbstractMessageBrokerConfiguration places additional converters before
any of the default converters. This meant that the auto-configuration
had the unwanted side-effect of changing the ordering of the
converters. A MappingJackson2MessageConverter was now first in the
list, whereas, by default, it's last in the list after a
StringMessageConverter and a ByteArrayMessageConverter.

This commit updates WebSocketMessagingAutoConfiguration so that it
switches off the registration of the default converters and registers
a StringMessageConverter, ByteArrayMessageConverter and
MappingJackson2MessageConverter in that order. A test has been
added to verify that the types of these three converters match
the types of the default converters. A second test that verifies
that String responses are converted correctly has also been added
alongside the existing test that verified the behaviour for JSON
responses.

Closes gh-5123
2016-02-11 14:18:24 +00:00
Stephane Nicoll
c10943c653 Polish Javadoc
Closes gh-4936
2016-02-11 15:05:07 +01:00
Stephane Nicoll
2a8a3741f5 Merge DriverClassNameProvider in DatabaseDriver
DriverClassNameProvider is unused but was probably restored by a merge
commit at some point. It wasn't obvious and updated that class rather
than `DatabaseDriver`.

This commit updates `DatabaseDriver` and deletes
`DriverClassNameProvider`.

Closes gh-5076
2016-02-10 14:28:58 +01:00
Johnny Lim
9a31e02806 Polish
Closes gh-5013
2016-01-24 19:13:01 +01:00
Spring Buildmaster
504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb
e520c47c4f Refine messages.properties detection
Update `ResourceBundleCondition` to only enable the messages source
if `messages.properties` (and not `messages*.properties`) exists. This
operation is much faster that performing a pattern match since a full
jar entry scan is not required.

Since adding `messages.properties` is good practice and this change
allows us to delete the custom `PathMatchingResourcePatternResolver`
it seems like a fine compromise to make.

Fixes gh-4930
See gh-4811
2016-01-21 15:13:33 -08:00
Phillip Webb
cf93f84e87 Polish 2016-01-21 14:15:49 -08:00
Phillip Webb
93c3b22bb4 Merge branch '1.2.x' 2016-01-21 11:14:20 -08:00
Phillip Webb
c71aa32fbb Polish 2016-01-21 10:53:25 -08:00
Phillip Webb
af36bf6864 Remove TODO in FlywayAutoConfiguration
Now tracked by gh-4995
2016-01-21 10:42:33 -08:00
Stephane Nicoll
44f508208a Merge branch '1.2.x' 2016-01-21 14:16:24 +01:00
Stephane Nicoll
58ebfdcbd3 Polish contribution
Closes gh-4973
2016-01-21 14:10:35 +01:00
Jacques-Etienne Beaudet
a749855cb5 Allow indexed access of flyway.locations
This commit allows to use the `flyway.locations` in an indexed fashion
(i.e. typically in YAML configuration).

See gh-4973
2016-01-21 14:08:39 +01:00
Andy Wilkinson
e33221aae1 Configure existing Jersey servlet registration created by the SCI
When a Jersey app is deployed to a standalone container, Jersey’s
ServletContainerInitializer will run and register a servlet for a class
annotated with @ApplicationPath. If Jersey’s ServletContainerInitializer
runs before Spring’s, this servlet will take precedence over the
servlet registered by JerseyAutoConfiguration and will therefore not be
configured with any init parameters specified using spring.jersey.init

For the case where Jersey’s SCI runs first, this commit updates
JerseyAutoConfiguration to examine the servlet context for an existing
registration of Jersey’s servlet (Jersey names the registration using
the fully-qualified name of the ResourceConfig subclass). If a
registration is found its init parameters are configured using the
configuration provided by spring.jersey.init.

For the case where Spring’s SCI runs first, this commit updates
JerseyAutoConfiguration so that it names its registration using the
fully-qualified name of the ResourceConfig sub-class. This allows
Jersey’s SCI to find the existing registration rather than attempting
to configure its own.

Closes gh-2471
2016-01-21 11:48:31 +00:00
Stephane Nicoll
9f728b3d59 Fix wrong import 2016-01-21 10:37:40 +01:00
Stephane Nicoll
ea8e0cfc48 Support for simple numeric Flyway version
While Flyway's `MigrationVersion` is a String value, a simple "0" is
also a valid number. When such value is not wrapped in YAML, an integer
is injected rather than a String which leads to a failure as we can't
convert it.

This commit updates the `StringToMigrationVersionConverter` to also
supports conversion from a Number. This is a convenience for users
using YAML for configuration

Closes gh-4981
2016-01-21 10:26:12 +01:00
Andy Wilkinson
6f8d4c77e6 Handle multiple ContextRefreshedEvents in BackgroundPreinitializer
The same initializer will receive multiple ContextRefreshedEvents
when their is an application context hierarchy. This commit updates
the initializer to correctly handle multiple ContextRefreshedEvents
and only act upon the first that it receives.

See gh-4871
2016-01-20 22:23:57 +00:00
Andy Wilkinson
992e90f43d Ensure that background preinit has completed before refresh returns
This commit is a continuation of the changes made in b85b608. It
addresses an additional problem when testing applications where two
contexts are refreshed in quick succession. In this scenario, it
was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
second is refreshed and resets the logger context.

This commit updates BackgroundPreinitializer so that, upon receipt of
a ContextRefreshedEvent, it waits for preinitialization to have
completed. In the scenario described above, this ensures that
preinitialization has completed before the call to refresh() for the
first context returns, thereby preventing it from running in parallel
with the refresh of the second context.

Closes gh-4871
2016-01-20 21:56:54 +00:00
Stephane Nicoll
179467bdd9 Make HazelcastJpaDependencyAutoConfiguration public
If Both Hazelcast and Hibernate are available, Spring Boot takes the
opinion that Hazelcast can be used for 2nd level caching and therefore
need to start before Hibernate.

Unfortunately, some users require Hibernate in some of their hazelcast
use case so the link is actually reversed. One way for such user is to
disable the auto-configuration that deals with this link. This class is
now public so that users can locate them and exclude them if necessary.

Closes gh-4960
2016-01-20 18:40:45 +01:00
Andy Wilkinson
b85b60828c Perform background preinitialization after logging system setup
Previously, BackgroundPreinitializer would kick off preinitialization
on a separate thread in response to an ApplicationStartedEvent. This
work would then race with the logging system being set up in response
to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
this race is problematic. As part of Logback’s setup,
LoggerContext.stop() is called. This calls LoggerContext.reset() which
can fail with a ConcurrentModificationException if another thread tries
to create a Logger at the same time. This is a known bug in Logback [1].

This commit updates BackgroundPreinitializer to respond to
an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
called after LoggingApplicationListener has responded to the same event
by initializing the logging system.

Closes gh-4871

[1] http://jira.qos.ch/browse/LOGBACK-397
2016-01-20 11:49:57 +00:00
Andy Wilkinson
112b707b67 Ensure that MongoClient is not created with a null credentials list
Mongo’s 2.x driver allowed the credentials list to be null, however
the 3.x driver requires an empty list instead. The behaviour of the 2.x
driver is the same whether the client is created with a null credential
list or an empty credential list.

This commit aligns with the requirements of the 3.x driver by ensuring
that we never pass in a null credential list when creating the client.

Closes gh-4076
2016-01-18 16:06:38 +00:00
Stephane Nicoll
7d975ecd2e Polish 2016-01-18 10:53:04 +01:00
Stephane Nicoll
af5d765a08 Enable resource chain if webjars locator is present
Webjars locator is a good hint that the resource chain should be
enabled. The sole presence of the library now enables the resource chain
unless the configuration states otherwise.

Closes gh-4403
2016-01-18 10:35:26 +01:00
mnhock
8f1f8dd680 Use entrySet() rather than using keySet() and then calling get(key)
Closes gh-4813
2016-01-15 17:01:58 +00:00
Andy Wilkinson
1107079683 Merge branch '1.2.x' 2016-01-15 11:20:01 +00:00
Andy Wilkinson
b56eef236e Close Reader used by MustacheViewResolver when compiling a Template
Previously, MustacheViewResolver would create an InputStreamReader
that wraps the template Resource's InputStream but would fail to close
the Reader. When the InputStream was a FileInputStream, this caused
the resolver to leak file handles.

This commit updates the resolver to close the Reader once the Template
has been compiled, thereby allowing any underlying resources to be
cleaned up immediately, rather than having to wait for the JVM to exit.

Closes gh-4921
2016-01-15 11:19:24 +00:00
Andy Wilkinson
24fd503743 Merge branch '1.2.x' 2016-01-14 15:57:13 +00:00
Andy Wilkinson
b99739212a Correct the name of MySQL's XADataSource implementation
Closes gh-4942
2016-01-14 15:53:00 +00:00
Andy Wilkinson
27a81e1463 Complete static final logger changes that were started in ec2f33f9
This commit completes the changes to consistently used static final
fields for Log instances that were started in ec2f33f9. Specifically it:

 - Removes this. when accessing logger fields that are now static
 - Renames some fields from log to logger
 - Makes some logger fields static

See gh-4784
2016-01-13 16:22:35 +00:00
Andy Wilkinson
150a6f0f5c Switch off Security Filter auto-config when spring-security-config is absent
SecurityFilterAutoConfiguration uses SecurityProperties which uses
SessionCreationPolicy from spring-security-config. This commit makes
SecurityFilterAutoConfiguration conditional on SessionCreationPolicy,
thereby preventing a startup failure if spring-security-web is on the
classpath but spring-security-config is not.

Closes gh-4919
2016-01-13 15:01:31 +00:00
Phillip Webb
d2fed8bb07 Polish 2016-01-13 11:58:42 +00:00
Stephane Nicoll
72754c27b2 Allow to override BasicBatchConfigurer
Issue #4533 was supposed to make BasicBatchConfigurer public again but
unfortunately only the class visibility was changed. This commit makes
sure it can be overridden.

Closes gh-4888
2016-01-05 17:53:42 +00:00
Stephane Nicoll
b1c2226e23 Merge branch '1.2.x'
# Conflicts:
#	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java
2015-12-28 13:51:18 +01:00
Stephane Nicoll
12cefd2c2b Only enable Tomcat's websocket support on Java7+
Tomcat's websocket support requires Java7 or later. That commit makes
sure to register its support only when such requirement is met.

Closes gh-4846
2015-12-28 13:49:12 +01:00
Spring Buildmaster
8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Stephane Nicoll
bb736e255b Fix SNAPSHOT version 2015-12-17 14:15:14 +01:00
Phillip Webb
945b42588b Refine server.server-header documentation
Fixes gh-4461
2015-12-16 21:11:49 +00:00
Kirill Vlasov
ec2f33f986 Make loggers private static final
Apply consistency across all static loggers.

Closes gh-4784
2015-12-16 21:02:53 +00:00
Kirill Vlasov
786aacf2e9 Use Collections.isEmpty() instead of .size() == 0
Ensure that Collections.isEmpty() is used to check if there are no
elements in a collections. This is more explicit and can be faster than
calling .size().

Closes gh-4783
2015-12-16 20:59:33 +00:00
Andy Wilkinson
3352e60631 Remove use of diamond operator in tests so that they’re Java 6 compatible
See gh-4163
2015-12-16 11:40:17 +00:00
Andy Wilkinson
037a27e257 Add a workaround for DATACMNS-776
Spring Data’s web support includes a handler method argument resolver,
ProxyingHandlerMethodArgumentResolver, that inaccurately claims that it
can handle all interface handler method arguments. This causes problems
for handler methods that take Spring Mobile’s Device as an argument as
the proxied Device instance does not behave correctly.

This commit works around the problem by assigning an order to the 
WebMvcConfigurerAdapter that registers Spring Mobile’s argument resolver
with Spring MVC. This ordering ensures that Spring Mobile’s resolver
takes precedence over Spring Data’s for Device arguments.

Closes gh-4163
2015-12-16 11:13:34 +00:00
Jacob Swanson
ae565b805a Fix mail connection test exception message
Closes gh-4780
2015-12-16 10:25:47 +00:00
Artur Konczak
786f025818 Auto-configure Elasticsearch converter and context
Extend ElasticsearchDataAutoConfiguration to also configure an
ElasticsearchConverter and SimpleElasticsearchMappingContext both
of which are required for Spring Data REST.

Closes gh-3847
2015-12-15 20:03:41 +00:00
Andy Wilkinson
bcaee0ebee Perform initialization in foreground if BackgroundPreinitializer fails
Google App Engine probits the creation of new threads. This leads to a
failure in BackgroundPreinitializer when the single thread executor
attempts to create its single thread.

This commit enhances the existing fail safety of
BackgroundPreinitializer by catching any exceptions thrown while
creating the executor and submitting the tasks to it. Any initialisation
that has not performed in the background will be performed in the
foreground instead.

Closes gh-4662
2015-12-15 14:59:24 +00:00
Phillip Webb
543a746de7 Fix checkstyle issues
See gh-4763
2015-12-14 19:07:48 +00:00
Phillip Webb
5719fab142 Merge branch '1.2.x' 2015-12-14 18:58:25 +00:00
Phillip Webb
edb16a13ee Protect against SpEL injections
Prevent potential SpEL injection attacks by ensuring that whitelabel
error view SpEL placeholders are not recursively resolved.

Fixes gh-4763
2015-12-14 18:49:59 +00:00
Andy Wilkinson
5cb9b9a9e9 Merge branch '1.2.x' 2015-12-14 16:49:55 +00:00
Andy Wilkinson
7d5cc3da63 Stop ActiveMQ pooled connection factory when context is closed
Previously, ActiveMQ's pooled connection factory was not closed as
part of the application context being closed. This would leave
non-daemon threads running which could cause shutdown to hang unless
the JVM itself was shutting down (in which case a shutdown hook would
stop the pool).

This commit configures each pooled connection factory bean with a
custom destroy method so that the pool is stopped as part of the
application context being closed. To allow the destroy method to only
be declared when the connection factory is pooled, the bean method
has been split into two; one for pooled and one for non-pooled. This
is a partial backport of the changes made in bedf2edf.

Closes gh-4748
2015-12-14 16:49:18 +00:00
Eddú Meléndez
1b81d9f0b5 Add support for server.server-header property
Add a `server.server-header` property which can be used to override the
`server` header usually sent back automatically by Tomcat/Jetty or
Undertow.

See https://www.owasp.org/index.php/Securing_tomcat for background.

Fixes gh-4461
Closes gh-4504
2015-12-12 21:24:29 +00:00
mnhock
fcf6e5d6eb Prefer valueOf() to create Number values
Update Long/Integer constructor calls with `valueOf` which can make use
of global caches.

Closes gh-4688
2015-12-11 14:04:25 +00:00
Andy Wilkinson
0bb4de490d Allow any ExitCodeGenerator bean to switch of auto-configured bean
In bedf2edf, the return type of the auto-configuration method that
creates batch's ExitCodeGenerator was changed from ExitCodeGenerator
to JobExecutionExitCodeGenerator but the on missing bean condition
was left unchanged. This means that the auto-configured bean can
only be switched off by a JobExecutionExitCodeGenerator bean, rather
than any bean that implements ExitCodeGenerator.

This commit corrects the use of @ConditionalOnMissingBean to allow any
ExitCodeGenerator bean to switch off the auto-configured one.

Closes gh-4752
2015-12-11 11:07:33 +00:00
Phillip Webb
0489a3b4de Polish 2015-12-10 19:43:29 +00:00
Andy Wilkinson
4f7752d467 Merge branch '1.2.x' 2015-12-10 13:45:15 +00:00
Andy Wilkinson
ce541bebcf Align BasicErrorController’s HTML response status with non-HTML status
Previously, BasicErrorController would return the response status
set in the javax.servlet.error.status_code request attribute when
serving JSON but would also return a 200 OK response when serving
HTML. This didn’t cause much trouble when a person was browsing, but
proved problematic for machine clients that request text/html and care
about the response status. For example, the success handler would be
driven for an XHR request even though the response was really an error.

This commit updates BasicErrorController to set the response status for
text/html responses to match the status that it would use in an
application/json response.

Closes gh-4694
2015-12-10 13:40:16 +00:00
mnhock
9775d40822 Fix possible null pointer dereference
Closes gh-4685
2015-12-08 10:28:15 +01:00
Johnny Lim
ec7fed1ecc Polish
Closes gh-4677
2015-12-07 20:46:36 +01:00
Andy Wilkinson
91674b2c94 Don’t use Java 7 API in EmbeddedMongoAutoConfiguration
Closes gh-4630
2015-12-04 15:26:58 +00:00
Andy Wilkinson
c58ebae419 Bind embedded Mongo to configured host or loopback address
Previously, the auto-configuration for embedded Mongo did not specify
a bind IP so Mongo was started without one. This would lead to Mongo
binding to all available network interfaces. This caused some friction
with the Windows firewall as it would ask for permission every time
embedded Mongo was launched.

This commit updates the auto-configuration to use
spring.data.mongodb.host to configure the bind IP for embedded Mongo.
If spring.data.mongodb.host is null, the auto-configuration will use
the loopback address instead.

Closes gh-4630
2015-12-04 15:04:14 +00:00
Andy Wilkinson
007ec9e46b Make SecurityFilterAutoConfig work when SecurityAutoConfig is disabled
Previously, disabling SecurityAutoConfiguration could cause
SecurityFilterAutoConfiguration to fail if Spring Security’s filter
chain bean existing in the context. SecurityFilterAutoConfiguration
relies on SecurityProperties which is created by
SecurityAutoConfiguration. When SecurityAutoConfiguration is disabled,
there’s no SecurityProperties bean so SecurityFilterAutoConfiguration
would fail due to the missing dependency.

This commit updates SecurityFilterAutoConfiguration to create a
SecurityProperties bean if one does not already exist.

Closes gh-4525
2015-12-04 13:39:54 +00:00
Andy Wilkinson
ffd6e8d7eb Handle null security filter dispatcher types gracefully
See gh-4505
2015-12-02 14:00:30 +00:00
Andy Wilkinson
f47449c800 Remove Servlet API dependency from SecurityProperties
A dependency on the Servlet API (the filter's dispatcher types) causes
a failure when Spring Security is used in a non-web application.

This commit removes the dependency on javax.servlet.DispatcherType
in favour of using a Set of Strings. SecurityFilterAutoConfiguration,
which is only enabled for web applications, is the responsible for
converting each String to a DispatcherType.

Closes gh-4505
2015-12-02 10:50:11 +00:00
Andy Wilkinson
4260b0c765 Remove ignoreUnknownFields accidentally added in 524a328 2015-12-01 18:59:27 +00:00
Andy Wilkinson
524a32879f Allow security filter's dispatcher types to be configured via env
This commit adds a new property, security.filter-dispatcher-types
that can be used to configure the dispatcher types of Spring
Security's filter chain. The default remains unchanged.

Closes gh-4505
2015-12-01 17:50:31 +00:00
Stephane Nicoll
fc5e3d6441 Refine exception message
Closes gh-4569
2015-12-01 10:22:03 +01:00
Andy Wilkinson
40427cdb82 Separate Jersey WebApplicationInitializer from auto-configuration class
Previously, JerseyAutoConfiguration was a WebApplicationInitializer.
This was problematic as auto-configuration classes should not be ordered
(they should use AutoConfigureBefore etc instead) but the web
application initializer needs to be ordered so that it can run early and
configure Jersey before it runs.

This commit has moved the WebApplicationInitializer implementation into
a separate class so that it can be ordered independently of the
auto-configuration class. Note that the new class must be public for
the servlet container (Tomcat at least) to be able to instantiate it.

Closes gh-4527
2015-11-30 17:59:09 +00:00
Dave Syer
521ae35f56 Do not set order of ResourceServerConfiguration instances
The need to set the order of ResourceServerConfiguration was
a bad assumption. The value of the order seems strange as well
(-10), and a comment explaining it makes no sense (a resource
server normally wants its filter *after* not *before* the existing
auth server filter). Removing the bean post processor didn't
fail any tests.

In case there are multiple resource servers in the same context
there was also a problem that they ended up with the same order.
2015-11-28 12:24:03 +00:00
Stephane Nicoll
9d29ab73a4 Fix customization of database name
Previously, the `spring.datasource.name` property was ignored when Spring
Boot configures an embedded data source with a connection pool.

`EmbeddedDatabaseConnection` is now aligned to the purely embedded case
to take that property into account.

Closes gh-4586
2015-11-27 17:01:06 +01:00
Dave Syer
cccc3867eb Allow users to customize authentication entry point in OAuth2 SSO
The SsoSecurityConfigurer that gets added when a user has a custom
WebSecurityConfigurer with @EnableOAuth2Sso is quite opinionated, and
this is preventing users from custimizing the exception handling in the
customized UI security. This change makes it less opinionated, using
request matchers to configure the default instead of ovewriting the
single authentication entry point.

Also adds an entry point responding with a 401 for XHR clients (just like
the vanilla HTTP Basic auth).

Fixes gh-4629
2015-11-27 10:36:29 +00:00
Jean de Klerk
91a10e12b6 BasicBatchConfigurer is public again
Closes gh-4533
Closes gh-4608
2015-11-25 09:51:33 +01:00
Stephane Nicoll
0c387a82b7 Add datasource meta-data for Commons DBCP2
Closes gh-4562
2015-11-23 10:41:56 +01:00
Johnny Lim
efff4a0051 Polish
Closes gh-4554
2015-11-20 11:02:08 +01:00
Dave Syer
8708a07a98 Ensure RestTemplate interceptors remain mutable
Fixes gh-4553
2015-11-19 10:01:38 +00:00
Johnny Lim
36ed0f5c20 Polish
Closes gh-4537
2015-11-19 09:49:33 +00:00
Johnny Lim
da16d6d306 Polishing
Closes gh-4503
2015-11-18 11:40:19 +00:00
Spring Buildmaster
3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Phillip Webb
c4f653e8e3 Upgrade to Jackson 2.6.3
Closes gh-4170
2015-11-13 18:40:06 -08:00
Stephane Nicoll
0c8d302a98 Polish
See gh-4448
2015-11-13 09:50:04 +01:00
Eddú Meléndez
066533de7e Add spring.mvc.static-path-pattern property
Add a `spring.mvc.static-path-pattern` property which can be used to
configure the path pattern used to serve static resources.

Fixes gh-4444
Closes gh-4448
2015-11-12 10:46:27 -08:00
cornelcreanga@yahoo.com
190b0d4fe9 Add Cassandra username/password properties
Allow Cassandra credentials to be specified using properties.

Fixes gh-4431
Closes gh-4432
2015-11-11 14:12:04 -08:00
Johnny Lim
12a9a6e195 Remove redundant assertions
Closes gh-4428
2015-11-11 09:52:09 +01:00
Phillip Webb
287a62c8f3 Update Johannes Edmeier author attribution
Congratulations to Johannes Edmeier on getting married!
2015-11-10 15:29:44 -08:00
Bohuslav Burghardt
88cf65427f Make OPTIONS/TRACE request handling configurable
Add properties to WebMvcProperties allowing control of if TRACE/OPTIONS
requests should go through the regular dispatching chain.

Closes gh-4300
2015-11-10 13:10:27 -08:00
Phillip Webb
a8b23f9deb Fix import order 2015-11-10 13:03:33 -08:00
awgtek
deaa9051bc Switch MongoCredential method
Update MongoProperties to use `MongoCredential.createCredential` rather
than `MongoCredential.createMongoCRCredential`. This allows connections
to Mongo 3.0 servers to authenticate using the SCRAM-SHA-1 mechanism.

Closes gh-4237
2015-11-10 12:59:32 -08:00
Johnny Lim
83e8bfedb2 Use Ordered.HIGHEST_PRECEDENCE constants
Use Ordered.HIGHEST_PRECEDENCE rather than Integer.MIN_VALUE.

Closes gh-4335
2015-11-10 12:13:15 -08:00