Commit Graph

588 Commits

Author SHA1 Message Date
Stéphane Lagraulet
f5bb5ff9c1 Keep old constructors to maintain backwards compatibility with spring cloud sleuth 2016-08-18 11:24:15 +02:00
Stéphane Lagraulet
ca2c9018c6 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-netflix into zuul_hystrix_threadpool 2016-08-17 18:11:52 +02:00
Spencer Gibb
9ed5621a78 Revert "Adds zuul property to customize Hystrix ExecutionIsolationStrategy"
This reverts commit 21df6e43a3.
2016-08-17 09:57:35 -06:00
Dave Syer
b9e2a1b21e Fix test so it actually works if there is a server on localhost:80 2016-08-17 09:19:33 +01:00
Dave Syer
f76f294f7f Rename test to conform to usual pattern 2016-08-17 09:04:37 +01:00
Spencer Gibb
64fff7edd2 Merge branch 'context-path-prefix-support' of https://github.com/kakawait/spring-cloud-netflix into kakawait-context-path-prefix-support 2016-08-16 12:59:10 -06:00
Stefan Fussenegger
d9768b5378 Improved zuul proxy header support.
- add zuul.add-host-header property to add Host header
- add port to X-Forwarded-Host as defined in RFC 7239
- extract PreDecorationFilter.filterOrder() into a public constant

fixes gh-1108
2016-08-16 12:56:54 -06:00
Stéphane Lagraulet
21df6e43a3 Adds zuul property to customize Hystrix ExecutionIsolationStrategy
Add a check to current context as contentLength is already in the context
Get content length from Headers when RibbonCommandContext is built + add tests
Use request content length RibbonRoutingFilter
Add documentation for new zuul.ribbonIsolationStrategy property

fixes gh-339
2016-08-16 10:43:24 -06:00
Stéphane Lagraulet
62344dccda Merge branch 'master' into zuul_hystrix_threadpool 2016-08-11 09:42:03 +02:00
Stéphane Lagraulet
03caa1b8ce Remove deprecated and unused constructors for RibbonCommandContext and RestClientRibbonCommand 2016-08-11 09:41:15 +02:00
Ryan Baxter
36fec07a17 Merge pull request #1093 from daniellavoie/hystrix-security
Expose security context to any Hystrix command.
2016-08-10 15:20:19 -04:00
Mike Liu
f37b513f21 Add @Qualifier customization for @FeignClient
Changed test to use @Qualifier.
Add documentation to reference the new attribute.
2016-08-10 12:22:33 -06:00
libetl
519be4db06 MetricsInterceptorConfiguration modifies potenially unmodifiable list.
fixes gh-1240
2016-08-10 12:00:49 -06:00
Scott Oster
5e698278a8 Fixed double-encoding issue in RibbonClientConfiguration
fixes gh-1241
2016-08-10 11:24:59 -06:00
Spencer Gibb
909a51000f Remove @Ignore
fixes gh-1157
2016-08-09 16:50:57 -06:00
Stéphane Lagraulet
4dc016f3e5 Merge branch 'master' into zuul_hystrix_threadpool
Conflicts:
	spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/support/AbstractRibbonCommand.java
2016-08-09 17:40:30 +02:00
Stéphane Lagraulet
67838807e8 Add zuulProperties as a method parameter 2016-08-09 09:36:30 +02:00
Jacques-Etienne Beaudet
dc2cdd55c0 Merge branch 'master' into fix-content-length 2016-08-08 22:45:20 -04:00
Daniel Lavoie
5b0f6013e8 Expose security context to any Hystrix command.
Fix issue gh-1054
2016-08-08 23:05:10 +02:00
Stéphane Lagraulet
35ca9691d2 Merge branch 'master' into zuul_hystrix_threadpool
Conflicts:
	spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonCommandIntegrationTests.java
2016-08-08 17:29:10 +02:00
Stéphane Lagraulet
072f7760a4 Use request content length RibbonRoutingFilter 2016-08-08 17:07:35 +02:00
Ryan Baxter
3c1599a1f4 Merge pull request #1213 from mhartle/master
FormBodyWrapperFilter may add multiples of every multipart part to a request
2016-08-08 10:58:59 -04:00
Stéphane Lagraulet
3c96fcc888 Get content length from Headers when RibbonCommandContext is built + add tests 2016-08-05 18:57:20 +02:00
Jacques-Etienne Beaudet
d21a7ef8e2 Fix an issue where the FormBodyWrapperFilter would encode the form parameters differently than on the original request.
The FormBodyWrapperFilter handles the application/x-www-form-urlencoded. In the case of requests received by curl or javascript, the FormHttpMessageConverter will reencode the parameters differently (for example, '(' will be encoded while it's not with the javascript encodeURIComponent method).

While this doesn't create any problem, the content length was not properly set in AbstractRibbonCommand. This causes the form params being stripped or the backend server would wait a long time for additional bytes depending on if the content length header was bigger/smaller than the actual data.
2016-08-03 14:27:46 -04:00
Stéphane Lagraulet
b1ec12af43 Add a check to current context as contentLength is already in the context 2016-08-03 15:32:08 +02:00
Stéphane Lagraulet
7929dfec0f Add a zuul property to customize Hystrix ExecutionIsolationStrategy 2016-08-02 13:39:04 +02:00
Michael Hartle
8bb223f6e3 Added a minimal test for FormBodyWrapperFilter handling multiple part names with multiple parts 2016-08-02 12:15:15 +02:00
Michael Hartle
0095ba8984 Fixed an issue where the pre FormBodyWrapperFilter adds multiples of every multipart part to a request 2016-07-26 13:37:46 +02:00
Daniel Lavoie
6f32aa95a7 Migrate tests to Spring Boot Test 1.4
Fixes gh-1205
2016-07-22 00:54:48 +02:00
Dave Syer
afb43c5883 Actually fix the feign client validation issue
We need to still assert that the FeignClient is valid (no name and
value specified together for instance). Added missing tests.
2016-07-21 10:36:18 +01:00
Dave Syer
85ef54a9a1 Fix Feign validation for Spring 4.2 and 4.3
There is a utility method in Spring that we can use to merge all
the aliases. That way 4.2 and 4.3 behave the same way.

Fixes gh-1192
2016-07-21 08:28:33 +01:00
Dave Syer
2f581a1181 Use JUnit assertions 2016-07-21 08:28:31 +01:00
Dave Syer
110f872779 Fix generic type signature (otherwise breaks with Spring 4.3) 2016-07-21 08:28:27 +01:00
Spencer Gibb
54931afa8b Remove assertion that fails in spring 4.3.x
Need to make this class 4.2.x compatible.

see gh-1192
2016-07-16 10:36:27 -06:00
Ryan Baxter
2bdd2dab78 Merge pull request #1173 from denyska/master
Disable cookie management for RibbonLoadBalancingHttpClient Fixes gh-301
2016-07-14 12:55:32 -04:00
Spencer Gibb
2908323702 Add debug logging that code is setting spring.aop.proxyTargetClass=true
See gh-1105
2016-07-13 18:08:12 -06:00
Denys Kurylenko
5d664cd00d Disable cookie management for RibbonLoadBalancingHttpClient Fixes gh-301 2016-07-08 18:48:47 -07:00
Spencer Gibb
277ded519d Merge pull request #1156 from brenuart/gh1155
remove Guava ImmutableMap in favour of Collections.unmodifiab…

fixes gh-1155
2016-07-01 16:41:37 -06:00
Spencer Gibb
7835c4047b temporarily comment out FormZuulProxyApplicationTests.postWithMultipartForm 2016-07-01 15:34:46 -06:00
Spencer Gibb
ab0af4554c Update to s-c-build 1.2.0 2016-07-01 15:14:19 -06:00
Bertrand Renuart
926414a014 GH1155: remove Guava ImmutableMap in favour of Collections.unmodifiableMap()
Make sanitizeUrlTemplate() protected for easy sub-classing
2016-07-01 14:14:58 +02:00
Spencer Gibb
3991c8c5f7 Allow custom feign clients when not using ribbon.
fixes gh-1143
2016-06-29 12:39:58 -06:00
Spencer Gibb
cb4d60ca8d fix typo 2016-06-29 11:39:04 -06:00
Thibaud Leprêtre
7ebe1977d8 Handle context-path on X-Forwarded-Prefix support
Since revision 7b270c4b46, Zuul add support of `X-Forwarded-Prefix` for route with `stripPrefix=true`.
However it supposes that Zuul context-path is equals to `/`. By using a custom context-path on Zuul we can expect that `zuul.add-proxy-headers=true` will compute a prefix regarding that context-path.

Indeed with following architecture:

- Zuul with context-path equals to `/foo`
- A random service (*bar-service*) without context-path

Zuul configurations:

```
zuul:
  add-proxy-headers: true
  routes:
    bar-service: /bar/**
```

We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1`  will produce endpoint url equals to `http://blabla.com/foo/bar` and not only `http://blabla.com/bar` (that will not be resolvable).

Furthermore context-path influence not only `stripPrefix=true` routes because with following configuration

```
zuul:
  add-proxy-headers: true
  routes:
    bar-service:
      path: /bar/**
      strip-prefix: false
```

We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1` will also prodcues endpoint url equals to `http://blabla.com/foo/bar`...

---

Moreover since *Spring 4.3* and new [`ForwardedHeaderFilter`](http://docs.spring.io/spring-framework/docs/4.3.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/web/filter/ForwardedHeaderFilter.html) to handle `X-Forwarded-*` headers, when filter catches `X-Forwarded-Prefix` header it will override request context-path by `X-Forwarded-Prefix` header value and then **removes headers from request**. Thus the fact to support context-path will allow to use that filter with Zuul!

---

Attention there is only one edge case, when `X-Forwarded-Prefix` header is present as same as custom `context-path`! In that case context-path will be ignored in favor to `X-Forwarded-Prefix` as same does `ForwardedHeaderFilter`
2016-06-29 10:37:52 +02:00
Patrick Cornelißen
723287b305 Adds ability to disable hostname validation.
Adds property zuul.sslHostnameValidationEnabled to be able to disable the hostname validation in the simpleHostRoutingFilter

fixes gh-1057
2016-06-28 10:32:49 -06:00
Spencer Gibb
46b2e45fd5 Adds a RibbonRequestCustomizer.
This allows developers to customize the request builders for zuul requests to inject headers or modify the request in general.  Each zuul request type (RestClient, Apache HttpClient and OkHttp) is supported.

fixes gh-1141
2016-06-27 13:15:54 -06:00
Spencer Gibb
390999e042 Add default zuul.ribbon.httpclient.enabled=true 2016-06-24 16:17:33 -06:00
Spencer Gibb
8a7e165214 Split ProxyRequestHelper to function without Actuator.
Previously ProxyRequestHelper contained a TraceRepository field. This caused zuul apps to fail with a class not found exception if they excluded actuator. This splits TraceRepository functionality into a new TraceProxyRequestHelper that extends ProxyRequestHelper. Auto configuration creates the appropriate ProxyRequestHelper based on the existence or not of actuator classes.

fixes gh-1135
2016-06-24 16:08:23 -06:00
Spencer Gibb
52b6578fcf polish 2016-06-24 09:32:18 -06:00
Spencer Gibb
2f205f20c5 Skip tests that only fail in travis for now. 2016-06-24 09:20:19 -06:00