Commit Graph

6307 Commits (c6e08eb8833024e3616d1847c28b057ad4f80942)
 

Author SHA1 Message Date
Dave Syer 96ba5ed32c Ensure OAuth2 context state is not reset if access tokens match
We can expect that occasionally a user clicks on a login link when
the token is expired. If the UserInfoTokenServices tries to
authenticate the user at that point, it can retain the option to
refresh the expired token if we preserve the state. Since the
state is in session scope all we need to do is to check that the
token that is being checked has the same value as the one in the
OAuth2ClientContext and re-use the context if it is.

Fixes gh-4251
9 years ago
Dave Syer cfb12fc7c2 Clarify how to switch off security autoconfiguration
The fact that the web security and the authentication manager are
controlled separately should hopefully now be clearer.

Fixes gh-3292
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 2cfb6fe0f5 Merge branch '1.2.x' 9 years ago
Stephane Nicoll 791e3048cf Fixup version numbers following release 9 years ago
Stephane Nicoll 2aa1a02699 Merge pull request #4359 from ZakarFin/master
* pr/4359:
  Fix linux service script command syntax
9 years ago
ZakarFin efa7303507 Fix linux service script command syntax
Closes gh-4359
9 years ago
Dave Syer f3a2c1f4ac More clarification in metrics export docs 9 years ago
Dave Syer 40f3bed54b Catch up open tsdb docs 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
Dave Syer 03c56b4cf1 Split MetricWriter into 2 interfaces covering counters and gauges
This way the MetricCopyExporter can make a sensible choice about
what to do with counter metrics, and cache the latest values, so that
they can be properly incremented.

Fixes gh-4305
9 years ago
Stephane Nicoll 0b326035b0 Fix detection of property setter
Previously, the meta-data annotation processor was taking the first
setter that match the property name it has to handle. Contrary to
getters that are enforced by a return type (no argument), multiple
setter candidates may exist.

If a property's type got narrowed over time, the original setter may
have been marked as Deprecated. As the annotation processor takes the
first setter that matches based on the name only, it may pick up the
deprecated one and therefore mark the property as being (wrongly)
deprecatede in the meta-data.

It turns out that checking for the actual type of the setter parameter
brought a side effect: some primitive properties may use the primitive
or the Wrapper counter part. This commit not only look at the proper
setter based on the type but also fallback on the wrapper (or) primitive
if necessary.

Closes gh-4338
9 years ago
Dave Syer 5ed7156061 Add support for lists in SPRING_APPLICATION_JSON 9 years ago
Stephane Nicoll 986275c73d Order configuration properties group in Appendix
Create a set of core groups to gather properties logically: core, web,
security, data, integration, actuator and devtools.

In each of them, groups are ordered against their lexical order.

Closes gh-4344
9 years ago
Andy Wilkinson e3498edc81 Upgrade to Spring Security 4.0.3.RELEASE
Closes gh-3923
9 years ago
Phillip Webb 0ccd33705d Use RelaxedDataBinder for excludes
Update `EnableAutoConfigurationImportSelector` to directly use the
RelaxedDataBinder when obtaining excludes. This removes the need for
the additional getProperties method on RelaxedPropertyResolver.

See gh-4352
9 years ago
Stephane Nicoll abfd139d8f Fix `spring.application.exclude` YAML property
`spring.application.exclude` is retrieved via the
`RelaxedPropertyResolver` API explicitly and it does not have any
standard API to retrieve a list of values. As a consequence that property
could only be specified as a comma-separated value.

This felt convoluted in YAML. `RelaxedPropertyResolver` has now a
`getProperties` method that works with both comma-separated value and
index elements (i.e. list).

Closes gh-4352
9 years ago
Vedran Pavic 718ea5f78b Update systemd service documentation
- update script with valid exit status to ensure service stops cleanly
- clarify unused customization variables

Closes gh-4334
9 years ago
Andy Wilkinson 826acf5d67 Set the working directory to that of the jar when using start-stop-daemon
By default, start-stop-daemon will chdir to the root directory before
starting the process. This prevents an application.properties file that
sits alongside the jar from being found.

This commit updates the call to start-stop-daemon to use --chdir to
set the working directory to that of the jar that’s being launched.

Closes gh-4281
9 years ago
Stephane Nicoll 9a7baf195e Fix typo 9 years ago
Andy Wilkinson b752b0f1d6 Upgrade to Jaybird 2.2.9
Closes gh-4351
9 years ago
Andy Wilkinson bffa10e80b Upgrade to httpcore 4.4.4
Closes gh-4350
9 years ago
Andy Wilkinson 648c983313 Upgrade to commons-dbcp2 2.1.1
Closes gh-4349
9 years ago
Andy Wilkinson 36fb5e4ade Upgrade to EHCache 2.10.1
Closes gh-4348
9 years ago
Andy Wilkinson fc1d920346 Upgrade to Undertow 1.3.4.Final
Closes gh-4347
9 years ago
Andy Wilkinson db588646c6 Upgrade to HikariCP-java6 2.3.12
Closes gh-4346
9 years ago
Andy Wilkinson 02d7e2826c Don’t call ignoring.antMatchers([]) as empty array now maps to /**
Previously, if security.ignored was set to none and the error controller
was disabled, there would be no paths to ignore and we would call
IgnoredRequestConfigurer.antMatchers with an empty array. While a bit
pointless, this had no effect on Spring Security’s configuration.

This behaviour has changed in the latest 4.0.3 snapshots [1]. An empty
array passed to IgnoredRequestConfigurer.antMatchers now maps to /**. As
Spring Boot configures its ignored paths with highest precedence this
means that security is now disabled for every path.

This commit updates both the management security and application
security configuration to avoid calling antMatchers with an empty
array, thereby ensuring that we don’t inadvertently ignore every path.
Even if the change to Spring Security is reverted we can keep this
change. The behaviour will remain the same and, arguably, it makes the
intent of our configuration clearer.

Closes gh-4345

[1] 8663ac4173
9 years ago
Andy Wilkinson 1e4257daed Fix the javadoc in SpringApplicationJsonEnvironmentPostProcessor 9 years ago
Andy Wilkinson 0c1efa473e Update documentation on how to configure the main class with Gradle
In 1.3, our Gradle plugin no longer automatically applies the
application plugin. This affects the default options that are
available for explicitly configuring a project's main class. This
commit updates the documentation accordingly.

Closes gh-3768
9 years ago
Dave Syer ba7d12c697 Clarify application.properties example
The syntax was a bit tortured. This should clarify things and also
de-emphasise the "production" use case for the file system
properties file (we want to be cloud native don't we?).
9 years ago
Dave Syer ee5a1f9722 Make SPRING_APPLICATION_JSON processing happen before config files
That way any properties that are needed for processing the config
files will be available in time. Makes sense given that env vars
is the main carrier of the inline JSON.
9 years ago
Dave Syer 1f675c026f Add support for inline JSON in SPRING_APPLICATION_JSON
User can supply inline JSON as an env var (SPRING_APPLICATION_JSON)
or System property (spring.application.json).

Fixes gh-4239
9 years ago
Stephane Nicoll 86c753a149 Temporary fix the build
(I mean it this thime)

See gh-4345
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
Stephane Nicoll 00e207dcaf Temporary fix the build
See gh-4345
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
Stephane Nicoll fd2db51da7 Consistently document default and example values
Previously, the "Common application properties" appendix had no
consistent use of a configuration key value. It could just as well be
the default value or an example.

We now always document the default value after the "=" sign and
eventually add an example with the phrasing "For instance".

The keys have also been reordered so that they follow a natural (i.e.
lexical) order.

Closes gh-3230
Closes gh-3160
Closes gh-3155
Closes gh-3153
9 years ago
Andy Wilkinson 549f873941 Update RestarterTests to expect listener to be notified at least once 9 years ago
Andy Wilkinson eaa4d900eb Update auto-configured ParameterNamesModule to use DEFAULT creator mode
The PROPERTIES creator mode has the unfortunate side-effect of stopping
mixins from working. This commit updates the auto-configured module to
use the DEFAULT creator mode instead.

Closes gh-4336
9 years ago
Stephane Nicoll 7742dafccf Improve meta-data description 9 years ago
Andy Wilkinson 79d99e1847 Update ShellPropertiesTests to expect whitespace to be trimmed
The latest Spring Framework 4.2.3 snapshots appear to be trimming
whitespace as part of the binding process. This commit updates the
test's expectations accordingly.
9 years ago
Andy Wilkinson aaae4aa3a1 Prevent restarts from switching off Log4J2-based logging
During a restart, the Restarter runs all registered shutdown hooks. This
breaks Log4J2 as it leaves it in a shutdown state that leaves logging
switched off such that no output it produced when the application starts
up again.

This commit introduces a new RestartListener abstraction.
RestartListeners are notified prior to the application being restarted.
A Log4J2-specific implementation is provided that prepares Log4J2 for
restart by removing any shutdown callbacks from its shutdown callback
registry. This prevents the restart from shutting down Log4J2, ensuring
that it still functions when the application restarts.

Closes gh-4279
9 years ago
Andy Wilkinson 85d5766d54 Correct plugin name of ExtendedWhitespaceThrowablePatternConverter
Previously, it had the same plugin name as
WhitespaceThrowablePatternConverter which meant that only one of the
two plugins was available and the other’s converter keys didn’t work.

Closes gh-4337
9 years ago
Stephane Nicoll c98d3208b2 Merge pull request #4316 from klieber/bugfix/oauth2-auth-server-autoconfig
* pr/4316:
  Polish contribution
  Add missing properties to OAuth2AutorizationServer
9 years ago
Stephane Nicoll 10a079fb07 Polish contribution
Closes gh-4316
9 years ago
Kyle Lieber c6783e8663 Add missing properties to OAuth2AutorizationServer
Make sure that `autoApprove`, `accessTokenValiditySeconds`, and
`refreshTokenValiditySeconds` properties from the `ClientDetails`
are used

Closes gh-4306
9 years ago
Stephane Nicoll 6578239f67 Fix binding of Collection of enum
As there is no way to copy all the converters of a `ConversionService` to
another, `RelaxedConversionService` uses a fallback `ConversionService`
when the user-provided one failed.

That fallback is taking care of converting `String` to `Enum` in a case
insensitive way but it has no registered converter to convert a comma
separated String to a collection of something.

Ironically, our current test suite has plenty of cases where we map a
`String` to  a collection of enums and they all pass. This is because
the tests do not provide a custom `ConverterService` so we end up
immediately in the fallback scenario. Since no converter is able to
convert the String to a collection, the property editor support of the
binder takes care of that for us and try to convert each individual
value.

In a regular use case however, a `ConversionService` is provided and
fails to map the collection if the String value(s) don't have the exact
same case as the annotations they represent. Since the original
`ConversionService` has claimed it was able to convert a collection,
the raw `String` value is passed to the fallback converter and that one
fails to convert the raw String.

The fallback converter now registers the necessary converters to
convert collections. Additional tests have been added to test that in
a more explicit way.

Closes gh-4322
9 years ago