Browse Source

Merge

pull/300/head
Ramón Tomás 7 years ago
parent
commit
faea50f715
7 changed files with 27 additions and 10 deletions
  1. +7
    -0
      src/Services/Basket/Basket.API/Startup.cs
  2. +5
    -0
      src/Services/Location/Locations.API/Startup.cs
  3. +5
    -0
      src/Services/Marketing/Marketing.API/Startup.cs
  4. +3
    -4
      test/Services/FunctionalTests/FunctionalTests.csproj
  5. +1
    -1
      test/Services/FunctionalTests/Services/Basket/BasketTestsStartup.cs
  6. +3
    -1
      test/Services/FunctionalTests/Services/Location/LocationsTestsStartup.cs
  7. +3
    -4
      test/Services/FunctionalTests/Services/Marketing/MarketingTestsStartup.cs

+ 7
- 0
src/Services/Basket/Basket.API/Startup.cs View File

@ -162,7 +162,9 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
{
app.UseStaticFiles();
app.UseCors("CorsPolicy");
ConfigureAuth(app);
app.UseMvcWithDefaultRoute();
app.UseSwagger()
@ -235,5 +237,10 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
eventBus.Subscribe<ProductPriceChangedIntegrationEvent, ProductPriceChangedIntegrationEventHandler>();
eventBus.Subscribe<OrderStartedIntegrationEvent, OrderStartedIntegrationEventHandler>();
}
protected virtual void ConfigureAuth(IApplicationBuilder app)
{
app.UseAuthentication();
}
}
}

+ 5
- 0
src/Services/Location/Locations.API/Startup.cs View File

@ -190,5 +190,10 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
}
protected virtual void ConfigureAuth(IApplicationBuilder app)
{
app.UseAuthentication();
}
}
}

+ 5
- 0
src/Services/Marketing/Marketing.API/Startup.cs View File

@ -257,5 +257,10 @@
}
);
}
protected virtual void ConfigureAuth(IApplicationBuilder app)
{
app.UseAuthentication();
}
}
}

+ 3
- 4
test/Services/FunctionalTests/FunctionalTests.csproj View File

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<!--<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>-->
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@ -45,9 +45,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>


+ 1
- 1
test/Services/FunctionalTests/Services/Basket/BasketTestsStartup.cs View File

@ -8,7 +8,7 @@ namespace FunctionalTests.Services.Basket
{
public class BasketTestsStartup : Startup
{
public BasketTestsStartup(IConfiguration env) : base(env)
public BasketTestsStartup(IConfiguration configuration) : base(configuration)
{
}


+ 3
- 1
test/Services/FunctionalTests/Services/Location/LocationsTestsStartup.cs View File

@ -10,7 +10,7 @@
public class LocationsTestsStartup : Startup
{
public LocationsTestsStartup(IConfiguration env) : base(env)
public LocationsTestsStartup(IConfiguration configuration) : base(configuration)
{
}
@ -29,6 +29,7 @@
class LocationAuthorizeMiddleware
{
private readonly RequestDelegate _next;
public LocationAuthorizeMiddleware(RequestDelegate rd)
{
_next = rd;
@ -39,6 +40,7 @@
var identity = new ClaimsIdentity("cookies");
identity.AddClaim(new Claim("sub", "4611ce3f-380d-4db5-8d76-87a8689058ed"));
httpContext.User.AddIdentity(identity);
await _next.Invoke(httpContext);
}
}


+ 3
- 4
test/Services/FunctionalTests/Services/Marketing/MarketingTestsStartup.cs View File

@ -1,14 +1,13 @@
namespace FunctionalTests.Services.Marketing
{
using Microsoft.eShopOnContainers.Services.Marketing.API;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using FunctionalTests.Middleware;
using Microsoft.AspNetCore.Builder;
using Microsoft.eShopOnContainers.Services.Marketing.API;
using Microsoft.Extensions.Configuration;
public class MarketingTestsStartup : Startup
{
public MarketingTestsStartup(IConfiguration env) : base(env)
public MarketingTestsStartup(IConfiguration configuration) : base(configuration)
{
}


Loading…
Cancel
Save