Commit Graph

6086 Commits

Author SHA1 Message Date
Andy Wilkinson 315e63b017 Allow default DevTools properties to be overridden
Previously the default DevTools property source was added in first place
to the environment’s property sources in an unordered environment
post-processor. This made it difficult to override them.

This commit updates the post-processor to be ordered with lowest
precedence and to add the property source in last place. This should
allow any other property sources and to override the defaults.

Closes gh-3851
2015-10-02 16:38:45 +01:00
Stephane Nicoll 19b5e59234 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
2015-10-02 16:22:08 +02:00
Stephane Nicoll 8978f54cc3 Use spring.velocity.charset for template encoding
Previously `spring.velocity.charset` only controlled the output encoding
with the templates being loaded with the default encoding. We now
consistently set the same value for both the input and output encodings.

It is still possible to override it to a different value using
`spring.velocity.properties.input.encoding`

Closes gh-3994
2015-10-02 16:12:42 +02:00
Dave Syer e232e7c837 Add warning about export of metrics being switched off
E.g. just adding Dropwizard to the classpath switches it off which
might be surprising. We need a @ExportMetricReader to do the export.
2015-10-02 14:51:50 +01:00
Dave Syer 57d9b58f79 Fix rule about whitespace in Collections.<String>emptyList() 2015-10-02 14:26:54 +01:00
Dave Syer 67a70571de Add simple SSO sample with github authentication 2015-10-02 14:13:15 +01:00
Andy Wilkinson 10fbae8fb6 Avoid leaking application context shutdown hooks in the tests
Closes gh-4053
2015-10-02 13:33:01 +01:00
Stephane Nicoll c6040e42a8 Fix typo 2015-10-02 14:06:10 +02:00
Stephane Nicoll b2c3e7e2ed Rename error.* properties to server.error.*
Closes gh-4050
2015-10-02 14:03:24 +02:00
Dave Syer 4b1389179d Attempt to fix test failures caused by ordering issues 2015-10-02 10:52:03 +01:00
Dave Syer e1070cce07 Check authorities of user in HealthMvcEndpoint
We need to be a bit cautious about whether Spring Security is on
the classpath or not, but if it is we can test for the admin role
(as specified in `management.security.role`).

Fixes gh-4060
2015-10-02 10:42:43 +01:00
Dave Syer 972557851a All MVC endpoint paths to be separately customized from the id
This change applies only to "standard" MVC endpoints (not the extended
ones like /env and /jolokia which already have this feature). Allows
users to supply an endpoints.{name}.path.

Fixes gh-2790
2015-10-02 10:42:43 +01:00
Andy Wilkinson 434d46f583 Add support for using RemoteSpringApplication behind a proxy
This commit adds two new properties, spring.devtools.remote.proxy.host
and spring.devtools.remote.proxy.port that can be used to configure
RemoteSpringApplication to connect to the remote application through
an HTTP proxy.

Closes gh-3968
2015-10-02 10:37:32 +01:00
Andy Wilkinson 0c2f281e89 Merge branch 'gh-4047' 2015-10-02 09:13:28 +01:00
Andy Wilkinson f86eed8646 Polish contribution 2015-10-02 09:03:26 +01:00
mackeprm 942da8bdd3 Support configuration of defaultValue and emptyStringIsFalse
This commit adds support for configuring defaultValue and
emptyStringIsFalse to MustacheCompilerFactoryBean.

Closes gh-4057
2015-10-02 08:57:43 +01:00
Phillip Webb 1e8017232b Merge branch 'gh-4018' 2015-10-02 00:01:22 -07:00
Phillip Webb d4c2959cee Document X-Forwarded-For support
Closes gh-4018
2015-10-02 00:00:22 -07:00
Phillip Webb 33ce160251 Automatically X-Forwarded-For in the cloud
Update `ServerProperties` to automatically enable `use-forward-headers`
when running on a cloud platform.

A new `CloudPlatform` enum has been introduced that detects Heroku and
Cloud Foundry.

See gh-4018
2015-10-02 00:00:14 -07:00
Phillip Webb 20b29db512 Unify ServerProperties X-Forwarded-For support
Add a new `server.use-forward-headers` property which can be used to
switch on X-Forwarded-For header support in all supported embedded
servlet containers.

This commit reverts the decision to enable `RemoteIpValve` with Tomcat
by default (gh-3782) and requires that either `user-forward-headers` is
set to true or that `server.tomcat.protocol-header` or
`server.tomcat.remote-ip-header` are set.

See gh-4018
See gh-3782
2015-10-01 23:59:59 -07:00
Phillip Webb c35105b868 Add X-Forwarded-For header support to Undertow
Add a `useForwardHeaders` property to allow embedded Undertow
containers to respect X-Forwarded-For headers.

Fixes gh-3881
2015-10-01 23:59:48 -07:00
Phillip Webb 7f97681969 Add X-Forwarded-For header support to Jetty
Add a `useForwardHeaders` property to allow embedded Jetty containers
to respect X-Forwarded-For headers.

Fixes gh-3802
2015-10-01 23:59:33 -07:00
Phillip Webb 50430a20c6 Add Tomcat X-Forwarded-For header tests
Update Abstract & Tomcat EmbeddedServletContainerFactoryTests to check
that X-Forwarded-For headers work as expected.

See gh-4018
2015-10-01 23:59:12 -07:00
Phillip Webb 5cbb81c64f Fix management security when using different port
Update ManagementWebSecurityAutoConfiguration to reinstate lazy creation
of EndpointHandlerMapping from the EndpointPathRequestMatcher.

Fixes a regression introduced in eb2984781 and picked up my one of the
sample integration tests.

Fixes gh-4059
2015-10-01 18:06:43 -07:00
Phillip Webb 7801a3879e Protect against missing spring-web.jar
See gh-4068
2015-10-01 16:30:23 -07:00
Phillip Webb 6be072ae07 Polish 2015-10-01 14:44:23 -07:00
Phillip Webb 0b36ba97b3 Polish order 2015-10-01 12:02:32 -07:00
Dave Syer 2169bbbc9b Check Environment matches webEnvironment after it is initialized
After the ApplicationEnvironmentPrepared we now check that the
webEnvironment flag and/or the Environment hasn't changed, in case
the user wanted to switch the context from a web to non-web in a
listener.

Fixes gh-2716
2015-10-01 17:47:26 +01:00
Stephane Nicoll 93d12494e5 Migrate Spring Data Rest settings
In order to have more control on the structure of the configuration, we
do not bind to `RepositoryRestConfiguration` directly anymore. This
commit introduces `RepositoryProperties` instead.

See gh-3854
Closes gh-4073
2015-10-01 17:56:32 +02:00
Andy Wilkinson 2964fd28a0 Polishing 2015-10-01 14:06:00 +01:00
Dave Syer 933aad3c06 Make checkstyle happier 2015-10-01 13:53:04 +01:00
Dave Syer c8021fa526 Comment out logback config 2015-10-01 13:45:59 +01:00
Dave Syer eb29847814 Hone the security rules for actuator endpoints
Takes into account the fact that the new /actuator endpoint sometimes
loses its path (it is "" relative to a non-empty management context path).

Fixes gh-4059
2015-10-01 13:38:18 +01:00
Dave Syer 15f22651f8 Add logging.pattern.level to config metadata 2015-10-01 11:38:54 +01:00
Stephane Nicoll 42c49b1c4f Merge pull request #4069 from izeye/polish-20151001
* pr/4069:
  Polish
2015-10-01 09:57:22 +02:00
izeye 5b211706c0 Polish
Closes gh-4069
2015-10-01 09:56:33 +02:00
Phillip Webb db0212b834 Allow spring-boot-devtools to work with JRebel
Update devtools to detect JRebel and disable application restarts. Other
features (such as LiveReload) can still be used.

Fixes gh-3095
2015-09-30 15:48:20 -07:00
Phillip Webb acde5407e8 Polish 2015-09-30 15:48:19 -07:00
Dave Syer cad2666522 Add support for LOG_LEVEL_PATTERN replacing the default level pattern
For logback we also support logging.pattern.level as a synonym.

Fixes gh-4062
2015-09-30 17:15:34 +01:00
Stephane Nicoll eeaa1df1dd Allow Mongo support without Spring Data MongoDB
Closes gh-4049
2015-09-30 14:56:59 +02:00
Stephane Nicoll b14756a7bb Improve git commit information for Gradle
Closes gh-3949
2015-09-30 14:41:31 +02:00
Stephane Nicoll 623fcfeff1 Properly guard cache statistics providers
Previously, a `NoClassDefFoundError` could be thrown if EhCache or Guava
is on the classpath without `spring-context-support` as the respective
cache statistics provider both needs the implementation and the spring
abstraction implementation.

The `@ConditionalOnClass` definition has been updated to properly guard
those beans.

Closes gh-3960
2015-09-30 14:36:39 +02:00
Andy Wilkinson 0d1729cb65 Fix Checkstyle warning 2015-09-30 11:15:49 +01:00
Andy Wilkinson 1f4dc77715 Improve error message when a non-directory is added to FileSystemWatcher
Previously, if a file or non-existent directory was added to
FileSystemWatcher, it would fail with the message “Folder must not be a
file”. While it suggests that the folder needs to be a directory, it
doesn’t make it clear that it also needs to exist. It also doesn’t
tell the user which folder caused the problem.

This commit updates the message to make it clear that the folder must
exist and must be a directory, and the include the name of the
problematic folder in the error message.

Closes gh-3918
2015-09-30 10:54:51 +01:00
Andy Wilkinson 968caf05b6 Merge branch 'gh-3977' 2015-09-30 10:39:22 +01:00
Andy Wilkinson 64bcba47a9 Polish contribution
- Add @author tag
 - Remove unnecessary final modifiers
 - Avoid writing to volatile field when new gauge is used

Closes gh-3977
2015-09-30 10:39:05 +01:00
Jay Anderson 3fb0ae3e3b Register dropwizard gauges once and then update them
The previous implementation would remove and add a new Gauge each time
a metric was written. After this change the Gauge is registered once
and the value is updated on subsequent calls.
2015-09-30 10:30:55 +01:00
Andy Wilkinson ff5e4631e3 Add MockMvc-based integration tests for management.security.enabled
See gh-3997
2015-09-30 10:19:04 +01:00
Andy Wilkinson a76e84addc Restore LoggingSystems’ previous cleanup behaviour
This commit reverts the changes made for gh-4026. Those changes updated
each LoggingSystem to close/stop the underlying logging system as part
of the clean up processing. Unfortunately, this approach doesn’t work
in an environment where their are multiple application contexts and
some have a shorter lifecycle than the “main” application context. In
such an environment, closing an application context with a shorter
lifecycle prior to the main application context being closed will
close/stop the main application context’s logging system as, rather than
being scoped to an application context, a logging system is shared
across multiple application contexts. (The exact details of how widely
shared the logging system is varies between logging systems and, in the
case of Logback and Log4J2, also depends on which ContextSelector
implementation is being used.
2015-09-30 09:34:32 +01:00
Stephane Nicoll e98aac4327 Polish d01bc41
Closes gh-2516
2015-09-30 09:54:13 +02:00