rename authorisation to authorization

This commit is contained in:
TomPallister
2020-12-01 16:54:52 +00:00
parent b2dd70f59c
commit b46fedac24
43 changed files with 295 additions and 295 deletions

View File

@ -16,7 +16,7 @@ namespace Ocelot.AcceptanceTests
using TestStack.BDDfy;
using Xunit;
public class AuthorisationTests : IDisposable
public class AuthorizationTests : IDisposable
{
private IWebHost _identityServerBuilder;
private readonly Steps _steps;
@ -24,7 +24,7 @@ namespace Ocelot.AcceptanceTests
private string _identityServerRootUrl;
private readonly ServiceHandler _serviceHandler;
public AuthorisationTests()
public AuthorizationTests()
{
_serviceHandler = new ServiceHandler();
_steps = new Steps();
@ -41,7 +41,7 @@ namespace Ocelot.AcceptanceTests
}
[Fact]
public void should_return_response_200_authorising_route()
public void should_return_response_200_authorizing_route()
{
int port = RandomPortFinder.GetRandomPort();
@ -101,7 +101,7 @@ namespace Ocelot.AcceptanceTests
}
[Fact]
public void should_return_response_403_authorising_route()
public void should_return_response_403_authorizing_route()
{
int port = RandomPortFinder.GetRandomPort();

View File

@ -10,7 +10,7 @@
using System.Net;
using System.Threading.Tasks;
using TestStack.BDDfy;
using Xunit;
using Xunit;
public class CustomMiddlewareTests : IDisposable
{
@ -32,13 +32,13 @@
{
var configuration = new OcelotPipelineConfiguration
{
AuthorisationMiddleware = async (ctx, next) =>
AuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -73,17 +73,17 @@
}
[Fact]
public void should_call_authorisation_middleware()
public void should_call_authorization_middleware()
{
var configuration = new OcelotPipelineConfiguration
{
AuthorisationMiddleware = async (ctx, next) =>
AuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -127,8 +127,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -172,8 +172,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -208,17 +208,17 @@
}
[Fact]
public void should_call_pre_authorisation_middleware()
public void should_call_pre_authorization_middleware()
{
var configuration = new OcelotPipelineConfiguration
{
PreAuthorisationMiddleware = async (ctx, next) =>
PreAuthorizationMiddleware = async (ctx, next) =>
{
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -262,8 +262,8 @@
_counter++;
await next.Invoke();
}
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -295,8 +295,8 @@
.Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
.And(x => x.ThenTheCounterIs(1))
.BDDfy();
}
}
[Fact(Skip = "This is just an example to show how you could hook into Ocelot pipeline with your own middleware. At the moment you must use Response.OnCompleted callback and cannot change the response :( I will see if this can be changed one day!")]
public void should_fix_issue_237()
{
@ -305,14 +305,14 @@
var httpContext = (HttpContext)state;
if (httpContext.Response.StatusCode > 400)
{
{
Debug.WriteLine("COUNT CALLED");
Console.WriteLine("COUNT CALLED");
}
return Task.CompletedTask;
};
};
var port = RandomPortFinder.GetRandomPort();
var fileConfiguration = new FileConfiguration
@ -376,8 +376,8 @@
public class FakeMiddleware
{
private readonly RequestDelegate _next;
private readonly Func<object, Task> _callback;
private readonly Func<object, Task> _callback;
public FakeMiddleware(RequestDelegate next, Func<object, Task> callback)
{
_next = next;
@ -386,10 +386,10 @@
public async Task Invoke(HttpContext context)
{
await _next(context);
await _next(context);
context.Response.OnCompleted(_callback, context);
}
}
}
}
}