265 Commits

Author SHA1 Message Date
Phillip Webb
41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 22:43:12 -07:00
Phillip Webb
e125085993 Merge branch '1.5.x' into 2.0.x 2018-05-03 12:43:50 -07:00
Andy Wilkinson
f019d5c85b Merge branch '1.5.x' into 2.0.x 2018-05-02 12:22:04 +01:00
Stephane Nicoll
2b98b11c12 Polish "Less object instantiation in WebMvcTags"
Closes gh-12894
2018-04-18 09:41:40 +02:00
Jon Schneider
d676147680 Less object instantiation in WebMvcTags
See gh-12894
2018-04-18 09:38:23 +02:00
Stephane Nicoll
0bc7bef5e5 Properly handle InvalidEndpointRequestException
This commit makes sure that `InvalidEndpointRequestException` is wrapped
in a `ReflectionException` when invoked via JMX.

Closes gh-12857
2018-04-16 11:33:22 +02:00
dreis2211
2bbf438c36 Fix duplicate words in comments
Closes gh-12866
2018-04-16 08:09:40 +02:00
Stephane Nicoll
fa542bacc0 Translate user-defined exception when invoking JMX operation
This commit makes sure to respect the MBeanServer#invoke contract by
wrapping any user-defined exception in an MBeanException. Also, any
exception not from the JDK is translated, as it may lead to unexpected
issue on the client if that class isn't present. This is consistent
with our operation result mapping strategy.

Closes gh-10448
2018-04-13 16:26:04 +02:00
Brian Clozel
b2e7be17ab Polish gh-11514
As pointed out by Rossen in gh-11514 comments, a handler might commit
the response and then send an error signal in the pipeline. In this
case, adding a callback to `beforeCommit` is useless because it won't be
triggered. In those cases, we need to collect metrics right away.
2018-04-12 22:50:16 +02:00
Brian Clozel
3fa8fe85af Deprecate RouterFunctionMetrics
Spring Boot now deploys both annotation-based and functional endpoints
under the same `HttpHandler`; this means the currently auto-configured
`MetricsWebFilter` is instrumenting all endpoints to produce metrics.

There is no need for a WebFlux functional specific support.
This commit removes mentions of `RouterFunctionMetrics` in the docs and
deprecates that class.

Closes gh-12833
2018-04-12 12:08:44 +02:00
Brian Clozel
77be10e7bc Fix "status" metrics tag for error responses
Prior to this commit, the metrics `WebFilter` would handle exceptions
flowing through the pipeline and extract tag information right away.
Since error handling turns the exception information into error HTTP
responses later in the chain, the information extracted from the
response earlier is invalid.
In this case, the "status" information could be "200" whereas error
handlers would later set that status to "500".

This commit delays the tags extraction later in the process, right
before the response is comitted. The happy path is not changed, as
handlers signal that the response is fully taken care of at that point.

Fixes gh-11514
2018-04-12 11:30:43 +02:00
Stephane Nicoll
e8fac7d9c4 Properly discover endpoints that are proxied
Previously to this commit, if a `@ControllerEndpoint`,
`@RestControllerEndpoint` or `@ServletEndpoint` annotated bean was
proxied, the endpoint wasn't properly detected.

This commit makes sure that annotation retrieval works on the user class
while preserving the get (vs. find) retrieval semantic

Closes gh-12441
2018-04-10 20:23:55 +02:00
Stephane Nicoll
86b96254a1 Migrate to ApplicationContextRunner 2018-04-10 20:23:54 +02:00
Johnny Lim
f03849d502 Polish
See gh-12812
2018-04-10 11:46:16 +02:00
Andy Wilkinson
8d5b9f37d5 Merge branch '1.5.x' 2018-04-09 17:59:53 +01:00
Phillip Webb
598e9bb842 Polish 2018-04-04 18:01:25 -07:00
Brian Clozel
f6d16c8b99 Align WebFluxTags uri support on WebMvcTags
This commit ensures that `WebFluxTags` not only relies on
`BEST_MATCHING_PATTERN_ATTRIBUTE` or request URI to provide the "uri"
tag information.

To avoid cardinality explosion, HTTP not found and redirects are
assigned fixed uri tags.

Closes gh-12685
2018-04-04 11:46:10 +02:00
Phillip Webb
98a2a91d16 Polish 2018-03-29 14:00:13 -07:00
Brian Clozel
ebb2f70e0b Make WebMvgTags use matched patterns for HTTP 404
Prior to this commit, `WebMvcTags' would always mark as "NOT_FOUND" or
"REDIRECTION" *any* exchange with responses of 404 and 3xx status, even
if those responses are actually returned by Controller handlers.

This commit checks inverts those checks and first considers if the
"BEST_MATCHING_PATTERN_ATTRIBUTE" request attribute is present and uses
it - then falls back to "NOT_FOUND" and "REDIRECTION" to avoid
cardinality explosion.

Fixes gh-12577
2018-03-29 20:33:07 +02:00
Madhura Bhave
8b29823885 Prevent StackOverFlowException in metadata processor
Fixes gh-11037
2018-03-28 07:58:13 -07:00
dreis2211
3b0f6e7168 Use Supplier variants of Assert methods
See gh-12630
2018-03-26 17:58:17 +02:00
Johnny Lim
625bf93598 Polish
See gh-12584
2018-03-26 17:33:25 +02:00
Phillip Webb
78534a753d Polish "Iterate map by using lambda function"
See gh-12528
2018-03-19 08:00:36 -04:00
igor-suhorukov
ffc883b005 Iterate map by using lambda function
Closes gh-12528
2018-03-19 07:50:54 -04:00
Phillip Webb
6e2ecb8a43 Fix broken endpoint integration tests
Ensure that JSON response is returned when extracting data from the
error details.

See gh-12513
2018-03-17 12:29:39 -07:00
Andy Wilkinson
2da4897aa8 Polish 2018-03-16 09:57:35 +00:00
Johnny Lim
2e6914ea88 Add missing super() calls
Closes gh-12459
2018-03-14 15:56:53 -07:00
dreis2211
8626daf135 Replace Mockito.times(0) with Mockito.never()
Closes gh-12475
2018-03-14 15:12:20 -07:00
dreis2211
0d3f3e46dd Fix typos
Closes gh-12468
2018-03-13 17:42:19 -07:00
Andy Wilkinson
2f1b2e3ce2 Log summary of web-exposed endpoints during startup
Closes gh-12442
2018-03-13 14:55:51 +00:00
igor-suhorukov
12185251c1 "toString()" should never be called on a String object
Closes gh-12452
2018-03-13 08:45:02 +01:00
igor-suhorukov
aebb475bc5 Reorder modifiers to comply with the JLS
See gh-12432
2018-03-12 15:17:05 +01:00
Johnny Lim
3c9cee2a8c Invoke mapStatus() only when necessary
Closes gh-12419
2018-03-09 16:21:42 +01:00
Madhura Bhave
89e42d40c5 Provide security matchers for actuator links
Fixes gh-12353
2018-03-07 19:02:35 -08:00
Johnny Lim
751c444166 Polish
See gh-12326
2018-03-03 12:25:41 +01:00
Phillip Webb
7bc535e4fa Polish 2018-02-28 10:59:26 -08:00
Johnny Lim
f12c7ab38a Remove an unnecessary method in EndpointDiscoverer
Closes gh-12284
2018-02-28 15:45:25 +01:00
Phillip Webb
29c3be3590 Polish 2018-02-26 10:26:02 -08:00
Stephane Nicoll
306c79f0de Merge branch '1.5.x' 2018-02-26 18:03:32 +01:00
Stephane Nicoll
cd522dadcd Revert "Add Kafka health indicator"
Closes gh-12225
2018-02-26 15:46:35 +01:00
Phillip Webb
4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Phillip Webb
3076a5523a Fix checkstyle violation 2018-02-20 22:37:37 -08:00
Phillip Webb
8c24988faa Fix checkstyle violation 2018-02-20 22:02:02 -08:00
Phillip Webb
0925a0957e Polish 2018-02-20 16:24:35 -08:00
Phillip Webb
05faac2b09 Polish 2018-02-20 15:53:25 -08:00
Andy Wilkinson
8f699cd6f6 Use RoleVoter for role checks in ReactiveSecurityContext
See gh-11869
2018-02-20 17:11:57 +00:00
Andy Wilkinson
ae45b6730b Apply ROLE_ prefix when needed in ReactiveSecurityContext isUserInRole
See gh-11869
2018-02-20 16:38:16 +00:00
Andy Wilkinson
daa280faff Drop AuthorityReactiveAuthorizationManager and avoid need to block
See gh-11869
2018-02-20 16:29:28 +00:00
Stephane Nicoll
7c365bb253 Polish 2018-02-20 13:42:28 +01:00
Andy Wilkinson
87ef9a1d97 Polish 2018-02-20 12:37:24 +00:00