Commit Graph

6310 Commits

Author SHA1 Message Date
Phillip Webb
0bac6ebda7 Fix typo
See gh-4419
2015-11-10 09:52:39 -08:00
Stephane Nicoll
3311419a08 Fix typo
See gh-4419
2015-11-10 14:52:07 +01:00
Phillip Webb
387faa786b Merge pull request #4383 from rwinch/gh-4368
* pr/4383:
  Secure actuator when all endpoints are sensitive
2015-11-10 00:13:45 -08:00
Rob Winch
c6e08eb883 Secure actuator when all endpoints are sensitive
Previously if every actuator endpoint was marked as sensitive, then all
endpoints were marked as permitted.

This commit ensures that if all endpoints are marked as sensitive, then
all the endpoints are secured.

Fixes gh-4368
Closes gh-4383
2015-11-09 22:30:35 -08:00
Phillip Webb
8c642bec74 Support global endpoint.sensitive override
Add support for an `endpoint.sensitive` property that can be used to
override the endpoint `sensitive` default.

Fixes gh-4419
2015-11-09 22:25:12 -08:00
Phillip Webb
332c6911cf Polish 2015-11-09 22:19:03 -08:00
Phillip Webb
aa8d0dd072 Add HAL test for endpoints.enabled=false 2015-11-09 22:18:20 -08:00
Phillip Webb
b1b3fc6639 Use consistent MvcEndpoint class names
Rename HAL and docs MVC endpoints so that classnames consistently end
with MvcEndpoint. Also rename integration tests so that they are grouped
together in the IDE.
2015-11-09 22:15:06 -08:00
Phillip Webb
da6b041199 Merge pull request #4399 from izeye/unused
* pr/4399:
  Remove unused parameter in Security configuration
2015-11-09 14:44:58 -08:00
Johnny Lim
8540d80b84 Remove unused parameter in Security configuration
Update SecurityFilterAutoConfiguration.securityFilterChainRegistration
to remove unused ApplicationContext parameter.

Closes gh-4399
2015-11-09 14:43:15 -08:00
Phillip Webb
c614446d43 Merge branch '1.2.x' 2015-11-09 14:40:59 -08:00
Phillip Webb
49a5587558 Fully support -cp arguments
The CLI application advertises `-cp` support but it appears that only
`--cp` is really supported. The fix for gh-178 forgot to update the
call to `getParser().parse(...)`.

See gh-178
2015-11-09 14:38:54 -08:00
Phillip Webb
72c94eba93 Merge pull request #4407 from vpavic/upgrade-postgresql-jdbc
* pr/4407:
  Upgrade PostgreSQL JDBC driver to 9.4-1205
2015-11-09 14:30:13 -08:00
Vedran Pavic
e0db755bad Upgrade PostgreSQL JDBC driver to 9.4-1205
Closes gh-4407
2015-11-09 14:29:38 -08:00
Phillip Webb
3e6020ee5c Merge pull request #4414 from pmvilaca/fix-4378-launch-script-stop-cmd
* pr/4414:
  Don't use `kill -hup` in the launch script
2015-11-09 14:28:44 -08:00
Pedro Vilaca
b190cfdd6a Don't use kill -hup in the launch script
The HUP signal was being used to stop the service and for some reason,
sometimes it was being ignored. This commit change forces the use of the
TERM signal (the default signal of kill).

Fixes gh-4378
Closes gh-4414
2015-11-09 14:27:05 -08:00
Phillip Webb
52264cd0c2 Merge pull request #4406 from vpavic/audit-config
* pr/4406:
  Allow security AuditListener overrides
2015-11-09 13:51:43 -08:00
Vedran Pavic
a0c696b17b Allow security AuditListener overrides
Introduce `AbstractAuthenticationAuditListener` and
`AbstractAuthorizationAuditListener` classes so that users can
extended them to replace the auto-configured defaults.

Closes gh-4406
2015-11-09 13:51:30 -08:00
Phillip Webb
564cbfe96c Add missing @param tag
See gh-4415
2015-11-09 12:18:55 -08:00
Phillip Webb
bd20b5419e Consider prefixes when sanitizing /configprops
Update ConfigurationPropertiesReportEndpoint so that property prefixes
are also considered when sanitizing values.

Fixes gh-4415
2015-11-09 11:19:10 -08:00
Stephane Nicoll
4aefe9f856 Merge pull request #4408 from vpavic/upgrade-undertow
* pr/4408:
  Upgrade to Undertow 1.3.5.Final
2015-11-08 09:16:38 +01:00
Vedran Pavic
9599c7e67b Upgrade to Undertow 1.3.5.Final
Closes gh-4408
2015-11-08 09:15:47 +01:00
Dave Syer
88f776ef17 Remove duplicate sample 2015-11-07 10:25:07 +00:00
Phillip Webb
4451df21c9 Merge branch '1.2.x' 2015-11-06 13:23:29 -08:00
Phillip Webb
e06198e9cb Polish 2015-11-06 13:21:53 -08:00
Phillip Webb
f08f872729 Restore original embedded container shutdown order
Update EmbeddedWebApplicationContext so that the servlet container is
shutdown after the context is closed. Unfortunately shutting the
container down before the context has been closed causes exceptions if
the `/shutdown` actuator endpoint is used. It can also cause the Tomcat
classloader to throw IllegalStateExceptions if resources are accessed
during shutdown.

As this commit effectively reverts 0069e41c we need to fix the shutdown
deadlock issue reported in gh-4130 in a different way. The deadlock can
be caused when an incoming HTTP connection occurs whilst the context is
closing. The incoming connection triggers the `FrameworkServlet` to
call `initWebApplicationContext` which in turn calls `refresh`. The
`FrameworkServlet` checks `ApplicationContext.isActive()` before
performing an initialization but prior to this commit we would set
active to `false` before stopping the servlet container. We now override
`onClose` rather than `doClose` in `EmbeddedWebApplicationContext` to
ensure that the active flag is only set to `false` once the servlet
container has been stopped.

See gh-4130
Fixes gh-4396
2015-11-06 12:54:19 -08:00
Stephane Nicoll
ce73dec992 Merge branch '1.2.x' 2015-11-06 17:51:17 +01:00
Stephane Nicoll
6d90188a27 Fix Maven/Gradle wrapper executable flag
Spring Initalizr now bundles a wrapper script for the build system. While
that wrapper has the necessary execute flag in the zip archive, that flag
is lost as the zip abstraction does not honor those.

The init command now makes sure to restore the execute flag on `mvnw`
and `gradlew` if necessary.

Unfortunately, this can't be tested as the Windows build would fail to
assert that the executable flag has been propertly set.

Closes gh-4392
2015-11-06 17:47:27 +01:00
Stephane Nicoll
2c4f88e221 Fix Hazelcast auto-configuration ordering
Make sure that the general Hazelcast auto-configuration is processed
before the cache auto-configuration. This was supposed to be fixed and
tested in 721b5a2 but unfortunately the `@AutoConfigureAfter` annotation
was placed on a regular `@Configuration` class (which has no effect).

The tests were passing because the ordering is actually hardcoded in the
test. The relevant tests now use `ImportAutoConfiguration` that simulates
the same order as the one use by the actual application.

Closes gh-4389
2015-11-06 17:02:12 +01:00
Stephane Nicoll
157c0b6cae Register hazelcast post processor only when necessary
Commit 8e0a94f introduced a post processor that adds an explicit link
between the `HazelcastInstance` and the `EntityManagerFactory` so that
Hazelcast is fully initialized before Hibernate actually kicks in.

Unfortunately, the conditions that were implemented to register this post
processor are wrong and any app that has both JPA and Hazelcast support
blows up if no bean with name `hazelcastInstance` is defined.

This commit fixes the situation and reworks the configuration in a
separate auto-configuration that runs after the Hazelcast and JPA support
and check both the presence of an `EntityManagerFactory` and a bean of
name `hazelcastInstance`. If any of those conditions does not apply the
post processor is no longer registered.

Closes gh-4158
2015-11-06 12:01:59 +01:00
Stephane Nicoll
195880c7c0 Merge pull request #4356 from bohrqiu/master
* pr/4356:
  Polish contribution
  Add thread total started count to SystemPublicMetrics
2015-11-06 09:24:29 +01:00
Stephane Nicoll
bd8521c1ab Polish contribution
Closes gh-4356
2015-11-06 09:24:08 +01:00
邱占波
35417622e6 Add thread total started count to SystemPublicMetrics
See gh-4356
2015-11-06 09:17:37 +01:00
Stephane Nicoll
cce498b530 Merge branch '1.2.x'
# Conflicts:
#	spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
2015-11-05 14:11:15 +01:00
Stephane Nicoll
6665f8582c Merge branch '1.2.x'
# Conflicts:
#	spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
2015-11-05 14:10:52 +01:00
Stephane Nicoll
96ca3e0c0f Polish
Add missing documentation

See gh-4220
2015-11-05 14:09:30 +01:00
Stephane Nicoll
6dbdd575a5 Polish 2015-11-05 10:18:34 +01:00
Phillip Webb
c94cb1f3d1 Skip BeanInfo class search by default
Set `CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME` by
default to improve startup performance. The `spring.beaninfo.ignore`
property can be set in `application.properties` if BeanInfo classes
should be searched.

Fixes gh-4390
2015-11-05 00:23:23 -08:00
Phillip Webb
d88210f626 Improve performance with BackgroundPreinitializer
Add a BackgroundPreinitializer to trigger early initialization in a
background thread of time consuming tasks. By moving certain
initialization tasks to background thread and triggering them early
we can improve the critical path when the application starts. For
example, Tomcat's MBeanFactory class parses several XML files when
first loaded. If we trigger the load in a background thread it completes
before Tomcat actually needs to use it.

The initial set of initializers included with this commit are:

- Tomcat MBeanFactory
- javax.validation
- Spring's AllEncompassingFormHttpMessageConverter

See gh-4252
2015-11-05 00:23:23 -08:00
Phillip Webb
602a06d565 Improve performance of RelaxedNames
Replace String.split() with a regex to save compiling the pattern
multiple times.

See gh-4252
2015-11-05 00:23:23 -08:00
Phillip Webb
98ff0fff29 Merge branch '1.2.x' 2015-11-05 00:22:50 -08:00
Phillip Webb
9432ee6a6b Polish 2015-11-05 00:19:58 -08:00
Phillip Webb
3492f1bcca Fix typo in HibernateJpaAutoConfiguration 2015-11-05 00:14:23 -08:00
Dave Syer
a3c73cad4a Merge branch '1.2.x'
Conflicts:
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcProperties.java
2015-11-05 08:21:53 +01:00
Dave Syer
124574e345 Add mediaTypes (extension to media type mapping) in MVC resources
Allows users to configure "allowed" file extensions for controller
mappings, so that browsers will not switch to downloading "f.txt"
(part of the recent RFD attack fixes in Spring MVC).

See gh-4220
2015-11-05 08:10:07 +01:00
Phillip Webb
6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Phillip Webb
fd1cbed51c Merge branch 1.2.x 2015-11-03 14:56:16 -08:00
Phillip Webb
2118242e00 Polish 2015-11-03 14:06:44 -08:00
Stephane Nicoll
7a665c5f58 Merge branch '1.2.x' 2015-11-03 10:15:39 +01:00
Stephane Nicoll
8c140092b6 Fix key to disable the metrics filter
Commit d0cf6b5 introduced a `endpoints.metrics.filter.enabled` property
key meant to disable the filter. Unfortunately, the `endpoints.metrics`
namespace is already managed so setting this property will fail.

We now use the same key than the one used to disable the metrics
endpoint.

Closes gh-4365
2015-11-03 10:14:39 +01:00