Commit Graph

10971 Commits

Author SHA1 Message Date
Stephane Nicoll
1611e631db Merge pull request #2029 from maciejwalkowiak/spring-jms-pub-sub-fix
* spring-jms-pub-sub-fix:
  Apply pubSubDomain property to ContainerFactory
2014-12-02 15:06:18 +01:00
Maciej Walkowiak
c74e56d185 Apply pubSubDomain property to ContainerFactory
Previously, tuning the pubSubDomain flag only impacted the created
JmsTemplate leaving any default listeners with the default settings.

If no default JmsListenerContainerFactory is defined, the created
one is using that property as well now.
2014-12-02 15:04:00 +01:00
Stephane Nicoll
4ce621951c Add debug property to meta-data
Closes gh-2044
2014-12-02 14:57:49 +01:00
Andy Wilkinson
f9b5c6b1ae Merge branch '1.1.x' 2014-12-02 11:22:57 +00:00
Andy Wilkinson
3b78aa9493 Make Security auto-config conditional on spring-security-config
SecurityAutoConfiguration, via its import of
AuthenticationManagerConfiguration, requires spring-security-config
to be on the classpath as AuthenticationManagerConfiguration extends
GlobalAuthenticationConfigurerAdapter from spring-security-config.

This commit makes SecurityAutoConfiguration conditional on the
presence of GlobalAuthenticationConfigurerAdapter so that the
auto-configuration will be disabled in its absence rather than causing
an app to fail to start.

Closes gh-2046
2014-12-02 11:18:23 +00:00
Dave Syer
9de82f9c69 Add some space between the trace filter and the end of the chain 2014-12-02 11:14:03 +00:00
Andy Wilkinson
8520554eb2 Allow the SpringApplication class used by the CLI to be configured
This commit adds support to the CLI for launching a custom
SpringApplication implementation. The class that is launched can be
configured using the spring.application.class.name System property
or the SPRING_APPLICATION_CLASS_NAME environment variable with the
former taking priority.

Closes gh-2030
2014-12-02 10:01:05 +00:00
Andy Wilkinson
064f88a9fb Use a free port, rather than 8080, in WebSocketAutoConfigurationTests
Closes gh-2043
2014-12-02 09:46:48 +00:00
Phillip Webb
09dac5ff00 Apply formatting and cleanup rules 2014-12-01 19:35:03 -08:00
Phillip Webb
48db5457f1 Polish 2014-12-01 19:32:05 -08:00
Phillip Webb
237defaf18 Merge branch '1.1.x' 2014-12-01 14:29:58 -08:00
Phillip Webb
41c15f205f Polish concurrent gaugeLocks map access
See gh-1995
2014-12-01 14:29:22 -08:00
Phillip Webb
53637eaa7c Merge branch '1.1.x'
Conflicts:
	spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
2014-12-01 14:19:08 -08:00
Phillip Webb
b519eda441 Make ErrorPageFilter public
Change the visibility of ErrorPageFilter to public to fix
IllegalAccessException errors on certain servlet containers.

Fixes gh-2026
2014-12-01 14:13:44 -08:00
Phillip Webb
49858a0ff1 Fix concurrent gaugeLocks map access
Use putIfAbsent to ensure atomic creation of lock objects.

Fixes gh-1995
2014-12-01 13:58:18 -08:00
Phillip Webb
ffe5348083 Polish formatting 2014-12-01 13:46:06 -08:00
Dave Syer
911d39f937 Ensure authentication events get published
When the user provides their own AuthenticationManager we do a lazy
initialization and didn't (till now) inject the AuthenticationEventPublisher

Fixes gh-2033
2014-12-01 17:42:18 +00:00
Dave Syer
843e6d7cfa Add 2 more JsonParser implementations 2014-12-01 13:41:13 +00:00
Dave Syer
998c29c4aa Add java.version to Tomcat WAR projects 2014-12-01 13:40:53 +00:00
Stephane Nicoll
20bb9c0305 Remove warnings for expected deprecation usage 2014-11-28 15:54:31 +01:00
Dave Syer
3c1e48c89a Better handling of anonymously accessible endpoints
Shares the /health endpoint request mapping between security config
and MVC dispatcher. Generalizes so that instead of a marker
interface (AnonymouslyAccessibleMvcEndpoint), an MvcEndpoint
signals that it wants to control its own access rules by adding
a Principal to the @RequestMapping method parameters (more @MVC).

Fixes gh-2015 slightly differently
2014-11-28 06:33:30 +00:00
Andy Wilkinson
2ce057ca96 Allow /health to be accessed anonymously irresepctive of its sensitivity
The changes in 3bb598a overload the health endpoint's sensitive
property such that it's now considered sensitive if management
security is enabled. When an endpoint is sensitive anonymous
access is prevented. This breaks the health endpoint which should
return a filtered view of the server's health when it's accessed
anonymously rather than rejecting the request.

This commit introduces AnonymouslyAccessibleMvcEndpoint, a marker
extension of the MvcEndpoint interface. It is implemented by
HealthMvcEndpoint. ManagementSecurityAutoConfiguration has been
updated to allow anonymous access to endpoints that aren't sensitive
or that implement AnonymouslyAccessibleMvcEndpoint.

Fixes gh-2015
2014-11-27 14:51:57 +00:00
Stephane Nicoll
e507c61481 polish 2014-11-27 15:30:04 +01:00
Stephane Nicoll
5b231e600b Also flag deprecated properties in a @Deprecated class
Previously, any property defined in a @Deprecated class were not marked
as deprecated as only the getter or field was inspected for the
annotation.

An additional check on the class has been added to handle this case.

Fixes gh-2014
2014-11-27 15:27:12 +01:00
Stephane Nicoll
1a5916665c Remove unused RabbitMQ dynamic property flag
Fixes gh-1999
2014-11-27 14:49:35 +01:00
Stephane Nicoll
65e9d6a6e0 Add property description
Set the field javadoc of many properties that are managed via
configuration so that the "description" field is available in the
meta-data.

Closes gh-1808
2014-11-27 14:23:27 +01:00
Andy Wilkinson
40a7445fec Merge branch '1.1.x' 2014-11-26 17:51:56 +00:00
Andy Wilkinson
64599261a5 Allow mongo port, host, and credentials to be configured individually
Previously, the host had to have a custom value for the configuration
of the port or credentials (username and password) to take effect. This
meant, for example, that you couldn’t just set the port or just set the
username and password while using the default host.

This commit allows the port or username and password to be configured
without also configuring the host. The default host (localhost) and
port (27017) are retained.

Fixes gh-2008
2014-11-26 17:34:21 +00:00
Stephane Nicoll
8ee237a9c6 Fix documentation syntax typo 2014-11-26 18:14:28 +01:00
Oliver Gierke
123b90fa64 Register all packages where @EnableAutoConfiguration is used
Previously, when @EnableAutoConfiguration was used in multiple packages,
the last @EnableAutoConfiguration that was processed would
win and only its package would be stored as an auto-configuration
package.

This commit updates AutoConfigurationPackages to allow multiple package
name registrations. AutoConfigurationPackages.set(…) has been altered to
augment the constructor arguments of the BeanDefinition registered for
the initial call to the method so that the packages handed to the method
call will be added to the bean definition and not replace the previous
ones. The method has been renamed register(…) to reflect the changed
behavior.

Closes gh-1994
2014-11-26 11:21:58 +00:00
Andy Wilkinson
a83f9c6311 Correct markup in documentation of how to configure Undertow 2014-11-26 10:55:33 +00:00
Andy Wilkinson
d1cb3c7ce1 Polish names in pom.xml of Jersey and Cloud Connectors starters 2014-11-26 10:47:49 +00:00
Andy Wilkinson
d5b7f49f83 Merge branch '1.1.x' 2014-11-26 10:22:06 +00:00
Andy Wilkinson
9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 2014-11-26 10:21:57 +00:00
Spencer Gibb
2fb4d2ece6 Check if managementServerProperties.getSecurity() is not null
before checking isEnabled(). It is explicitly constructed as null
in ManagementServerProperties to prevent class not found errors
at runtime when Security is not on the classpath.

Fixes gh-2003, fixes gh-2004
2014-11-26 07:59:22 +00:00
Dave Syer
3bb598a421 Only hide /health details if the app is actually secure
Also gives the user the option to override (by setting
endpoints.health.sensitive=false).

Fixes gh-1977 in a slightly different way
2014-11-25 16:40:18 +00:00
Andy Wilkinson
337e9bd013 Use and wait for a latch to check that the interceptor is called
Spring MVC drives the postHandle method on any interceptors after the
response has been sent to the client. This meant that there was a
race between the test receiving the response and asserting that the
interceptor had been driven and Spring MVC driving the interceptor.

This commit updates the interceptor to use a CountDownLatch to track
whether or not it's been called. The test now waits for up to 30
seconds for the latch to be decremented.

Closes gh-1997
2014-11-25 14:19:07 +00:00
Andy Wilkinson
55fadf1231 Merge branch '1.1.x' 2014-11-25 13:54:06 +00:00
Andy Wilkinson
02e925cb4e Merge branch 'gh-1989' into 1.1.x 2014-11-25 13:53:57 +00:00
Andy Wilkinson
2b4eee5e53 Add a note explaining that double backslashes are unnecessary in YAML
Closes gh-1989
2014-11-25 13:52:26 +00:00
Sjoerd Mulder
cc557833a4 Escape backslashes in .properties examples of setting internal-proxies
In a properties file, a backslash is used as an escape character for
the line terminator sequence to allow values to be split across
multiple lines. When a backslash is used elsewhere they're stripped
out of the property's value.

This commit updates .properties-based examples for configuring
server.tomcat.internal-proxies to escape the backslahes so that they
are retained in the property's value at runtime.

See gh-1989
2014-11-25 13:39:25 +00:00
Andy Wilkinson
092b861ee3 Merge branch '1.1.x' 2014-11-25 12:32:21 +00:00
Andrea Vacondio
9ef8335881 Fix broken link to the MVC section of the Spring reference docs
Closes gh-1998
2014-11-25 12:31:57 +00:00
Andy Wilkinson
a708b28d9d Document restrictions when /health is accessed anonymously
Closes gh-1978
2014-11-25 12:22:23 +00:00
Andy Wilkinson
26a511495e Allow the user to opt-out of anonymous access restrictions for /health
By default, when /health is accessed anonymously, the details are
stripped, i.e. the response will only indicate UP or DOWN. Furthermore
the response is cached for a configurable period to prevent a denial
of service attack.

This commit adds a configuration property,
endpoints.health.restrict-anonymous-access, that can be set to false
to allow full anonymous access to /health. When full access is
allowed, the details will be included in the response and the response
will not be cached.

Closes gh-1977
2014-11-25 12:04:45 +00:00
Andy Wilkinson
5854ea189e Make TestInterceptor thread-safe
Previously, TestInterceptor used an int to keep a count of how often
it had been called. The count was incremented on one thread and
read on another thread. This lead to intermittent test failures as the
field was not declared volatile and a stale value would sometimes be
returned.

This commit updates TestInterceptor to use an AtomicInteger that's
held in a final field. This ensures that getCount() will not return
stale values and also ensures that the count can safely be incremented
concurrently.

Closes gh-1997
2014-11-25 10:52:34 +00:00
Andy Wilkinson
023d5bea3b Merge branch '1.1.x' 2014-11-25 10:51:44 +00:00
Andy Wilkinson
feddb2e8a1 Note that @IntegrationTest and @WebAppConfiguration can be used with Spock
Closes gh-1908
2014-11-25 10:51:27 +00:00
Andy Wilkinson
6d97785030 Add a plain JPA sample application
Closes gh-1761
2014-11-25 10:23:32 +00:00
Stephane Nicoll
4402c6b4a0 Haromonize configuration keys to lowercase hyphen 2014-11-25 09:00:02 +01:00