84 Commits

Author SHA1 Message Date
Tom Pallister
98133d9473
Feature/expose http handlers (#224)
* temp commit

* trying to work out how to expose the http handlers in a decent way..

* pissing about at lunch

* changed to func so you can instanciate object or new it up each time

* docs for dele handlers

* upgraded to sdk 2.1.4

* some validation for consul services
2018-02-13 09:07:09 +00:00
Tom Pallister
3ac9b3bd87
hacked together load balancing reroutes in fileconfig (#211)
* hacked together load balancing reroutes in fileconfig

* some renaming and refactoring

* more renames

* hacked away the old config json

* test for issue 213

* renamed key

* dont share ports

* oops

* updated docs

* mvoed docs around

* port being used
2018-01-31 20:34:55 +00:00
Tom Pallister
d0eee70c46
Feature/transform headers (#204)
* New feature that lets a user do find and replace on an upstream header

* can transform downstream and upstream headers, not sure if interface is good

* can replace location header with placeholder

* added some syntax
2018-01-22 20:21:29 +00:00
Tom Pallister
6a20baeb97
Improving logging and request id (#189)
* hacking around to work out why logging and request id isnt working

* pass request id into logger so it can be structured, removed a bunch of debug logging we dont need because diagnostic trace gets it

* changed config dependency

* always have tracing available

* made it so we dont need to pass config into services.AddOcelot anymore with .net core 2.0

* add test

* lots of changes relating to logging and request ids, also updated documentation

* fixed failing test i missed
2018-01-06 16:39:05 +00:00
Tom Pallister
f082f7318a
Raft round 2 (#182)
* brought in rafty

* moved raft classes into Ocelot and deleted from int project

* started to set up rafty in Ocelot

* RAFTY INSIDE OCELOT...WOOT

* more work adding rafty...just need to get auth working now

* rudimentary authenticated raft requests working

* asyn await stuff

* hacked rafty into the fileconfigurationcontroller...everything seems to be working roughly but I have a lot of refactoring to do

* updated to latest rafty that doesnt need an id

* hacky but all tests passing

* changed admin area set up to use builder not configuration.json, changed admin area auth to use client credentials

* missing code coverage

* ignore raft sectionf for code coverage

* ignore raft sectionf for code coverage

* back to normal filters

* try exclude attr

* missed these

* moved client secret to builder for authentication and updated docs

* lock to try and fix error accessing identity server created temprsa file on build server

* updated postman scripts and changed Ocelot to not always use type handling as this looked crap when manually accessing the configuration endpoint

* added rafty docs

* changes I missed

* added serialisation code we need for rafty to process commands when they proxy to leader

* moved controllers into their feature slices
2018-01-01 18:40:39 +00:00
Charalampos Chomenidis
48b5a32676 Implement mapping of HttpResponseMessage to CachedResponse to fix #152 (#153)
* changed name to cache options to fix issue #146

* Add acceptance test that exposes JSON deserialization bug from issue #146

- Create InMemoryJsonHandle for CacheManager that mimics DictionaryHandle but uses ICacheSerializer to serialize/deserialize values instead of saving references
- Add CacheManager.Serialization.Json package
- Add StartupWithCustomCacheHandle class that extends Startup and overrides ConfigureServices to register InMemoryJsonHandle
- Add GivenOcelotIsRunningUsingConsulToStoreConfigAndJsonSerializedCache method to initiate Ocelot with StartupWithCustomCacheHandle
- Add test should_return_response_200_with_simple_url_when_using_jsonserialized_cache

* Create Acceptance test that exposes issue #152

- Add GivenOcelotIsRunningUsingJsonSerializedCache() that initializes Ocelot with InMemoryJsonHandle
- Add should_return_cached_response_when_using_jsonserialized_cache test

* Change Consul port to 9502 on should_return_response_200_with_simple_url_when_using_jsonserialized_cache() test

* Implement mapping of HttpResponseMessage to CachedResponse to enable distributed caching

- Add CachedResponse class that holds HttpResponse data
- Add mapping methods in OutputCacheMiddleware to create HttpResponseMessage from CachedResponse and vice versa
- Replace HttpResponseMessage with CachedResponse in services registrations
- Replace HttpResponseMessage with CachedResponse in OutputCacheController's IOcelotCache

* Fix unit tests for OutputCacheMiddleware and OutputCacheController by replacing HttpResponseMessage with CachedResponse

* Add .editorconfig with default identation settings (spaces with size 4)

* Re-format broken files with new identation settings

* Add Startup_WithConsul_And_CustomCacheHandle class

- Use Startup_WithConsul_And_CustomCacheHandle in GivenOcelotIsRunningUsingConsulToStoreConfigAndJsonSerializedCache step

* Do minor cleanups

- Rename StartupWithCustomCacheHandle to Startup_WithCustomCacheHandle for better readability
- Remove cachemanager settings Action in Startup since it is not used anymore

* Drop Task in CreateHttpResponseMessage - unnecessary overhead

* Make setters private in CachedResponse

- Rework CreateCachedResponse to use new CachedResponse constructor
2017-11-25 14:47:17 +00:00
Tom Pallister
6289992faa
added Ocelot bulder to try and make adding Ocelot configuration more … (#159)
* added Ocelot bulder to try and make adding Ocelot configuration more idiomatic

* renamed tests
2017-11-22 07:07:59 +00:00
Tom Gardham-Pallister
d377482013 removed comment 2017-11-14 22:41:21 +00:00
Tom Pallister
1d61e403ed changes to create load balancers and qos providers on first request to reroute and then check if they have changed on subsequent requests but not create again if they havent..quite a few breaking changes here. 2017-11-09 17:35:49 +00:00
Tom Gardham-Pallister
b64b06e069 getting acceptance tests working again 2017-11-09 09:02:41 +00:00
Tom Pallister
163150a1d7 seperate startups for tests...updated configuration.json for manual tests and tidied a few more things up 2017-11-01 16:21:35 +00:00
Tom Pallister
3f2af85969 test passing with authentication being provided by the user and mapped to the re route in config 2017-11-01 15:25:55 +00:00
Tom Gardham-Pallister
b28fc6694e tidy up and no longer hard code admin area...still one int test failing before we start looking at rebuilding auth stuff 2017-10-29 16:35:12 +00:00
Tom Pallister
6419919e74 unit tests pass... 2017-09-25 13:13:07 +01:00
Juan Carlos Santana Herrera
30a5227e1e Adds two acceptance tests that checks two scenarios:
- Get 401 when we do a request to api with a token issued to other api
- Get 403 when we do a request to scope not allowed
2017-05-17 15:06:21 +01:00
TomPallister
c3cd181b90 added a new implementation that stores the ocelot config in consul kv store, had to change some major things and add cache settings as default 2017-04-16 19:35:59 +01:00
TomPallister
d33e0c6f3b merged develop and stolen binarymash dont publish unstable build script code 2017-02-25 18:27:20 +00:00
Tom Gardham-Pallister
112a9c303e hacky auth working 2017-02-24 19:52:48 +00:00
Tom Gardham-Pallister
bd07af6926 more work towards getting identity server and admin area set up 2017-02-22 22:13:35 +00:00
TomPallister
d548a86327 Added integration test project as acceptance style doesnt work when running the new admin area because identityserver needs to use proper networking 2017-02-19 15:29:32 +00:00
TomPallister
fa47663259 changed file config stuff to just use app base directory 2017-02-19 12:58:22 +00:00
Tom Gardham-Pallister
4dac8cb4fb still hacking around 2017-02-17 07:27:49 +00:00
geffzhang
2fa6e66dd4 refactor code 2017-02-13 08:29:29 +08:00
geffzhang
e1f16c2be1 add ratelimit acceptance test 2017-02-12 15:49:21 +08:00
geffzhang
e1d5ef3aae implement Request Rate limit, this feature is options 2017-02-11 16:32:30 +08:00
Tom Gardham-Pallister
c3e60ac08a wip: added some sleep time into service discovery test as I think Im overloading the test server, sometimes it just returns 404 when Ocelot makes a request to it 2017-02-05 22:00:23 +00:00
TomPallister
d91242ac2c wip: modifications to service discovery acceptance test to see if it will work on mac 2017-02-05 21:35:50 +00:00
Tom Gardham-Pallister
9828c3b427 started adding consul acceptance test 2017-02-03 22:50:57 +00:00
tom.pallister
b2d33f0ec5 Updated packages and fixed build errors and tests..now need to update nuspec 2017-01-11 17:23:34 +00:00
TomPallister
47afc850ff Added some basic cache stuff 2016-11-04 15:05:59 +00:00
TomPallister
f4acb4f041 changed to json configuration to get rid of yaml imports 2016-11-02 21:50:53 +00:00
TomPallister
56bf4014bd Added request id functionality and general refactoring..also turned out i wasnt returning headers....sigh 2016-10-30 17:29:37 +00:00
TomPallister
4427ef459f more refactoring acceptance tests 2016-10-19 21:48:41 +01:00
TomPallister
9798cf01e5 refactoring acceptance tests..they need some tlc 2016-10-19 21:28:55 +01:00