307 Commits

Author SHA1 Message Date
Jason Morton
4b6c88de14 Fix issue #890 IDefinedAggregator can't handle error codes from downstream requests (#892)
* Release/13.2.0 (#834)

* Fix formatting in getting started page (#752)

* updated release docs (#745)

* Update README.md (#756)

Fixed typo "Ocleot"

* Fixed typo there => their (#763)

* Some Typo fixes (#765)

* Typo algorythm => algorithm (#764)

* Typo querystring => query string (#766)

* Typo usual => usually (#767)

* Typos (#768)

* kubernetes provider (#772)

* feat: Kubernetes ServiceDiscoveryProvider

* 编写k8s测试例子

* feat:fix kube config

* feat: remove port

* feat : complete the k8s test

* feat :  add kubeserviceDiscovery test

* feat : add kube provider unittest

* feat :add kubetnetes docs

how to use ocelot with kubetnetes docs

* keep the configuration as simple as possible, no qos, no cache

* fix: use http

* add PollingKubeServiceDiscovery

* feat : refactor logger

* feat : add  pollkube docs

* feat:Remove unnecessary code

* feat : code-block json

* fix issue #661 for Advanced aggregations (#704)

* Add Advanced Aggregation Feature

* fix overwrite error

* distinct data for better performance

* remove constructor parameter

* fix tests issue

* fix tests

* fix tests issue

* Add UnitTest and AcceptanceTest

* fix responseKeys typo

* Update SimpleJsonResponseAggregator.cs

* change port

* Fix code example for SSL Errors (#780)

DangerousAcceptAnyServerCertificateValidator has to be set to "true" to disable certification validation, not "false".

* Changed wording for ease of reading (#776)

Just some wording changes for clarification.

* Ignore response content if null (fix #785) (#786)

* fix bug #791 (#795)

* Update loadbalancer.rst (#796)

* UriBuilder - remove leading question mark #747 (#794)

* Update qualityofservice.rst (#801)

Tiny typo

* K8s package (#804)

* feat: Kubernetes ServiceDiscoveryProvider

* 编写k8s测试例子

* feat:fix kube config

* feat: remove port

* feat : complete the k8s test

* feat :  add kubeserviceDiscovery test

* feat : add kube provider unittest

* feat :add kubetnetes docs

how to use ocelot with kubetnetes docs

* keep the configuration as simple as possible, no qos, no cache

* fix: use http

* add PollingKubeServiceDiscovery

* feat : refactor logger

* feat : add  pollkube docs

* feat:Remove unnecessary code

* feat : code-block json

* feat: publish package Ocelot.Provider.Kubernetes

* Okta integration (#807)

Okta integration

* update cliamsParser (#798)

* update cliamsParser

* update using

* IOcelotBuilder opens the IMvcCoreBuilder property for easy customization (#790)

* IOcelotBuilder opens the IMvcCoreBuilder property for easy customization

* Adjustment code

* nuget package (#809)

* feat: Kubernetes ServiceDiscoveryProvider

* 编写k8s测试例子

* feat:fix kube config

* feat: remove port

* feat : complete the k8s test

* feat :  add kubeserviceDiscovery test

* feat : add kube provider unittest

* feat :add kubetnetes docs

how to use ocelot with kubetnetes docs

* keep the configuration as simple as possible, no qos, no cache

* fix: use http

* add PollingKubeServiceDiscovery

* feat : refactor logger

* feat : add  pollkube docs

* feat:Remove unnecessary code

* feat : code-block json

* feat: publish package Ocelot.Provider.Kubernetes

* feat : nuget package

* fix: Namesapce Spelling wrong

* fix:Namesapce Spelling Wrong

* Fix: errors when using rate limiting (#811)

* Fix: errors when using rate limiting
Add: QuotaExceededError class for requesting too much
Add: QuotaExceededError error code
Add: Add an error when limit is reached
Reflact: Extract GetResponseMessage method for getting default or configured response message for requ

* Fix: modify check_we_have_considered_all_errors_in_these_tests for adding a new OcelotErrorCode

* added missing COPY csproj files (#821)

* Add note on In-Process hosting (#816)

When using ASP.NET Core 2.2 with In-Process hosting in IIS it's important to use .UseIIS() instead of .UseIISIntegration().

* Fix bug: (#810)

If the registered Consul node is unexpectedly down and not restarted immediately, other services should continue to find the registered service.

* Fixed Dockerfile (missing Kubernetes)

* Revert "Fix bug: (#810)" (#823)

This reverts commit 19c80afb05290fac3a144f652cd663c8b513a559.

* remove duplicate `IHttpRequester` register (#819)

* remove duplicate `IHttpRequester` register

* reserve the first

* fix HttpRequesterMiddleware does not call next bug (#830)

call next so that we can do something with the response, such as add some custom header etc...

* Removed Packing to fix issues, will be sorted out after create a nuget package on Nuget.Org (#831)

* Allows access to unpass node (#825)

* Fix bug:
If the registered Consul node is unexpectedly down and not restarted immediately, other services should continue to find the registered service.

* fix bug:
If the registered Consul node is unexpectedly down and not restarted immediately, other services should continue to find the registered service.

* Updated FluentValidations Nuget Package (#833)

* Removed Warnings

* Make the full DownstreamContext available to user defined aggregators

This allows error codes to be handled
2019-05-20 15:44:16 +08:00
Abolfazl
faaabbe7a7 fix issue #661 for Advanced aggregations (#704)
* Add Advanced Aggregation Feature

* fix overwrite error

* distinct data for better performance

* remove constructor parameter

* fix tests issue

* fix tests

* fix tests issue

* Add UnitTest and AcceptanceTest

* fix responseKeys typo

* Update SimpleJsonResponseAggregator.cs

* change port
2019-02-04 09:21:50 -03:00
geffzhang
44dccf1fce kubernetes provider (#772)
* feat: Kubernetes ServiceDiscoveryProvider

* 编写k8s测试例子

* feat:fix kube config

* feat: remove port

* feat : complete the k8s test

* feat :  add kubeserviceDiscovery test

* feat : add kube provider unittest

* feat :add kubetnetes docs

how to use ocelot with kubetnetes docs

* keep the configuration as simple as possible, no qos, no cache

* fix: use http

* add PollingKubeServiceDiscovery

* feat : refactor logger

* feat : add  pollkube docs

* feat:Remove unnecessary code

* feat : code-block json
2019-01-31 07:19:32 -03:00
Felix Boers
6495891a07 Support placeholder in service fabric services names (#722) 2019-01-11 08:54:54 -05:00
Tom Pallister
11a2d13f18
Feat/monorepo (#734)
* copied everything from repos back to ocelot repo

* added src projects to sln

* removed all test projects that have no tests

* added all test projects to sln

* removed test not on master

* merged unit tests

* merged acceptance tests

* merged integration tests

* fixed namepaces

* build script creates packages for all projects

* updated docs to make sure no references to external repos that we will remove

* +semver: breaking
2019-01-07 19:52:53 +00:00
thiago.azevedo
8b930d10b2 Updated MemoryCache package from 2.1.1 to 2.1.2 to fix build issue 2018-11-29 12:11:36 +01:00
thiago.azevedo
adbe7a0227 Fixed Microsoft.AspNetCore.All version for security purposes 2018-11-29 12:05:27 +01:00
Tom Pallister
aa14b2f877
Feature/#623 (#632)
* #630 only set status code if response hasnt started, otherwise exception

* #623 made {RemoteIpAddress} available as placeholder so you can do x-forwarded-for

* #623 local address different on mac, windows and linux for integration test
2018-09-24 08:22:44 +01:00
Tom Pallister
669ece07b2
Feature/proxy reason phrase (#618)
* #599 started work to proxy reason phrase

* #599 test for aggregator
2018-09-12 19:48:56 +01:00
Tom Pallister
44f8e312a8
Feature/refactoring internal config creation stack (#600)
* tidy up some code so I can understand it

* broke al the things that make config out into their own classes etc..sigh

* fix the things i broked

* #597 test for issue, works on this branch :E

* #597 removed comments

* added tests for new load balancer creator..basic

* added tests for lb creator and aggregates creator

* added tests for config creator

* boiler plate for tests

* added dynamics tests

* wip

* finished refactoring for now
2018-09-11 21:41:58 +01:00
Tom Pallister
66b68fc685
Feature/#574 look at httpclient cache key (#589)
* #574 consolidate some code, man the config stuff is a mess!

* #574 just use the downstream re route and the key for caching http clients

* #574 added benchmark, i was suprised to learn using a complex type was faster than a string in benchmark .net dictionary tests, hey ho probably dont have enough data in the type...
2018-09-01 13:10:45 +01:00
Tom Pallister
55277cac45
Feature/should not start if specified using service discovery but no provider registered (#584)
* #580 added failing test

* #580 added failing test for dynamic reroutes

* #580 added failing test for validator

* #580 validation tests passing

* #580 acceptance tests passing

* #580 got rid of the list in sdp factory

* +semver: breaking #580 service discovery provider returned by delegate must be the same as name in config, this is a breaking change because you have to specify consul now

* #580 removed use servide discovery property from file config, we dont need it, just use the service name as indicator the user wants to use service discovery for the given reroute
2018-08-31 18:28:43 +01:00
Tom Pallister
29a7af9486
#568 worked out how to check if qos handler present and kill Ocelot i… (#578)
* #568 worked out how to check if qos handler present and kill Ocelot if options specified but no handler, need to refactor this into fluent validation style

* #568 acceptance tests to make sure Ocelot won't start if the user specifies QoSOptions but doesnt have a QoSHandler registered
2018-08-28 18:57:21 +01:00
Tom Pallister
8db5570840
Feature/fix #568 (#576)
* #568 Ocelot wont start if QoSOptions specified and no QoS DelegatingHandler registered e.g. no use of Ocelot.Provider.Polly. Also adds a NoQosDelegatingHandler and logs an error if ive missed something and the user can get to making the request

* #568 sadly something wierd with IServiceProvider and FluentValidation so I'm just defaulting to warning and noqosdelegatinghandler if someone doesnt register but provides options, also added basic in memory cache in case people dont use a specific package
2018-08-27 17:47:45 +01:00
Tom Pallister
369fc5b7a4
#555 added some tests for this issue but struggling to replicate (#570)
* #555 added some tests for this issue but struggling to replicate

* #555 removed cmd=instance from service fabric code as someone who knows service fabric says its not needed
I

* #555 renamed test
2018-08-25 12:33:49 +01:00
Tom Pallister
b0bdeb9402
#534 fixed failing tests for this issue (#575) 2018-08-25 12:32:56 +01:00
Tom Pallister
00a600064d
Feature/issue with path and query string #458 (#565)
* #548 added failing test

* #548 fixed failing tests for issue where using /{everything} didnt build path correctly
2018-08-20 22:28:58 +01:00
Tom Pallister
98ba0271be
Feature/move polly (#561)
* added delegate to select last handler

* #529 implemented a way we can inject the last delegating handler

* wip - moving code

* #529 removed loads of qos code and moved it into Ocelot.Provider.Polly
2018-08-19 10:14:15 +01:00
Tom Pallister
0786614e50
removed idserver4 (#547) 2018-08-14 08:19:00 +01:00
Tom Pallister
cbd0af6d75
#529 removed raft (#543) 2018-08-12 22:12:59 +05:30
Tom Pallister
34afefced6
Feature/remove pivotal (#541)
* #529 removed eureka client

* #529 removed some unused code
2018-08-12 19:44:08 +05:30
Tom Pallister
a91235b405
#529 removed consul deps and introduced delegate to find service discovery provider (#538) 2018-08-12 14:46:46 +05:30
Tom Pallister
d4b65198f3
#529 removed cache manager specific code (#535) 2018-08-11 18:21:07 +05:30
Marcelo Castagna
ad8025df1b Reload config on change (#527)
* Reload config on change.
Added test case.

* added testing for adding the json with reloadOnChange = false
2018-08-04 08:17:31 +01:00
Tom Pallister
37fb32b7f5
broke out butterfly into seperate project (#521)
* broke out butterfly into seperate project

* nearly did it...

* updated docs as I have broken the butterfly code off into a seperate dll
2018-08-03 08:11:47 +01:00
Tom Pallister
b0a20d13b9
Feature/more dynamic routes (#508)
* Made the file config poller use IHostedService, bit more generic, not just need to provide the correct implementations of the repo services and it will poll anything..this means we can open up redis for #458

* removed comments

* #458 allow users to set rate limits per service for dynamic re routes

* #458 added docs for rate limting on dynamic reroutes
2018-07-29 20:32:45 +01:00
Tom Pallister
0f2cf2d188
Made the file config poller use IHostedService, bit more generic, not… (#507)
* Made the file config poller use IHostedService, bit more generic, not just need to provide the correct implementations of the repo services and it will poll anything..this means we can open up redis for #458

* removed comments
2018-07-29 18:23:49 +01:00
Tom Pallister
1817564ea5
Feature/fix #463 (#506)
* #463 save both files

* #463 made it so we dont save to disk on startup unless using admin api
2018-07-27 23:13:22 +01:00
Tom Pallister
600732651b
Ive made the acceptance tests share the same builder in an effort to duplicate the linux port in use issue I have when running acceptance tests...seems to have been some use...now to test in CI (#486) 2018-07-21 11:24:05 +01:00
Tom Pallister
079ec0f365
#474 tests to show how spaces in headers work (#483) 2018-07-21 00:10:06 +01:00
Tom Pallister
23c5fcbf91
#464 (#477)
* #464 added code to request mapper to not automatically add content type and content length headers, .net will automatically try and add these headers in a few circumstances but this solves the 464 issue

* #464 use seek instead of read on body check for websockets tests

* #464 ran out of inodes on linux, looks like reloadonchange causes this
2018-07-20 22:32:40 +01:00
Tom Pallister
8f4ae03290
Added support for query string parameters in upstream path template (#467) 2018-07-12 19:26:23 +01:00
Tom Pallister
26ef3faa11
upgraded packages to netcoreapp2.1 Ocelot is still netstandard2.0 (#455)
* upgraded packages to netcoreapp2.1 Ocelot is still netstandard2.0

* try get latest sdk travis

* try get specific sdk travis
2018-07-11 06:28:08 +01:00
Tom Pallister
75f9a8f9be
#451 started implementing querystring support in templates (#459)
* #451 started implementing querystring support in templates

* #451 ocelot.json back to normal and specified in docs query string wont work in upstream template

* Revert "#451 ocelot.json back to normal and specified in docs query string wont work in upstream template"

This reverts commit 563193f7b2f78bad6109484fe77f3c87de831005.

* #451 ocelot.json back to normal and specified in docs query string wont work in upstream template
2018-07-10 18:00:17 +01:00
Tom Pallister
c8b72f31b5
#438 removed singleton delegating handlers as you cannot have these (#456) 2018-07-09 08:08:39 +01:00
Tom Pallister
d604badd49
test to show returning 304 works (#450) 2018-07-08 15:02:35 +01:00
Tom Pallister
3eb9b4da89
Feature/fix admin api caching wrong re routes (#421)
* #383 added failing test for this issue

* #383 identified issue was with cached load balancer for a given upstream path template based on the key we use, have modified this to include more data, I guess this might be an issue again for other things so I will have a think about it

* #383 fixed failing tests after key change

* Seems to be an issue with coveralls new package not being on nuget...try same version as their nuget package

* bash the old manual tests json back in
2018-06-21 22:45:24 +01:00
Tom Pallister
8e1a5ce827
Feature/dont validate cached content headers (#406)
* #372 use period timespan to decide when client can make requests again

* #400 dont validate cached body headers
2018-06-15 20:30:25 +01:00
Tom Pallister
9979f8a4b8
#372 use period timespan to decide when client can make requests again (#404) 2018-06-15 20:29:49 +01:00
Tom Pallister
0f2a9c1d0d
Feature/poll consul (#392)
* WIP - implement a consul service discovery poller, lots of shared code with existing, refactor next and a todo in the docs to finish

* #374 implement polling for consul as option

* #374 updated docs to remove todo

* #374 fixed failing unit test

* #374 fixed failing unit test

* #374 fixed failing acceptance test
2018-06-12 00:58:08 +03:00
Tom Pallister
7cd3ff2ff7
Feature/fix unstable int tests (#376)
* updated packages but build wont work

* #245 implementing more stable rafty

* #245 OK so these raft integration tests are passing everytime on my local mac now...lets see about the build servergit log

* #245 added donation button

* #245 removed file we dont need
2018-05-31 22:08:50 +01:00
Catcher Wong
32a258fd3f Upgrade Pivotal.Discovery.Client to Pivotal.Discovery.ClientCore (#369) 2018-05-22 07:13:45 +01:00
Tom Pallister
d01720c349
#363 added a test to prove rr lb works, this doesnt have a lock so it… (#365)
* #363 added a test to prove rr lb works, this doesnt have a lock so it isnt perfect, not sure what the tradeoff is between a lock and a bit of randomness, can change to have a lock anytie

* #363 had a look at other oss roudn robin lbs and they all use a lock so imlemented a lock
2018-05-21 18:46:39 +01:00
Tom Pallister
1e2e953b2c
Feature/automatic routes with sd (#351)
* #340 started looking at supporting automatic routing when using service discovery

* #340 getting old routing tests to pass

* #340 renamed stuff to provider rather than finder, as its not longer finding anything

* #340 working towards supporting dynamic routing

* #340 loads of refactoring to make configuration work with dynamic routing

* #340 refactor consul config code so the registry class owns it

* #340 default to consul to maintain backwards compat

* #340 added docs, finished this branches todos
2018-05-14 21:26:10 +01:00
Tom Pallister
1823c832a6 +semver: major merged netstandard2.0 upgrade and updated all packages. Also had to change identity server test due to scope deduping and put a few awaits in. 2018-05-11 07:59:03 +01:00
David Nissimoff
b1641e003c netstandard2.0 support 2018-05-10 16:12:36 -07:00
Tom Pallister
fb3af754ab implemented a send to self pattern for sticky session timeouts rather than a normal timer 2018-05-05 13:43:38 +01:00
Tom Pallister
6793278597
Feature/sticky sessions (#336)
* started messing around with sticky sessions idea

* more tests for sticky session thing

* more faffing cant make up my mind how to do this

* +semver: breaking added sticky session load balancer and changed way load balancer configuration is set by user

* #336 made tests BDDFy
2018-04-30 18:55:11 +01:00
Dilsy99
d2432cf7f7 Develop (#338)
* #330 Fix and issue with the httpclient being cached on the url but not taking the http verb into accont. This caused an issue because if the same url but different verbs had handlers, the incorrect handler would be called

* Amend so that UnableToCompleteRequestError returns 500 rather than 404. This error occur when a delegate handler throws an exception

* Fix test that broke because of the change from 404 to 500 when delegate changes
2018-04-30 10:23:02 +01:00
Tom Pallister
fad190fcae
Feature/extra request id test (#329)
* messing around with benchmark.net.seems Ocelot adds about 2ms to a request..lets make this less? :)

* #326 store json indented so it looks nice :P

* #327 show another test how request id works
2018-04-24 08:30:45 +01:00