Commit Graph

707 Commits (ea5195c8a68ad83af7da460af4093afb49c4cf8c)

Author SHA1 Message Date
Phillip Webb 7397dbaf57 Allow ExitCodeGenerator to be used on Exceptions
Update exit code support to allow the ExitCodeGenerator interface to
be placed on an Exception. Any uncaught exception implementing the
interface and returning a non `0` status will now trigger a System.exit
with the code.

Fixes gh-4803
9 years ago
Andy Wilkinson 2aff82bb64 Merge branch '1.2.x' 9 years ago
Stephane Nicoll ecf56f0708 Fixup version numbers following release 9 years ago
Spring Buildmaster 8db59059a5 Next Development Version 9 years ago
Stephane Nicoll bb736e255b Fix SNAPSHOT version 9 years ago
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
9 years ago
Dave Syer c7c685f65f Disable hypermedia in actuator endpoints by default
This change permanently removes links from the endpoints that return
arrays or collections, and also disables them in the rest of the
endpoints (except /actuator) by default.

Fixes gh-4616
9 years ago
Stephane Nicoll f269383803 Polish contribution
Closes gh-4770
9 years ago
David Morley 288aa962c4 Rename method to clarify which connector is being created
See gh-4770
9 years ago
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
9 years ago
Phillip Webb 7f8aff0231 Format HTML in web-ui sample 9 years ago
kozazz 0de4b6ce63 Add update/delete to the web-ui sample
Closes gh-4735
See gh-4733
9 years ago
Phillip Webb 0489a3b4de Polish 9 years ago
Andy Wilkinson 4f7752d467 Merge branch '1.2.x' 9 years ago
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
9 years ago
Andy Wilkinson 0e09408f91 Merge branch '1.2.x' 9 years ago
Ivan Chen d6bd120b2c Remove unused test.css from spring-boot-sample-tomcat
Closes gh-4606
9 years ago
Dave Syer 344360453e Add test for management.security.enabled=false with child context 9 years ago
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
9 years ago
Stephane Nicoll e19d9ff09d Fix gradle config for the bootRun task
Closes gh-4627
9 years ago
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
9 years ago
Stephane Nicoll 14e7b10310 Fixup version numbers following release 9 years ago
Spring Buildmaster 3f6f57a80e Next Development Version 9 years ago
Johnny Lim 4d9111606b Polish docs
Closes gh-4446
9 years ago
Dave Syer 88f776ef17 Remove duplicate sample 9 years ago
Phillip Webb 6c2ea4648f Polish 9 years ago
Dave Syer fa9724becb Revert "Add or avoid proxy configurations for integration tests"
This reverts commit 251f2805a8.
9 years ago
mrumpf 251f2805a8 Add or avoid proxy configurations for integration tests
The Maven POM does all the dependency resolutions for the
spring-boot-antlib project. Delegating this task to Ivy, which is
buried deep in the Antrun/Antunit part of the build, makes any kind
of proxy configuration much more complex.
The ivysettings.xml already has the local M2 repository configured,
but because the folder "repository" is missing, the artifacts, already
downloaded by Maven cannot be resolved from this location.
The Spring and Maven Central repositories should be removed from the
ivysettings.xml files in order to force all resolves to be done through
the local M2 repository. The POM of joda-time version 2.8.1 has an
optional dependency to joda-convert 1.2, which lets the Ivy resolve
process fail, because this version of the joda-convert library was
not resolved by any of the Maven POMs. It seems as if Ivy does not
respect the optional scope, defined in the joda-time POM.

Pass proxy settings to the forked process to make the Gradle distribution download work

Create a gradle.properties file for each Gradle integration test and writes the forking
process' proxy settings as systemProp.http(s).Host/Port to the properties file.
This configures the external process with the right proxy settings to let it download
the Gradle distribution via the HTTP proxy server.

Added a hint for Windows users to get the core.autocrlf setting right

When the core.autocrlf setting under Windows is set to false for example
All files are not converted regarding their EOL characters to the
Windows format with CRLF at a line's end. There is a checkstyle
validation that checks that all files have the system's line endings
and in some test-cases the value from the system property "line.ending"
is used to check test output. So without the conversion, those checks
are going to fail, resulting in build errors.

Fixes gh-4367, fixes gh-3816
9 years ago
Dave Syer cc3f673874 Narrow range of events listened for in security audit
The InteractiveAuthenticationSuccessEvent is always shadowed by a
regulat AuthenticationSuccessEvent, so there's no need to listen for
all AbstractAuthenticationSuccessEvents.

Fixes gh-4355
9 years ago
Stephane Nicoll 791e3048cf Fixup version numbers following release 9 years ago
Dave Syer 96fcd49e2e OpenTsdbMetricWriter -> OpenTsdbGaugeWriter 9 years ago
Dave Syer db03e8ea50 Fix sample and tidy up MetricWriter/GaugeWriter
The metric export configuration was still using the MetricWriter
interface where it should be using GaugeWriter
9 years ago
Andy Wilkinson 74317a220e Merge branch '1.2.x' 9 years ago
Andy Wilkinson 1f92360583 Ensure that HATEOAS sample does not try to produce XML
The HATEOAS sample does not support XML responses. Previously, the
controller doesn't constrain the media types that it could produce.
This would result in a failure when handling a request that prefers
XML responses.

This commit updates the produces clauses in the controller so that
the sample will only attempt to produce JSON.

Closes gh-4343
9 years ago
Andy Wilkinson 248fcbec5d Merge branch '1.2.x' 9 years ago
Andy Wilkinson 05b501ce41 Update Tomcat multi-connectors sample to configure SSL declaratively
The documentation recommends configuring the HTTP connector in code
and using application.properties to configure the HTTPS connector
as it's easier. This commit updates the sample to follow that
recommendation.

Closes gh-4342
9 years ago
Dave Syer abd7bc0466 Add OAuth2 resource server sample
Shows how to use @EnableResourceServer in a pure resource
server and configure the secure paths.
9 years ago
Andy Wilkinson c4122b8f8d Work around brittle annotation scanning in Mojarra
FacesListener in Mojarra 2.2.12 (used in Glassfish 4.1.1) is a
ServletContainerInitializer that’s annotated to handle types annotated
with javax.annotation.Resource.
OAuth2RestOperationsConfiguration.SessionScopedConfiguration is one such
class. This leads to com.sun.faces.config.DelegatingAnnotationProvider
calling getAnnotations on SessionScopedConfiguration.class. This fails
with a java.lang.ArrayStoreException due to SessionScopedConfiguration
being annotated with @ConditionalOnBean(OAuth2ClientConfiguration) and
OAuth2ClientConfiguration not being on the classpath.
DelegatingAnnotationProvider currently catches NoClassDefFoundErrors
thrown during its annotation processing. It needs to be made more
robust so that it also copes with an ArrayStoreException, in a similar
way to how org.glassfish.apf.impl.AnnotationProcessorImpl was updated to
fix GLASSFISH-21265 [1]. I’ve opened an issue to this effect [2].

In the meantime, we can work around the brittleness in
DelegatingAnnotationProvider by restructuring
SessionScopedConfiguration. This commit moves the use of @Resource into
a nested inner class, ClientContextConfiguration, while leaving the use
of @ConditionalOnBean on SessionScopedConfiguration. This means that it
is now ClientContextConfiguration that is passed to FacesListener and
processed by DelegatingAnnotationProcessor, thereby avoiding exposing
it to the @ConditionalOnBean annotation that it does not handle
gracefully. A Glassfish-based deployment test has also been added to
verify the fix.

Closes gh-2079
Closes gh-4321

[1] https://java.net/jira/browse/GLASSFISH-21265
[2] https://java.net/jira/browse/JAVASERVERFACES-4076
9 years ago
Huang YunKun 1c5e445554 Update the samples to use @WebIntegrationTest and randomPort=true
Closes gh-4294
Closes gh-4271
9 years ago
Andy Wilkinson d9d4cc2ef5 Ensure request context is setup before security filter runs
Previously, OrderedRequestContextFilter was ordered such that it
ran after Spring Security's Filter. This meant that the request
context was unavailable to any Filters in Spring Security's Filter
chain. Specifically, this caused a failure when using @EnableOAuth2Sso
as OAuth2ClientAuthenticationProcessingFilter, which is added to
Spring Security's Filter chain would be unable to use the
request-scoped bean upon which it depends.

This commit updates the order of OrderedRequestContextFilter so that
the request context is set up before Spring Security's Filter runs.
The tests for SampleGitHubApplication have been updated to use
TestRestTemplate rather than MockMvc. This is necessary as the latter,
via ServletTestExecutionListener, automatically populates the request
context holder, masking the fact that the request context filter was
setting it up too late.

Closes gh-4270
9 years ago
Andy Wilkinson 89df4946f7 Use a context-relative URL for Dev Tools sample’s CSS 9 years ago
Phillip Webb 634bb770b2 Organize imports with new settings
See gh-4234
9 years ago
Phillip Webb 1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 9 years ago
Phillip Webb a79131f8d2 Organize imports with new settings
See gh-4234
9 years ago
Spring Buildmaster 2b38a861e3 Next Development Version 9 years ago
Andy Wilkinson ac944f02cc Use a random HTTP port when running SampleLiquibaseApplicationTests 9 years ago
Andy Wilkinson 874cd3390e Fix version of parent in pom for spring-boot-sample-war 9 years ago
Phillip Webb d84889b03c Revert "Compile samples and integration tests with Java 8"
This reverts commit 09395f956a.
9 years ago
Phillip Webb 5392c0a52b Merge remote-tracking branch 'springsource/1.2.x' 9 years ago
Phillip Webb 56643222cf Add simple war sample 9 years ago