Skip to content

Commit faea50f

Browse files
committed
Merge
2 parents 9ed7325 + 6ac34cb commit faea50f

7 files changed

Lines changed: 27 additions & 10 deletions

File tree

src/Services/Basket/Basket.API/Startup.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
162162
{
163163
app.UseStaticFiles();
164164
app.UseCors("CorsPolicy");
165+
165166
ConfigureAuth(app);
167+
166168
app.UseMvcWithDefaultRoute();
167169

168170
app.UseSwagger()
@@ -235,5 +237,10 @@ private void ConfigureEventBus(IApplicationBuilder app)
235237
eventBus.Subscribe<ProductPriceChangedIntegrationEvent, ProductPriceChangedIntegrationEventHandler>();
236238
eventBus.Subscribe<OrderStartedIntegrationEvent, OrderStartedIntegrationEventHandler>();
237239
}
240+
241+
protected virtual void ConfigureAuth(IApplicationBuilder app)
242+
{
243+
app.UseAuthentication();
244+
}
238245
}
239246
}

src/Services/Location/Locations.API/Startup.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,10 @@ private void RegisterEventBus(IServiceCollection services)
190190

191191
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
192192
}
193+
194+
protected virtual void ConfigureAuth(IApplicationBuilder app)
195+
{
196+
app.UseAuthentication();
197+
}
193198
}
194199
}

src/Services/Marketing/Marketing.API/Startup.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,10 @@ private Policy CreatePolicy(int retries, ILogger logger, string prefix)
257257
}
258258
);
259259
}
260+
261+
protected virtual void ConfigureAuth(IApplicationBuilder app)
262+
{
263+
app.UseAuthentication();
264+
}
260265
}
261266
}

test/Services/FunctionalTests/FunctionalTests.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
6-
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
6+
<!--<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>-->
77
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
88
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
99
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
@@ -45,9 +45,8 @@
4545
</ItemGroup>
4646

4747
<ItemGroup>
48-
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
49-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
50-
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
48+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
49+
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
5150
<PackageReference Include="xunit" Version="2.2.0" />
5251
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
5352
</ItemGroup>

test/Services/FunctionalTests/Services/Basket/BasketTestsStartup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace FunctionalTests.Services.Basket
88
{
99
public class BasketTestsStartup : Startup
1010
{
11-
public BasketTestsStartup(IConfiguration env) : base(env)
11+
public BasketTestsStartup(IConfiguration configuration) : base(configuration)
1212
{
1313
}
1414

test/Services/FunctionalTests/Services/Location/LocationsTestsStartup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
public class LocationsTestsStartup : Startup
1212
{
13-
public LocationsTestsStartup(IConfiguration env) : base(env)
13+
public LocationsTestsStartup(IConfiguration configuration) : base(configuration)
1414
{
1515
}
1616

@@ -29,6 +29,7 @@ protected override void ConfigureAuth(IApplicationBuilder app)
2929
class LocationAuthorizeMiddleware
3030
{
3131
private readonly RequestDelegate _next;
32+
3233
public LocationAuthorizeMiddleware(RequestDelegate rd)
3334
{
3435
_next = rd;
@@ -39,6 +40,7 @@ public async Task Invoke(HttpContext httpContext)
3940
var identity = new ClaimsIdentity("cookies");
4041
identity.AddClaim(new Claim("sub", "4611ce3f-380d-4db5-8d76-87a8689058ed"));
4142
httpContext.User.AddIdentity(identity);
43+
4244
await _next.Invoke(httpContext);
4345
}
4446
}

test/Services/FunctionalTests/Services/Marketing/MarketingTestsStartup.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
namespace FunctionalTests.Services.Marketing
22
{
3-
using Microsoft.eShopOnContainers.Services.Marketing.API;
4-
using Microsoft.AspNetCore.Hosting;
5-
using Microsoft.AspNetCore.Builder;
63
using FunctionalTests.Middleware;
4+
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.eShopOnContainers.Services.Marketing.API;
76
using Microsoft.Extensions.Configuration;
87

98
public class MarketingTestsStartup : Startup
109
{
11-
public MarketingTestsStartup(IConfiguration env) : base(env)
10+
public MarketingTestsStartup(IConfiguration configuration) : base(configuration)
1211
{
1312
}
1413

0 commit comments

Comments
 (0)