307 Commits

Author SHA1 Message Date
Tom Pallister
931a115ffa
changes to add new feature to url routing (#186) 2018-01-02 18:49:22 +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
3b27bb376e
Feature/fix #156 (#160)
* change config creator to not throw exception in there is an error......lord i hate this config creator code I need to sort it out.

* Remove method that we are not using anymore..

* throw exception and add errors to message

* train hacking and some refactoring

* bs test for code coverage

* actually return the errors in the exception
2017-11-24 21:10:03 +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 Pallister
9ba57f8ba6
Make Ocelot not add forward slash to downstream url (#158)
* removed code where we add a trailing slash as this means if we request /1.txt/ instead of /1.txt then some servers will not return the resource at /1.txt. After reading up it seems if you dont have a trailing slash then its a file, if you do then its a resource

* test for 145

* removed unused code

* fix broken build..my bad
2017-11-19 21:01:54 +00:00
Tom Pallister
68242102d8
Feature/hacking consul file config (#157)
* moving things around to see if I can get consul to store fileconfiguration rather than ocelotconfiguration

* more refactoring to see if we can get a test for the feature

* acceptance test passing for updating in consul..need to sort object comparison out

* fixed the failing tests
2017-11-17 17:58:39 +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 Pallister
b08837ea9d removed crap 2017-11-09 09:56:20 +00:00
Tom Gardham-Pallister
93b4f2269a changed assertions for test to be more realistic 2017-11-09 09:07:54 +00:00
Tom Gardham-Pallister
b64b06e069 getting acceptance tests working again 2017-11-09 09:02:41 +00:00
Tom Gardham-Pallister
e43732290a massive refactor to handle creating load balancer first time a re route is called 2017-11-08 21:26:49 +00:00
Tom Gardham-Pallister
2ead993c0f fix two failing tests 2017-11-02 12:03:32 +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
f4e8dcbdab everything working..now for the docs 2017-11-01 15:51:49 +00:00
Tom Pallister
b512875062 few things to remove i missed 2017-11-01 15:29:22 +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
e0c16bea32 unit and int tests are passing with auth changes...but acceptance tests are in a state and there are loads of todos... 2017-11-01 08:05:22 +00:00
Tom Pallister
120532bb0d fixed more failing acceptance tests...think the only thing to do now is work out the authentication stuff and that should fix all the other tests 2017-10-30 13:14:12 +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 Gardham-Pallister
25c1a2abdd merged publish fix 2017-10-13 08:28:38 +01:00
Tom Gardham-Pallister
d0d74f0886 match whole input with regex 2017-10-12 19:03:20 +01:00
Tom Pallister
4d3a7ae5e1 another script change to find error 2017-10-10 17:52:38 +01:00
Tom Pallister
6419919e74 unit tests pass... 2017-09-25 13:13:07 +01:00
Tom Pallister
1c98dcbca3 updated packages and project versions...12 errors! 2017-09-25 11:53:56 +01:00
TomPallister
bd8b1ac042 FML 2017-09-21 23:10:09 +01:00
TomPallister
cffb8b63d9 blasduihasd 2017-09-21 23:09:36 +01:00
TomPallister
c06b492b46 upgraded to netcoreapp2.0 2017-09-21 23:00:22 +01:00
Tom Gardham-Pallister
7ef26f5f4b fixes issue #117 2017-08-29 20:47:52 +01:00
TomPallister
58dc7c93bc moved json converters under authentication feature 2017-07-04 19:14:37 +01:00
Tom Pallister
50ee9e20d8 Merge pull request #110 from sharpn/develop
Adding JWT authentication for use with auth0
2017-06-30 09:32:55 +01:00
Tom Gardham-Pallister
e4e7fcc943 unit tests for cache clearing passing 2017-06-27 18:54:15 +01:00
Nick Sharp
ec0f3b32e4 Adding deserializer config for consul 2017-06-27 13:49:30 +01:00
Nick Sharp
a7eeadb4c6 fixing tests 2017-06-26 21:32:44 +01:00
nicksharp
20f6ebac2f Fixing tests 2017-06-26 21:08:47 +01:00
nicksharp
461ef6aa52 Merging upstream 2017-06-26 19:39:28 +01:00
Nick Sharp
6209681b2c Adding code ##BROKEN TESTS## 2017-06-26 11:50:58 +01:00
Tom Gardham-Pallister
6cdf4e67df can now use tokens from ocelot a on ocelot b when using admin area 2017-06-23 15:17:40 +01:00
TomPallister
2d94884c6f trying to get cluster working 2017-06-23 11:25:23 +01:00
TomPallister
6c1b95f95b fixed some broken tests due to recent merges! 2017-06-10 15:52:31 +01:00
TomPallister
190c967655 Merge branch 'master' into develop 2017-06-10 15:20:37 +01:00
Juan Carlos Santana Herrera
efa68e9949 Allowed scopes checking added to AuthorisationMiddleware.
Acceptance tests added.
2017-05-31 18:27:28 +01:00
Juan Carlos Santana Herrera
488aa97342 Removed unnecessary IdentityServer4 nuget package. 2017-05-19 11:41:38 +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
Philip Wood
e9ab5d64ea Not sure how I missed the acceptance test xunit update on the last commit. And, improve logging around test coverage. 2017-05-09 20:33:21 +01:00
Philip Wood
0507806aae Rough first go at test coverage. Might need tidying up. 2017-05-06 17:53:44 +01:00
Juan Carlos Santana Herrera
24f7b9a171 UpstreamHttpMethod property (of class FileReRoute) changes from string to List<string>. 2017-05-05 11:47:28 +01:00
Juan Carlos Santana Herrera
e91da1ac23 Add the possibility of set mutiple verbs in the UpstreamHttpMethod property.
Add UnitTests and AcceptanceTests to try this feature.
2017-05-04 10:56:16 +01:00
Juan Carlos Santana Herrera
6510f173b9 Adds an acceptance test to check the use of placeholder for a final url path. 2017-04-22 22:06:00 +01:00