Commit Graph

144 Commits

Author SHA1 Message Date
Guillaume Lemont
b3da1dc819 Changes ConfigurationService inner classes to static
Allows mocking of those classes.

Fixes gh-1797
2021-11-01 15:31:08 -04:00
spencergibb
3217b05ad7 polish gh-2193 2021-11-01 15:27:03 -04:00
Melnichuk Stas
68dcc35511 Fixes issues with netty assumptions
Fixes issues with concrete interface realization assumptions in ServerWebExchangeUtils (DataBuffer -> NettyDataBuffer and DataBufferFactory -> NettyDataBufferFactory)

Fixes gh-2193
2021-11-01 15:16:46 -04:00
spencergibb
c414f58c7b Adds path predicate match to server web exchange attributes.
GatewayPathTagsProvider then uses that to provide metrics.

See gh-2419
2021-11-01 14:29:59 -04:00
Marta Medio
24c3add1f1 Add metric to include the path as a Gateway metric Tag
Fixes gh-2419
2021-11-01 14:29:40 -04:00
Fredrich Ombico
1c7c05e9bd Add metric to track gateway route definition count (#2421)
* Add metric to track gateway route definition count

* Clean up documentation
2021-10-28 16:02:00 -04:00
Alberto C. Ríos
03867f4ae9 Adding simplified shortcut notation to Retry filter
Fixes gh-2414
2021-10-22 12:49:50 -04:00
spencergibb
4ac1fcb548 Do not write headers when value is null.
Fixes gh-2378
2021-10-06 23:26:37 -04:00
Olga Maciaszek-Sharma
5e746e4f3d 3.0.x jdk17 (#2372) 2021-09-20 14:50:54 +02:00
spencergibb
c195059c3d formatting 2021-09-10 13:35:34 -04:00
Ignacio Lozano
f6bfd6e474 Enrich error response for invalid filter/predicate requests in actuator
In the previous implementation, server responds 400 Bad Request when no existing predicate or filter matches with the specified in the request (See `GatewayControllerEndpointTests.testPostRouteWithNotExistingFilter` & `GatewayControllerEndpointTests.testPostRouteWithNotExistingPredicate`).

This change replaces the filter by an exception that can take the advantage of the default `ExceptionHandler` including a body with more details specified by the server. In order to get the message that helps the client to diagnose the problem, the property `server.error.include-message=always` is required to be configured.

Example:
`POST /actuator/gateway/routes/invalid-route-test` request

Response
```
HTTP 400 Bad Request
Payload

{
    "timestamp": "2021-07-27T08:55:35.596+00:00",
    "path": "/actuator/gateway/routes/invalid-route-test",
    "status": 400,
    "error": "Bad Request",
    "message": "Invalid FilterDefinition: [InvalidFilter]",
    "requestId": "e5551c86-6, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:50437"
}
```

Fixes gh-2107
Fixes gh-2311
2021-09-10 13:34:16 -04:00
Olga MaciaszekSharma
2b8c6e4d5a Merge remote-tracking branch 'origin/2.2.x'
# Conflicts:
#	spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactory.java
#	spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryTests.java
#	spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryUnitTests.java
2021-07-02 19:22:54 +02:00
Olga MaciaszekSharma
47595a7e3a Reformat. 2021-07-02 19:05:35 +02:00
hhwidera
8f8bc9e58a fix problem with missing '[' and ']' around IPv6 address. See https://tools.ietf.org/html/rfc7239 2021-07-02 19:03:19 +02:00
Olga MaciaszekSharma
c87602f09e Revert "Fix 2214 hoxton (#2285)"
This reverts commit 907119dfa3.
2021-07-02 19:03:05 +02:00
Olga Maciaszek-Sharma
907119dfa3 Fix 2214 hoxton (#2285) 2021-07-02 19:00:46 +02:00
buildmaster
c7eed73715 Bumping versions 2021-07-02 02:30:45 +00:00
Ryan Baxter
f4fbebcb1a Merge branch '2.2.x' of github.com:spring-cloud/spring-cloud-gateway into 2.2.x 2021-07-01 17:36:12 -04:00
Ryan Baxter
189c0721c2 Cherry pick ad9e361 2021-07-01 17:36:04 -04:00
spencergibb
d9e5838077 Merge branch '2.2.x' 2021-07-01 17:26:13 -04:00
Bruno Silva
9383b8e2bf Adds a property to disable gateway redis integration.
Fixes gh-2052
2021-07-01 17:24:10 -04:00
Ryan Baxter
ad9e361eaf Merge pull request #2234 from alek-sys/main
Fix secure headers duplication
2021-07-01 15:38:31 -04:00
buildmaster
79cf80be3e Bumping versions 2021-06-02 02:28:55 +00:00
Ryan Baxter
393515c742 Merge pull request #2082 from dlsrb6342/issue-2047
Add resumeWithoutException to CircuitBreakerFilter
2021-06-01 17:05:23 -04:00
spencergibb
68d3d69b11 updates test to ignore localhost part of error message 2021-05-27 14:40:14 -04:00
spencergibb
8423e3ae57 formatting 2021-05-24 11:21:41 -04:00
spencergibb
d861ab7e8f Merge branch '2.2.x' 2021-05-24 11:20:32 -04:00
spencergibb
adc1969bc8 formatting 2021-05-24 11:17:08 -04:00
ctlove0523
0fd5cef6c8 Matches http scheme regardless of case
Fixes gh-2218
2021-05-24 11:17:08 -04:00
Johannes Rost
e9bf4e5fb7 Do not reuse WebsocketClientSpec.Builder between Requests (#2216) 2021-05-21 17:26:41 -04:00
Alexey Nesterov
8044bb1d24 Fix secure headers duplication
When response from the upstream already includes one of the secure headers, it is was duplicated by SCG
2021-05-06 19:40:02 +01:00
spencergibb
bdc9a9910e Merge branch '2.2.x' 2021-04-20 13:19:10 -04:00
spencergibb
2be9d7f91c Suggest setting spring.main.web-application-type=reactive if mvc on classpath.
See gh-2176K
2021-04-20 13:15:59 -04:00
spencergibb
381f54ae60 Merge branch '2.2.x' 2021-04-20 00:20:00 -04:00
spencergibb
2fe4063bfc Only fail if mvc is on the classpath and gateway is enabled.
This is useful for libraries that might write functionality for zuul and gateway.

See gh-2176
2021-04-20 00:14:55 -04:00
buildmaster
65bb35aa16 Bumping versions 2021-04-19 18:06:19 +00:00
spencergibb
a420416c2e Merge branch '2.2.x' 2021-04-19 13:39:11 -04:00
spencergibb
f7a9bebc34 Adds MvcFoundOnClasspathFailureAnalyzer to provide a better experience if mvc is on the classpath.
Previously only a warning was printed in the logs, but sometime ago, ServerCodecConfigurer was added as a bean dependency which caused apps with mvc on the classpath to fail with an error that was difficult to diagnose. The warning was changed to a failure analyzer.

Fixes gh-2176
2021-04-19 13:38:36 -04:00
spencergibb
6466f7342f formatting 2021-04-05 16:27:33 -04:00
spencergibb
24d75147fa Merge branch '2.2.x' 2021-04-05 16:26:09 -04:00
spencergibb
7cb009d297 Removes use of stream() in hot path.
This includes `filter()` and `test()`.

Fixes gh-2197
2021-04-05 16:20:28 -04:00
spencergibb
0992a9840b formatting 2021-03-19 15:17:27 -04:00
spencergibb
6e143d3cd0 Merge branch '2.2.x' 2021-03-19 15:13:02 -04:00
Eugene Sadovsky
9ed6ec0862 Adds support for HttpClient eviction interval.
Fixes gh-2153
Fixes gh-2187
2021-03-19 15:09:26 -04:00
spencergibb
168f33cc90 Ignores blockhound for java16
This includes moving the blockhound-junit-platform dependency to a profile.

Fixes gh-2186
2021-03-19 12:18:42 -04:00
spencergibb
dbd998d5cd Supports compiling and testing for java 16.
Moves kotlin compile to profile that is only activated on a jdk less than 16. This should change once kotlin supports java 16.

Deals with samples that use kotlin moving import to a selector only if the class exists and disabling a new test that tests the kotlin route.

Fixes gh-2186
2021-03-19 11:35:25 -04:00
spencergibb
78b20bd4cd Block while initializing RouteLocator the first time.
This allows the app to fail if there are failures loading routes on startup.

Fixes gh-1676
2021-03-15 13:47:16 -04:00
spencergibb
702c9aaeee Handle errors in both subscriptions.
Previously errors in CachingRouteLocator were on handled on the interior subscribe, not it is handled in both.

Fixes gh-1892
2021-03-15 13:34:49 -04:00
spencergibb
6c7ac3c590 Unignores ClientCertAuthSSLTests.testSslTrust
Fixes gh-2022
2021-03-12 16:43:57 -05:00
spencergibb
f54537e843 Formatting 2021-03-12 16:09:49 -05:00