462 Commits

Author SHA1 Message Date
Philip Wood
a1c6ab4ce4 Get rest of unit tests working 2017-04-18 15:16:27 +01:00
Philip Wood
7c1a277147 Fixed some unit tests 2017-04-18 14:05:15 +01:00
Philip Wood
8b93f44077 Fix request id middleware 2017-04-18 11:05:37 +01:00
Philip Wood
da922c0e04 Initial mapping of request 2017-04-18 10:13:10 +01:00
Philip Wood
eeb8f691c7 Very hacky proof of concept 2017-04-17 21:25:04 +01:00
Marc Denman
637d93dc4b Use DiagnosticListner for middleware logging
Instead of each middleware having to log that it has started and ended,
the DianosticListner package allows for capturing of these events in a
lightwieght manner.

This commit implements this and removes unncessary logging from most
middleware.
2017-04-17 11:23:34 +01:00
geffzhang
8533186cf0 Merge pull request #23 from TomPallister/develop
config_in_consul
2017-04-17 11:24:00 +08:00
Tom Pallister
8d31b40c21 Merge pull request #85 from TomPallister/feature/config-in-consul
added a new implementation that stores the ocelot config in consul kv…
2017-04-16 19:45:54 +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
geffzhang
34070021ce Merge pull request #21 from TomPallister/develop
refactor httpclientcache
2017-04-06 07:46:11 +08:00
Tom Pallister
ab9c8e30b2 Merge pull request #82 from geffzhang/HttpClientPerformance
Http client performance looks good!
2017-04-05 06:48:54 +01:00
geffzhang
81e2e8a5be refactor : ConcurrentDictionary and ConcurrentQueue replace MemoryCache for cache HttpClient 2017-04-04 16:06:27 +08:00
geffzhang
34325d7969 Merge pull request #20 from geffzhang/develop
merge newest code
2017-04-03 21:06:00 +08:00
geffzhang
9e5faa268f Merge pull request #19 from TomPallister/develop
updateLogger
2017-03-20 13:06:49 +08:00
Tom Pallister
f58da434ba Merge pull request #70 from MarcDenman/feature/updateLogging
Update logging
2017-03-19 15:57:28 +00:00
TomPallister
be0918879c Change to not log loads of rubbish when running integration tests 2017-03-19 12:46:42 +00:00
Tom Pallister
77a16b4175 Merge pull request #72 from geffzhang/develop
refactor:  replace AddSingleton with TryAddSingleton
2017-03-19 12:42:26 +00:00
Marc Denman
34be5a2955 Update middelware to use logging extension methods 2017-03-18 18:33:51 +00:00
Marc Denman
ad81b7a305 Update OcelotLogger to accept name of class
OcelotLogger now has a property called "Name" intended to store the name
of the type for which the logger has been built for. This is intended to
keep the code a little bit cleaner and also allows for a few extention
methods for common logging scenarios
2017-03-18 18:30:09 +00:00
geffzhang
aa66fdddd3 Merge branch 'develop' of https://github.com/geffzhang/Ocelot into develop 2017-03-18 19:58:04 +08:00
geffzhang
faf6d40d73 refactor: TryAddSingleton replace AddSingleton 2017-03-18 19:56:08 +08:00
Tom Pallister
4ac8e98029 Merge pull request #71 from geffzhang/develop
string.Equals under Centos not expect
2017-03-18 08:06:15 +00:00
geffzhang
18d4013e61 Fix: This string.Equals Method Windows is normal, but running under Centos, due to a case of the string problem, seems to be. NET core implementation issues on a Linux system is case sensitive.
Modifications are as follows
            var applicableReRoutes = configuration.Data.ReRoutes.Where(r => string.Equals(r.UpstreamHttpMethod.Method.ToLower(), upstreamHttpMethod.ToLower(), StringComparison.CurrentCultureIgnoreCase));
2017-03-16 20:13:27 +08:00
geffzhang
01fc26fb68 Merge pull request #18 from TomPallister/develop
Renamed ScopeName to ApiName, ScopeSecret to ApiSecret
2017-03-16 14:31:19 +08:00
Tom Pallister
d0296bc020 Merge pull request #69 from FryDerm/develop
Properties renamed for consistency with Identity Server
2017-03-15 18:37:03 +00:00
Marc Denman
82ecd667e0 Merged in develop 2017-03-14 21:50:03 +00:00
David Derman
a3b387aeb1 Renamed ScopeName to ApiName, ScopeSecret to ApiSecret, and
AdditionalScopes to Allowed Scoped in order to be more consistent with
Identity Server naming conventions.
2017-03-14 16:54:55 -04:00
Tom Pallister
3e8a296631 Merge pull request #67 from MarcDenman/feature/updateResponder
Change HttpStatusCodeMapper not to wrap responses
2017-03-14 18:54:49 +00:00
Marc Denman
9774580c4e Change logging for various middleware
As part #35 logging is being checked. This commit changes the first four
middlewares within the pipeline to be more standardised.

Also added an extension method to easily print out the errors from a list
of errors.
2017-03-14 17:43:24 +00:00
Marc Denman
0ad41aa3fa Add LogError(string) to logger
Added LogError(string) to interface as sometimes there isn't an exception
to be logged. Additionally, split Logger and LoggerFactory implementations
into seperate files just for tidiness.

Additonally added some very basic unit tests to the HttpDataRepository as
a bit of regression safety and to prove that Get never returns a null.

Slightly refactored the logic within AspDotNetLogger under
GetMessageWithOcelotRequestId so that the if statement is a little easier
to read. Attempted to remove the requestId == null, however this broke
numerous tests as the mocks don't set the behviour for dataReposioty
getting the requestId
2017-03-14 11:52:44 +00:00
Marc Denman
c01f778bf9 Add LogTrace to IOcelotLogger
Previously only LogDebug and LogError were implemented, however this
could/will lead to very noisy logging. Implementing trace should allow a
better seperation when debugging.
2017-03-14 10:06:53 +00:00
Marc Denman
a007887461 Add MiddelwareName into base OcelotMiddleware
Following TomPallister suggestion, it makes sense to call GetType only
once and in the constructor (middlewares are only instantiated once). I
have also taken the oppturniuty to add it as a property on the base
middleware allowing any other middleware to utlise it as well.
2017-03-14 09:45:07 +00:00
Marc Denman
0c33323352 Change HttpStatusCodeMapper not to wrap responses
As part of #66 we realised that the implementation of
IErrorToHttpStatusCodeMapper would always return a wrapped StatusCode
within an OK response, in turn meaning that ResponderMiddleware would
never fall into the else branch for returning a 500.

This commit removes the wrapping of the status code and removes the unused
logic for generating the 500 status code, giving the mapper full
responsbility for generating the correct status code.
2017-03-14 09:15:19 +00:00
Marc Denman
3fb83077fb Changed log messages to be a bit more descriptive 2017-03-13 17:23:09 +00:00
Marc Denman
0ec7fc44ad Change all ctor's to use IOcelotLoggerFactory
As part of #35 we are we are standardising on using IOcelotLoggerFactory
over the default ILogger for DI purposes. Following a sln search, the use
of ILogger was only found in one place (FileOcelotConfigurationCreator)
and it's corresponding tests.

This commit changes them and ensures the unit tests still pass.
2017-03-13 11:44:02 +00:00
TomPallister
c09cec67c6 didnt need to add this 2017-03-12 22:39:36 +00:00
TomPallister
d80b73a0d2 change to get appveyor to pick up all tests from http://stackoverflow.com/questions/42747868/vs-2017-not-discovering-tests-if-net-core 2017-03-12 22:35:32 +00:00
geffzhang
5f3d047475 Merge pull request #17 from TomPallister/develop
upgraded to vs2017
2017-03-12 19:48:04 +08:00
Tom Pallister
69f208b200 Merge pull request #64 from TomPallister/feature/upgrade-vs-2017
Feature/upgrade vs 2017
2017-03-12 10:42:04 +00:00
TomPallister
0e74ccea07 build process in wiki now 2017-03-12 10:30:47 +00:00
TomPallister
c4ca3d7b13 back to path as change didnt effect app veyor 2017-03-12 10:05:38 +00:00
TomPallister
882bc6bfd3 removed unused packages and made a change to hopefully make this work in appveyor 2017-03-12 10:02:54 +00:00
TomPallister
5796cea935 specific cake version 2017-03-11 09:17:09 +00:00
TomPallister
6aefa8d1b3 specific cake version 2017-03-11 09:16:56 +00:00
TomPallister
efec217cab changes suggest by mr mash 2017-03-11 09:13:50 +00:00
TomPallister
490de4c45d updated sln..for some reason this didnt happen with vs2017 upgrade 2017-03-09 17:18:02 +00:00
TomPallister
c49a1c9004 removed a bunch of orig files checked in by accident 2017-03-09 17:00:51 +00:00
TomPallister
6f65d9bab0 upgraded to vs2017 2017-03-09 17:00:15 +00:00
geffzhang
7d4ef438b9 Merge pull request #16 from TomPallister/develop
refactor: HttpClientCache
2017-03-09 12:07:33 +08:00
tom.pallister
ffd4e364f6 removed default headers 2017-03-08 13:10:44 +00:00