Added integration test project as acceptance style doesnt work when running the new admin area because identityserver needs to use proper networking

This commit is contained in:
TomPallister
2017-02-19 15:29:32 +00:00
parent d236ed3018
commit d548a86327
14 changed files with 384 additions and 90 deletions

View File

@ -4,7 +4,7 @@ using Ocelot.Services;
namespace Ocelot.Controllers
{
[Authorize(Roles = "Admin")]
[Authorize]
[Route("configuration")]
public class FileConfigurationController : Controller
{
@ -18,7 +18,6 @@ namespace Ocelot.Controllers
[HttpGet]
public IActionResult Get()
{
var user = this.HttpContext.User;
return new OkObjectResult(_getFileConfig.Invoke().Data);
}
}

View File

@ -112,7 +112,9 @@ namespace Ocelot.DependencyInjection
SubjectId = "admin",
}
});
services.AddMvcCore().AddJsonFormatters();
services.AddMvcCore()
.AddAuthorization()
.AddJsonFormatters();
services.AddLogging();
services.AddSingleton<IGetFileConfiguration, GetFileConfiguration>();
services.AddSingleton<IQosProviderHouse, QosProviderHouse>();

View File

@ -148,9 +148,11 @@ namespace Ocelot.Middleware
{
builder.Map(configuration.AdministrationPath, app =>
{
var identityServerUrl = $"http://localhost:5000/{configuration.AdministrationPath.Remove(0,1)}";
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://localhost:5000/admin",
Authority = identityServerUrl,
ApiName = "admin",
RequireHttpsMetadata = false,
AllowedScopes = new List<string>(),