Commit Graph

1206 Commits

Author SHA1 Message Date
Stephane Nicoll a6ccb4a6e0 Polish
Polish resource handling chain support. Make sure that the chain is
enabled automatically if at least one strategy is enabled.

See gh-1604
2015-06-28 06:32:07 -07:00
Brian Clozel dd561d15cf Improve Spring Resource Handling support
This commit improves support of the Resource Handling features
introduced in Spring Framework 4.1. Those features add new ways to
resolve and transform static resources in applications.
See [this blog
post](https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources)
for more details.

The `ResourceUrlEncodinFilter` is added for compatible template engines:
Velocity and Thymeleaf. It assists them with rewriting the URLs of
static resources when rendering templates.

New keys are added in the `ResourceProperties` in order to configure
the Resource Handling chain. `ResourceResolvers` and
`ResourceTransformers` are registered accordingly in
`WebMvcAutoConfiguration`.

Here is an example of enabling a `ContentVersionStrategy` on all
static resources, meaning their names will be changed for cache
busting purposes by adding a content hash at the end of the file name.
Like "/js/jquery.js -> /js/jquery-872ca6a9fdda9e2c1516a84cff5c3bc6.js".

```
spring.resources.chain.enabled:true
spring.resources.chain.strategy.content.enabled:true
spring.resources.chain.strategy.content.paths:/**
```

Closes gh-1604
Closes gh-3123
2015-06-28 06:32:07 -07:00
Stephane Nicoll 43b9ea53d6 Polish (avoid dot at the end of the line) 2015-06-25 11:58:21 +02:00
Phillip Webb 4236a9336d Make FlywayMigrationStrategy an interface
Change FlywayMigrationStrategy from a class to an interface.

Fixes gh-3217
2015-06-24 20:34:06 -07:00
Stephane Nicoll 1d66aa35ed Fix typo 2015-06-24 15:20:20 +02:00
cohee016 d948ec5810 Add Freemarker `prefer-file-system-access` support
Add a `spring.freemarker.prefer-file-system-access` property and update
FreeMarkerAutoConfiguration to support it.

Fixes gh-2901
2015-06-23 11:34:02 -07:00
Phillip Webb 61fc4f3f12 Polish copyright headers 2015-06-23 10:22:14 -07:00
Stephane Nicoll d0698bd8ed Remove unnecessary System.out in tests 2015-06-23 15:57:40 +02:00
Andreas Ahlenstorf a08b09563b Add support for jOOQ
Add auto-configuration and a starter POM for jOOQ.

See gh-2804
2015-06-22 21:20:12 -07:00
Andy Wilkinson 24ef2e506b Merge branch '1.2.x' 2015-06-22 15:24:10 +01:00
Andy Wilkinson 8681a8ad2a Map empty virtual host to "/" when parsed from an address
Previously, an address that ended in a "/" would result in the virtual
host being an empty string. This was inconsistent with setVirtualHost
which would map an empty string to "/".

This commit updates the address parsing logic to call setVirtualHost
rather than assigning the value directly to this.virtualHost. This
ensures that the special handling for an empty string is applied
consistently.

Closes gh-3304
2015-06-22 15:20:41 +01:00
Andy Wilkinson d30dd1fa98 Merge branch '1.2.x' 2015-06-22 13:44:42 +01:00
Andy Wilkinson 01ba0f7571 Make RemoteIpValve's protocolHeaderHttpsValue configurable via the env
Closes gh-3289
2015-06-22 13:44:09 +01:00
Artur Konczak 2e66f17491 Enable non local node Elasticsearch instances
Update ElasticsearchAutoConfiguration to allow `http.enabled` and
`node.local` settings to be specified by ElasticsearchProperties.

Fixes gh-2805
Closes gh-2913
2015-06-19 16:20:23 -07:00
Eddú Meléndez 8859824efc Add Apache Artemis support
Add auto-configuration support for Apache Artemis which was formed when
HornetQ was donated to the Apache Foundation. The majority of this code
is based on the HornetQ auto-configuration.

Fixes gh-3154
Closes gh-3246
2015-06-18 20:23:31 -07:00
Phillip Webb e6d5d7c7ab Fix failing MongoDataAutoConfigurationTests 2015-06-18 14:44:16 -07:00
Phillip Webb 2f16a01dd5 Polish 2015-06-18 14:11:40 -07:00
izeye 436054053c Fix default MBeanServer bean name in doc
Closes gh-3283
2015-06-18 17:46:05 +02:00
Andy Wilkinson fd6d61e8b4 Add auto-configuration support for Spring Session
This commit adds support for automatically configuring Spring Session.
In a web application when both Spring Session and Spring Data Redis
are on the classpath, Spring Session's Redis Http Session support
will be auto-configured. The max inactive interval for Redis-backed
sessions can be configured via the environment using the existing
server.session-timeout property.

Closes gh-2318
2015-06-18 14:52:59 +01:00
Eddú Meléndez 58ca6cdc76 Add support for FieldNamingStrategy
Closes gh-3031
Closes gh-3069
2015-06-18 15:44:32 +02:00
Kamil Szymanski 008dee5dce Add JDBC url to Driver class name mappings for DB2, Teradata and Firebird
See gh-2843
2015-06-18 14:10:09 +01:00
dgomesbr 1ebbf8ac4d Upgrade to Hazelcast 3.5
Closes gh-3267
Closes gh-3272
2015-06-18 14:12:28 +02:00
Stephane Nicoll be5e30b409 Migrate spring.view properties
Migrate `spring.view.prefix` and `spring.view.suffix` to
`spring.mvc.view.prefix` and `spring.mvc.view.suffix` respectively. The
former properties are still handled in a backward compatible way and are
defined as deprecated in the meta-data.

Closes gh-3250
2015-06-18 13:55:44 +02:00
Phillip Webb c3b344fdc2 Polish 2015-06-17 12:42:06 -07:00
Stephane Nicoll b5d49b3099 Expose additional admin features
Improve SpringApplicationAdminMXBean to expose additional information:

* Whether the application uses an embedded container
* The properties exposed by the `Environment`

This allows to know if the application is web-based and the HTTP port
on which it is running.

Closes gh-3067
2015-06-17 11:52:18 +02:00
Stephane Nicoll cb98ee25ff Polish
See gh-2900
2015-06-17 09:27:44 +02:00
Eddú Meléndez 4883a5240a Remove deprecated SimpleMongoDbFactory call
Update MongoAutoConfiguration to create a `MongoClient` bean rather than
`Mongo` and update `MongoDataAutoConfiguration` to remove the call to
the deprecated `SimpleMongoDbFactory`.

Fixes gh-3105
Closes gh-3126
2015-06-16 21:33:36 -07:00
Phillip Webb 73d5a858c5 Polish 2015-06-16 21:01:37 -07:00
Sebastien Deleuze 78a7b6ed66 Add async request timeout property
Add a new `spring.mvc.async.request-timeout` property which can be used
to configure AsyncSupportConfigurer.setDefaultTimeout(..).

Fixes gh-2900
Closes gh-3236
2015-06-16 21:00:43 -07:00
Eddú Meléndez 6d5ff33bdf Fix typos
Closes gh-3247
2015-06-16 10:00:47 +02:00
Phillip Webb 93a7dc21da Merge branch '1.2.x' 2015-06-15 18:09:41 -07:00
Phillip Webb cca0b76ac8 Support Velocity toolbox configurations from jar
Create an EmbeddedVelocityToolboxView which supports loading toolbox.xml
files from the application classpath as well as the ServletContext. The
VelocityAutoConfiguration class has been updated to use the new view.

This change allows the `spring.velocity.toolbox-config-location`
property to work with embedded servlet containers.

Fixes gh-2912
2015-06-15 18:08:17 -07:00
Phillip Webb 49039c33ea Polish 2015-06-15 11:44:44 -07:00
Phillip Webb d87f2713af Merge branch '1.2.x' 2015-06-15 11:38:24 -07:00
Phillip Webb 75ffd1b017 Polish 2015-06-15 11:19:47 -07:00
Phillip Webb a83d999f27 Add missing MultipartProperties.enabled property
Fixes gh-3209
2015-06-15 11:18:01 -07:00
Phillip Webb 135e9d10a6 Polish 2015-06-15 10:52:02 -07:00
Stephane Nicoll 961350735b Add test for CacheConfigFileCondition
CacheConfigFileCondition was not properly tested, leading to various
potential source of errors (that last one being gh-3233). This condition
is now tested properly.
2015-06-15 12:06:10 +02:00
Stephane Nicoll b7742a7267 Merge branch '1.2.x' 2015-06-15 11:21:22 +02:00
Stephane Nicoll 321a149297 Only associate JTA transaction manager
This is related to 38cca9c but for the Rabbit support. Update
RabbitAnnotationDrivenConfiguration to only associate a JTA transaction
manager, if any.

Closes gh-3222
2015-06-15 11:20:03 +02:00
izeye 0112260767 Fix typo in cache auto-configurations
Make sure that the EhCache support is triggered if
`spring.cache.ehcache.config` is set and the cache type is set to `auto`.

Same thing for Hazelcast.

Closes gh-3227
2015-06-15 09:37:55 +02:00
Stephane Nicoll c2b606de4c Merge branch '1.2.x' 2015-06-14 10:04:20 +02:00
Stephane Nicoll dc94fafaaa Fix dependency of AmqpAdmin
AmqpAdmin does not require a CachingConnectionFactory. Using the more
general CachingConnectionFactory provides more flexibility.

Closes gh-3220
2015-06-14 10:04:06 +02:00
Stephane Nicoll bc4ae336f9 Fix meta-data for spring.jmx.server
See gh-3211
2015-06-13 18:20:53 +02:00
Phillip Webb 24fc94461b Polish 2015-06-11 10:44:52 -07:00
Dave Syer 462c5f29b1 UserInfoTokenServices should not throw UserRedirectRequiredException
It can just catch all exceptions from the remote /user endpoint
because in a resource server it needs to throw `InvalidTokenException`
and in an SSO setting it will never be called.

Fixes gh-3205
2015-06-11 12:59:25 +01:00
Stephane Nicoll 34e4163ebc Improve configuration keys documentation 2015-06-11 11:17:36 +02:00
Phillip Webb ad7ed1dbae Formatting 2015-06-10 11:26:39 -07:00
Andy Wilkinson 6e79677df8 Merge branch '1.2.x' 2015-06-10 17:53:56 +01:00
Andy Wilkinson defceec90c Reinstate support for spring.groovy.template.configuration.*
Previously, spring.groovy.template.configuration.* was mapped onto both
GroovyTemplateProperties.configuration and GroovyMarkupConfigurer. The
former being a Map and the latter being specific type with getters and
setters. This clash caused problems with the IDE support.

GroovyTemplateProperties.configuration appeared to be dead code so it
was removed in 326bdf2. Unfortunately this broke the use of
spring.groovy.template.configuration.* properties as
GroovyTemplateProperties uses a prefix of spring.groovy.template and it
no longer had a configuration property.

This commit addresses the problem by updating GroovyTemplateProperties
to ignore unknown fields. This allows
spring.groovy.template.configuration.* properties to be used and bound
to GroovyMarkupConfigurer without reintroducing the clash which prompted
the initial change.

Closes gh-3198
2015-06-10 17:53:45 +01:00
Stephane Nicoll bd3a40c0ea Polish class name 2015-06-10 15:52:42 +02:00
Stephane Nicoll ea3816b550 Fix typo 2015-06-10 15:11:19 +02:00
Stephane Nicoll c1dea3797a Add documentation for SpringApplicationAdminMXBean
Closes gh-3179
2015-06-10 13:46:37 +02:00
Stephane Nicoll e0787cbaf0 Polish
Review 105039c that still refer to "lifecycle" instead of "admin". In
particular, harmonized the configuration properties.

Closes gh-3124
2015-06-10 11:28:47 +02:00
Phillip Webb d0fd6145b1 Fix CacheType outer class tangle
Fixes gh-3168
2015-06-09 17:22:32 -07:00
Phillip Webb 105039cdb2 Rename SpringApplicationLifecycle => Admin
Rename SpringApplicationLifecycle JMX beans to SpringApplicationAdmin
and relocate to a dedicated package.

Fixes gh-3124
2015-06-09 16:06:28 -07:00
Phillip Webb cc8120f9eb Use bean classloader for Mongo entity scanning
Fixes gh-3162
2015-06-09 13:34:10 -07:00
Phillip Webb 196b9c9b2a Polish 2015-06-08 21:59:30 -07:00
Stephane Nicoll dd52334c70 Merge branch '1.2.x' 2015-06-08 15:07:41 +02:00
Stephane Nicoll 38cca9c1f3 Only associate JTA transaction manager to JMS factory
The JMS MessageListenerContainer supports the PlatformTransactionManager
abstraction with either a `JmsTransactionManager` for local transactions
or `JtaTransactionManager` for distributed transactions. The former is
kind of deprecated (`setTransacted` should be used instead). In any case,
any other `PlatformTransactionManager` implementation is not supported.

Update JmsAnnotationDrivenConfiguration to only associated a JTA
transaction manager, if any.

Closes gh-3150
2015-06-08 15:07:03 +02:00
Dave Syer 8590950d70 Discontinue use of deprecated @EnableWebMvcSecurity 2015-06-08 13:25:59 +01:00
Dave Syer a226005f94 Merge branch '1.2.x' 2015-06-08 13:25:44 +01:00
Stephane Nicoll 3dcd8e2346 Support for Hibernate naming strategy delegator
hibernate.ejb.naming_strategy_delegator and hibernate.ejb.naming_strategy
cannot be used at the same time but Boot sets the latter automatically.

We now only set the naming strategy if no delegator has been specified
via configuration

Closes gh-3149
2015-06-08 14:20:50 +02:00
Dave Syer 1c0bcc13cf Set UserDetailsService in default AuthenticationManagerBuilder
Only affects the default AuthenticationManagerBuilder (so when users
are not overriding the default global user details). Makes the
UserDetailsService effectively available as it would be if we used
AuthenticationManagerBuilder.inMemoryAuthentication() as a
shared object in the HttpSecurity.

Fixes gh-3152
2015-06-08 13:14:12 +01:00
Stephane Nicoll 432c00e857 Polish redis connection timeout support
Closes gh-3142
2015-06-06 13:35:31 +02:00
Eddú Meléndez 50eedefec1 Add connection timeout property for redis
See gh-3142
2015-06-06 13:35:14 +02:00
Phillip Webb 7609c43685 Switch Javadoc <code>...</code> to {@code ...}
Update Javadoc to use the {@code ...} syntax when possible.
2015-06-05 10:10:34 -07:00
Eddú Meléndez baca62a6c0 Fix typos 2015-06-05 16:59:51 +02:00
Phillip Webb 5ab4b49534 Fix broken Javadoc 2015-06-04 01:39:31 -07:00
Phillip Webb bce4bb8860 Polish start stop support 2015-06-04 01:09:53 -07:00
Phillip Webb 09a29a7207 Polish OAuth SSO 2015-06-04 00:56:12 -07:00
Phillip Webb d2f11c465e Polish cache code 2015-06-04 00:55:38 -07:00
Phillip Webb 412b7b9e50 Polish 2015-06-04 00:55:30 -07:00
Spring Buildmaster 5d81c87b43 Next Development Version 2015-06-04 00:49:11 -07:00
izeye dd24212165 Polish Javadoc
Closes gh-3101
2015-06-03 16:59:02 +02:00
Phillip Webb 09617121b9 Merge branch '1.2.x' 2015-06-02 15:21:14 -07:00
Phillip Webb df8c311280 Add OrderedHiddenHttpMethodFilter
Add OrderedHiddenHttpMethodFilter and use it in WebMvcAutoConfiguration
to ensure that it is applied before Spring Security.

Fixes gh-2773
2015-06-02 15:20:20 -07:00
Phillip Webb 49c4710f63 Merge branch '1.2.x' 2015-06-02 12:32:46 -07:00
Phillip Webb 968b68c322 Polish 2015-06-02 11:17:16 -07:00
Stephane Nicoll 328e07ebf3 polish mail jndi support
Closes gh-2419
2015-06-02 15:04:35 +02:00
Eddú Meléndez 28cb13c31d Add mail jndi support
See gh-2419
2015-06-02 15:04:06 +02:00
Phillip Webb a0087170e0 Polish 2015-06-01 17:51:16 -07:00
Stephane Nicoll 91ce0abe48 Fix Redis cache auto-configuration
Add an explicit link to the `RedisAutoConfiguration` to make sure it is
applied before the cache counter-part. Request the general
`redisTemplate` so that non String-values can be handled by default as
well.

See gh-2633
2015-06-01 11:48:25 +02:00
Stephane Nicoll 6ea27024c3 Expose RedisTemplate with explicit type
Fixes gh-3075
2015-06-01 11:46:46 +02:00
Stephane Nicoll 1457a55e41 Remove spring.cache.config property
Remove `spring.cache.config`  as it is too generic and does not express
enough what is configured. This property is replaced by cache library
specific properties, that is `spring.cache.ehcache.config`,
`spring.cache.hazelcast.config`, `spring.cache.infinispan.config` and
`spring.cache.jcache.config`.

See gh-2633
2015-05-28 18:15:35 +02:00
Stephane Nicoll c5566e2755 Fix broken build
Update EnableAutoConfigurationImportSelectorTests to match the new
`excludeName` property.

Closes gh-2660
2015-05-27 15:13:44 +02:00
Stephane Nicoll a6f671be3e Add excludeName to EnableAutoConfiguration
Allow user to exclude an auto-configuration class by specifying the fully
qualified name instead of the class reference.

Closes gh-2660
2015-05-27 14:24:47 +02:00
Stephane Nicoll fc61f2e837 Improve documentation for JMX related keys
Closes gh-2747
2015-05-27 11:36:34 +02:00
Stephane Nicoll e3a124d0f9 Expose additional RabbitMQ settings
Allow SSL to be configured via standard configuration as well as the
requestedHeartbeat. Switch to RabbitConnectionFactoryBean.

Closes gh-2655, gh-2676
2015-05-26 21:32:58 +02:00
Stephane Nicoll ab55331863 Improve configuration keys documentation 2015-05-26 17:26:01 +02:00
Stephane Nicoll 9f010ed8c0 Merge branch '1.2.x' 2015-05-26 15:01:13 +02:00
Stephane Nicoll 160f2d341f Fix Gzip filter properties
Fix `excludeAgentPatterns`, `excludePaths` and `excludePathPatterns`
properties. Introduce `excludedMimeTypes` property.

Fixes gh-3042
2015-05-26 15:00:54 +02:00
Dave Syer c5dc3f564b Add @EnableOAuth2Sso and spring.oauth2.sso.*
User can enable OAuth2 SSO by declaring the intent (@EnableOAuth2Sso)
and also configuring the client properties (spring.oauth2.client.*).
The spring.oauth2.sso.* are only needed to change the path for the
login (defaults to /login) - any other security configuration for the
protected resources can be added in a WebSecurityConfigurerAdapter
which carries the @EnableOAuth2Sso annotation.
2015-05-26 07:23:26 +01:00
Dave Syer af320b49bf Rationalize some features and merge in customizers from Spring Cloud 2015-05-26 06:34:43 +01:00
Dave Syer 5468949a55 Update to latest 1.3 code 2015-05-26 06:34:43 +01:00
Greg Turnquist 53f67a448f Auto-configure Spring Security OAuth2 when detected on the classpath
* Automatically spin up Authorization Server and Resource Server
* Automatically configures method level security included OAuth2Expression handler
* Wrote extensive unit tests verifying default behavior as well as the auto-configuration backing off when custom Authorization/Resource servers are included
* Created org.springframework.boot.security.oauth2 subpackage to contain it
* Can also disable either resource of authorization server completely with a single property for each
* Print out the auto-generated secrets and other settings
* Added spring-boot-sample-secure-oauth2 to provide a sample that can be run and poked with curl as well as some automated tests.
* Make users ask for which servers to install by adding @Enable*
* User has to @EnableGlobalMethodSecurity instead of using properties files

Add Spring Security OAuth2 support to Spring Boot CLI

* Triggered from either @EnableAuthorizationServer or @EnableResourceServer
* Needs to have @EnableGlobalMethodSecurity to allow picking the annotation model.
* By default, comes with import support for @PreAuthorize, @PreFilter, @PostAuthorize, and @PostFilter via a single start import
* Also need import support for the enable annotations mentioned above.
* Added extra test case and sample (oauth2.groovy)
2015-05-26 06:34:43 +01:00
Stephane Nicoll b8106ae773 Improve transaction manager detection
Switch the condition used to trigger the creation of a transaction
manager from the default name to the actual type.

Fixes gh-3012
2015-05-22 16:10:43 +02:00
Stephane Nicoll bd6f7a589c Expose enableFallback property
Add an extra property to control the support of fallback resolution for
mobile views.

Fixes gh-3009, gh-3019
2015-05-21 19:20:06 +02:00
Andy Wilkinson 95f31b0d30 Polish Undertow access logs contribution
- Apply project’s code formatting and conventions
 - Don’t use the IO and worker thread configuration when creating the
   worker for the AccessLogReceiver. The IO and worker thread
   configuration is for HTTP request processing and a worker in its
   default configuration should be sufficient for the access log
   receiver.
 - Don’t use a temporary directory as the default for the access log
   directory. A temporary directory makes (some) sense for Tomcat as it
   requires a directory for its basedir. Undertow has no such
   requirement and using a temporary directory makes it hard to locate
   the logs. The default has been updated to a directory named logs,
   created in the current working directory.
 - Document the new properties in the application properties appendix

Closes gh-3014
2015-05-20 11:02:49 +01:00
Marcos Barbero 90e43737bb Add support for configuring Undertow's access log via the environment
This commit adds support for configuring Undertow's access log via the
environment using the following properties:

server.undertow.access-log-enabled
server.undertow.access-log-pattern
server.undertow.access-log-dir

See gh-3014
2015-05-20 10:50:15 +01:00