Commit Graph

6840 Commits

Author SHA1 Message Date
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
2b3fbe9681 Merge branch 'gh-4564' 2015-12-02 10:23:53 +00:00
Andy Wilkinson
c003efc666 Document new initInfoChkconfig property supported by launch.script
See gh-4564
2015-12-02 10:21:33 +00:00
吉田 尚弘
02363b38eb Make launch script's chkconfig configurable via a property
Closes gh-4564
2015-12-02 10:12:03 +00:00
Vedran Pavic
884cae6f8d Add support for using ${application.title} in startup banners
This commit introduces a new property, application.title, that can
be used in a banner. Its value is resolved from the application
manifest's Implementation-Title attribute.

Closes gh-4603
2015-12-02 10:09:42 +00:00
Johnny Lim
a4baacc549 Remove a redundant setUseSuffixPatternMatch(false)
Closes gh-4656
2015-12-02 09:56:38 +00:00
Andy Wilkinson
4260b0c765 Remove ignoreUnknownFields accidentally added in 524a328 2015-12-01 18:59:27 +00:00
Gary Russell
6c1c7133e7 Upgrade to Spring Integration 4.2.2.RELEASE
Closes gh-4511
2015-12-01 17:56:02 +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
Andy Wilkinson
8e0d3ed0eb Don’t return 404 when metric or env regex matches entry with null value
Previously, if a regular expression was used when calling the metrics or
environment endpoints, a metric or property with a null value would
result in a 404 response.

This commit updates the two affected endpoints so that any metric or
property whose name matches the regular expression but has a null value
is ignored. This allows all of the matching metrics or properties with
non-null values to be returned in a 200 OK response.

Closes gh-4552
2015-12-01 17:12:07 +00:00
Andy Wilkinson
f25a5e3b77 Improve documentation of color-coded console output
This commit documents the color converter, the explicit colors and
styles that is supports, and the implicit colors used for each log
level.

 Closes gh-4592
2015-12-01 16:28:09 +00:00
Andy Wilkinson
8618ec89b1 Ensure that environment post processors are ordered correctly
Previously, ConfigFileApplicationListener would always add itself to the
end of the list of environment post processors loaded via
spring.factories. This meant that its order (highest precedence + 10)
would not be honoured and it would only be in the right place in the
list if any other post processors happened to have a higher precedence.

This commit updates ConfigFileApplicationListener to sort the list of
post processors using AnnotationAwareOrderComparator once its added
itself to the list.

Closes gh-4595
2015-12-01 15:40:03 +00:00
Andy Wilkinson
008f2a8874 Merge branch '1.2.x' 2015-12-01 15:11:29 +00:00
Andy Wilkinson
0214fe4b82 Remove inconsistent synchronization from EmbeddedWebApplicationContext
Previously, EmbeddedWebApplicationContext used synchronized, but did
not do so consistently. It also synchronized on this so its lock was
exposed outside of the class, creating a risk of deadlock if a caller
synchronized incorrectly. Furthermore, not all fields on the class
were sychronized so the class wasn't truly thread-safe.

This commit attempts to rectify some of the problems above. The use
of synchronized has been dropped in favour of using a volatile field
for the embedded servlet container. Whenever this field is accessed,
a local variable is used to "cache" the value thereby preventing a
change on another thread from causing unwanted behaviour such as an
NPE.

Closes gh-4593
2015-12-01 14:55:53 +00:00
Andy Wilkinson
0f032eeb8a Address warnings reported by shellcheck for changes made in 7011944
Closes gh-4524
2015-12-01 12:44:10 +00:00
Andy Wilkinson
70119449ce Add workaround for race condition in start-stop-daemon
There’s a race condition in start-stop-daemon when --make-pidfile and
--background are used together [1]. This race condition can lead to the
command returning before the PID file has been created. The missing PID
file then causes the launch script to incorrectly report that the
service failed to start.

This commit updates the launch script to wait for up to 10 seconds for
the PID file to be created when start-stop-daemon is used to launch the
app.

Closes gh-4524

[1] https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/1036899
2015-12-01 11:47:22 +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
6ec767437a Fix server.error.path reference in error controller 2015-11-30 14:20:37 +00:00
Stephane Nicoll
1ec40ed666 Polish 2015-11-30 15:08:40 +01:00
Stephane Nicoll
5cdd874d55 Document @AutoconfigureOrder
Closes gh-4546
2015-11-30 11:18:34 +01:00
Stephane Nicoll
e78ddc903e Polish 2015-11-30 10:47:25 +01:00
Stephane Nicoll
f2a32148ff Merge pull request #4626 from jadekler/liquibase_upgrade
* pr/4626:
  Upgrade liquibase to 3.4.2
2015-11-30 10:36:04 +01:00
Jean de Klerk
b00bccb7ca Upgrade liquibase to 3.4.2
Remove 3.4.1 logger workaround (adding package to default service). See
CORE-2436 on the liquibase tracker for more details.

Closes gh-4591
Closes gh-4625
2015-11-30 10:33:56 +01:00
Stephane Nicoll
7d6f63ae34 Add redirection to actuator endpoint
If a request to the actuator endpoint ends with a slash with Spring
HATEOAS on the classpath, an empty array of links is returned whereas
a request without the slash returns a response with all the expected
links to the actuator's other endpoints.

This commit adds an automatic redirection so that both URIs return the
expected result.

Closes gh-4575
2015-11-30 10:32:50 +01:00
Stephane Nicoll
5beeaf1760 Merge pull request #4582 from tsachev/gh-4557
* pr/4582:
  Use fast exceptions in findResource(s)
2015-11-30 09:57:39 +01:00
Vladimir Tsanev
1e2f133892 Use fast exceptions in findResource(s)
Some libraries like aspectj are using findResource to see the raw
bytecode of a class. It will even call findResource for every method of
every class of beans that are post processed. This can be significant
performance hit on startup when LaunchedURLClassLoader and there are a
lot of nested jars.

See gh-3640
Fixes gh-4557
2015-11-30 09:51:15 +01:00
Stephane Nicoll
1adca44eaa Merge branch '1.2.x' 2015-11-29 17:27:40 +01:00
Stephane Nicoll
9bffdc80ff Upgrade to Spring Framework 4.1.9.BUILD-SNAPSHOT 2015-11-29 17:26:57 +01: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
afd38c7a35 Merge pull request #4635 from kazuki43zoo/fix-typo-on-doc
* pr/4635:
  Fix typo in reference doc
2015-11-28 09:22:45 +01:00
Kazuki Shimizu
b5bb184766 Fix typo in reference doc
Closes gh-4635
2015-11-28 09:22:31 +01:00
Dave Syer
344360453e Add test for management.security.enabled=false with child context 2015-11-27 17:14:49 +00:00
Dave Syer
2de48a35ab Make /error the error page in child context as well as parent
If user set the management.port *and* the management.context-path
then the /error path was in the wrong place because formerly it
was implemented (in this case) by an MvcEndpoint. If we
switch it to a regular @Controller (which are now supported in the
child context if there is one) then it won't disappear under the
management.context-path.

Also use lazy request matching in ignores as well as secure paths.
The problem was that the ignores were constructed eagerly from the
actuator paths before they were available (the EndpointHandlerMapping
needs to be lazily accessed to avoid a security-induced bean creation
cascade).

Fixes gh-4624
2015-11-27 16:53:37 +00:00
Stephane Nicoll
754642e0cf Document HealthIndicator naming convention
Closes gh-4602
2015-11-27 17:21:15 +01: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
Stephane Nicoll
e6588dbf70 Make LOGGING_SYSTEM_BEAN_NAME public
Since the `LoggingSystem` may be retrieved very early during the context
initialization, we should do a lookup by name even if only one instance
of that bean is ultimately expected in the context.

The constant defining the bean name is now public to ease that use case.

Closes gh-4584
2015-11-27 15:53:40 +01:00
Stephane Nicoll
5284cbd084 Merge branch '1.2.x' 2015-11-27 15:37:10 +01:00
Stephane Nicoll
1ab05326a9 Upgrade to Spring Social 1.1.4.RELEASE 2015-11-27 15:33:10 +01:00
Stephane Nicoll
d883f647ba Add test coverage for WebApplicationContextUtils
See gh-4370
2015-11-27 15:22:29 +01:00
Stephane Nicoll
43b8e65eee Add dedicated section for spring.main.banner-mode
One of the options of the new `banner-mode` property is `off`. YAML maps
`off` to `false` and since we are exposing the method from the
`SpringApplication` public class we can't change the signature to accept
a `String` and do the conversion ourselves.

This commit adds a dedicated section in the guide to warn users about
that particular situation. Adding quotes around the value prevents the
conversion.

Closes gh-4600
2015-11-27 14:04:58 +01:00
Dave Syer
4488bac4c3 Remove server.context-path from actuator endpoints if port set
If the user sets the management.port, he wants some of the
server.* properties, but not the context-path. This change
restores the behaviour in 1.2.x.

Fixes gh-4401
2015-11-27 12:49:43 +00:00
Dave Syer
dd7d587ea8 Add tests to assert behaviour of actuator endpoints with context path
See gh-4401
2015-11-27 12:49:43 +00:00
Dave Syer
7d04ca1e1b Add tests to assert behaviour of actuator endpoints with context path
See gh-4401
2015-11-27 10:56:04 +00:00
Stephane Nicoll
77190f126a Create dedicated section for property conversion
See gh-4604
2015-11-27 11:42:23 +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
Stephane Nicoll
e19d9ff09d Fix gradle config for the bootRun task
Closes gh-4627
2015-11-27 10:23:12 +01:00
Stephane Nicoll
141907c65f Merge branch '1.2.x'
# Conflicts:
#	spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java
#	spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
2015-11-26 20:25:00 +01:00
Stephane Nicoll
ae13082e0d Generate meta-data for nested Lombok types
Closes gh-4397
2015-11-26 20:23:24 +01:00