474 Commits

Author SHA1 Message Date
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
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
efec217cab changes suggest by mr mash 2017-03-11 09:13:50 +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
tom.pallister
ffd4e364f6 removed default headers 2017-03-08 13:10:44 +00:00
geffzhang
2e1708ef1e Merge branch 'develop' into feature/Optimization-HttpClient-instance 2017-03-07 08:37:16 +08:00
geffzhang
23ad6ed264 refactor: HttpClientCache and remove not used code current 2017-03-07 08:29:03 +08:00
TomPallister
c787202374 I realised we can get rid of the cookie container as cookies are just sent as a header called cookie... 2017-03-05 18:05:20 +00:00
TomPallister
558a0dfdab finished refactoring config cretor 2017-03-05 16:56:41 +00:00
geffzhang
10db534008 Refactor HttpClientHttpRequester Cache HttpClient 2017-03-04 18:18:00 +08:00
Tom Gardham-Pallister
8bbd781820 updated file options 2017-03-02 09:18:53 +00:00
Tom Gardham-Pallister
0a2d7a6922 qos options creator in own class 2017-03-01 23:28:32 +00:00
Tom Gardham-Pallister
6661cb5f32 use config tests 2017-03-01 23:15:30 +00:00
Tom Gardham-Pallister
034732ce90 added lame test for service config creator 2017-03-01 23:12:00 +00:00
Tom Gardham-Pallister
fff743ccf8 pulling out service config cretor 2017-03-01 12:42:37 +00:00
Tom Gardham-Pallister
d4119ab33d extracted thing that creates request id key 2017-03-01 08:11:39 +00:00
Tom Gardham-Pallister
c85ea41951 refactoring ocelot config creation process 2017-03-01 07:54:07 +00:00
TomPallister
d33e0c6f3b merged develop and stolen binarymash dont publish unstable build script code 2017-02-25 18:27:20 +00:00
TomPallister
a983af35a1 change to catch not modified response and get config working correctly 2017-02-25 17:47:24 +00:00
TomPallister
be24f9a9ca Added base url finder for when nothing set in Program.cs 2017-02-25 17:02:36 +00:00
Tom Gardham-Pallister
07c334cc98 moved stuff around so a bit less crap 2017-02-25 16:09:00 +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
Tom Gardham-Pallister
f8804f5d9d started adding some kind of auth config 2017-02-22 20:04:51 +00:00
Tom Gardham-Pallister
aa0d8fe59a all tests passing, now to do authentication config provider 2017-02-22 07:48:49 +00:00
Tom Gardham-Pallister
bf90b12f2c acceptance tests passing after fixing registrations 2017-02-21 07:39:09 +00:00
Tom Gardham-Pallister
2dfdf0bb86 after much hacking unit tests passing 2017-02-21 07:34:47 +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
d236ed3018 trying to get identity server authing 2017-02-19 13:59:17 +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
ed3a629827 updated nuget info 2017-02-17 20:17:23 +00:00
Tom Gardham-Pallister
4dac8cb4fb still hacking around 2017-02-17 07:27:49 +00:00
Tom Gardham-Pallister
bc5010837e removed using 2017-02-15 13:24:06 +00:00
Tom Gardham-Pallister
219b45e7d0 updated acceptance test assertion 2017-02-15 07:51:19 +00:00
Tom Gardham-Pallister
1e88062ce2 moved create admin area call 2017-02-15 07:43:50 +00:00
geffzhang
f302ee77bf remove bak file 2017-02-15 08:54:20 +08:00
geffzhang
ab6ae8a062 merge newest code for develop 2017-02-15 08:50:22 +08:00
geffzhang
0aad1f8fa0 Merge remote-tracking branch 'refs/remotes/origin/develop' into RateLimit
# Conflicts:
#	src/Ocelot/Configuration/Builder/ReRouteBuilder.cs
#	src/Ocelot/Configuration/Creator/FileOcelotConfigurationCreator.cs
#	src/Ocelot/Configuration/QoSOptions.cs
#	src/Ocelot/Configuration/ReRoute.cs
#	test/Ocelot.AcceptanceTests/configuration.json
2017-02-15 08:49:40 +08:00
Tom Gardham-Pallister
159969483b hacking away 2017-02-13 18:51:47 +00:00
Tom Gardham-Pallister
95fc687e93 started messing around with admin area 2017-02-13 12:13:53 +00:00
Tom Gardham-Pallister
0b830d9891 mapped admin path works for manual test 2017-02-13 07:42:31 +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