diff --git a/.env b/.env index a3fd59ffc..c8fcdfcf2 100644 --- a/.env +++ b/.env @@ -23,4 +23,5 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92 #ESHOP_AZURE_STORAGE_MARKETING_KEY= #ESHOP_SERVICE_BUS_USERNAME= #ESHOP_SERVICE_BUS_PASSWORD= -#INSTRUMENTATION_KEY= \ No newline at end of file +#INSTRUMENTATION_KEY= +#USE_LOADTEST= \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index f3bf0ede9..449bc4a74 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -21,6 +21,8 @@ services: - AzureServiceBusEnabled=False - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} + ports: - "5103:80" @@ -77,6 +79,7 @@ services: - GracePeriodTime=1 - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} ports: - "5102:80" @@ -100,6 +103,7 @@ services: - AzureStorageEnabled=False - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} ports: - "5110:80" @@ -144,6 +148,7 @@ services: - UseCustomizationData=True - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} ports: - "5100:80" @@ -192,6 +197,7 @@ services: - AzureServiceBusEnabled=False - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} + - UseLoadTest=${USE_LOADTEST:-False} ports: - "5109:80" diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln index c83c564cf..cc63417a3 100644 --- a/eShopOnContainers-ServicesAndWebApps.sln +++ b/eShopOnContainers-ServicesAndWebApps.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 +VisualStudioVersion = 15.0.27004.2002 MinimumVisualStudioVersion = 10.0.40219.1 Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{FEA0C318-FFED-4D39-8781-265718CA43DD}" EndProject @@ -79,8 +79,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Health EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.HealthChecks.SqlServer", "src\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.SqlServer\Microsoft.Extensions.HealthChecks.SqlServer.csproj", "{4BD76717-3102-4969-8C2C-BAAA3F0263B6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBus.Tests", "src\BuildingBlocks\EventBus\EventBus.Tests\EventBus.Tests.csproj", "{4A980AC4-7205-46BF-8CCB-09E44D700FD4}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Location", "Location", "{41139F64-4046-4F16-96B7-D941D96FA9C6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Locations.API", "src\Services\Location\Locations.API\Locations.API.csproj", "{E7581357-FC34-474C-B8F5-307EE3CE05EF}" @@ -1029,54 +1027,6 @@ Global {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x64.Build.0 = Release|Any CPU {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x86.ActiveCfg = Release|Any CPU {4BD76717-3102-4969-8C2C-BAAA3F0263B6}.Release|x86.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|ARM.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|iPhone.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|x64.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|x64.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|x86.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.AppStore|x86.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|ARM.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|ARM.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|iPhone.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|x64.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|x86.ActiveCfg = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Debug|x86.Build.0 = Debug|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|Any CPU.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|ARM.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|ARM.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|iPhone.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|iPhone.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|x64.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|x64.Build.0 = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|x86.ActiveCfg = Release|Any CPU - {4A980AC4-7205-46BF-8CCB-09E44D700FD4}.Release|x86.Build.0 = Release|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {E7581357-FC34-474C-B8F5-307EE3CE05EF}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -1450,7 +1400,6 @@ Global {1A01AF82-6FCB-464C-B39C-F127AEBD315D} = {022E145D-1593-47EE-9608-8E323D3C63F5} {22A0F9C1-2D4A-4107-95B7-8459E6688BC5} = {A81ECBC2-6B00-4DCD-8388-469174033379} {4BD76717-3102-4969-8C2C-BAAA3F0263B6} = {A81ECBC2-6B00-4DCD-8388-469174033379} - {4A980AC4-7205-46BF-8CCB-09E44D700FD4} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} {41139F64-4046-4F16-96B7-D941D96FA9C6} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} {E7581357-FC34-474C-B8F5-307EE3CE05EF} = {41139F64-4046-4F16-96B7-D941D96FA9C6} {88B22DBB-AA8F-4290-A454-2C109352C345} = {DB0EFB20-B024-4E5E-A75C-52143C131D25} diff --git a/src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj b/src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj index e1c32cff2..03f4a0657 100644 --- a/src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj +++ b/src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj @@ -6,6 +6,7 @@ + diff --git a/src/BuildingBlocks/Resilience/Resilience.Http/ResilientHttpClient.cs b/src/BuildingBlocks/Resilience/Resilience.Http/ResilientHttpClient.cs index d32660005..18051a501 100644 --- a/src/BuildingBlocks/Resilience/Resilience.Http/ResilientHttpClient.cs +++ b/src/BuildingBlocks/Resilience/Resilience.Http/ResilientHttpClient.cs @@ -10,6 +10,7 @@ using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { @@ -24,13 +25,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http private readonly ILogger _logger; private readonly Func> _policyCreator; private ConcurrentDictionary _policyWrappers; + private readonly IHttpContextAccessor _httpContextAccessor; - public ResilientHttpClient(Func> policyCreator, ILogger logger) + public ResilientHttpClient(Func> policyCreator, ILogger logger, IHttpContextAccessor httpContextAccessor) { _client = new HttpClient(); _logger = logger; _policyCreator = policyCreator; _policyWrappers = new ConcurrentDictionary(); + _httpContextAccessor = httpContextAccessor; } @@ -52,10 +55,12 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { var requestMessage = new HttpRequestMessage(HttpMethod.Delete, uri); + SetAuthorizationHeader(requestMessage); + if (authorizationToken != null) { requestMessage.Headers.Authorization = new AuthenticationHeaderValue(authorizationMethod, authorizationToken); - } + } if (requestId != null) { @@ -65,6 +70,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http return await _client.SendAsync(requestMessage); }); } + public Task GetStringAsync(string uri, string authorizationToken = null, string authorizationMethod = "Bearer") { @@ -74,6 +80,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { var requestMessage = new HttpRequestMessage(HttpMethod.Get, uri); + SetAuthorizationHeader(requestMessage); + if (authorizationToken != null) { requestMessage.Headers.Authorization = new AuthenticationHeaderValue(authorizationMethod, authorizationToken); @@ -108,6 +116,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { var requestMessage = new HttpRequestMessage(method, uri); + SetAuthorizationHeader(requestMessage); + requestMessage.Content = new StringContent(JsonConvert.SerializeObject(item), System.Text.Encoding.UTF8, "application/json"); if (authorizationToken != null) @@ -162,6 +172,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http var origin = $"{url.Scheme}://{url.DnsSafeHost}:{url.Port}"; return origin; - } + } + + private void SetAuthorizationHeader(HttpRequestMessage requestMessage) + { + var authorizationHeader = _httpContextAccessor.HttpContext.Request.Headers["Authorization"]; + if (!string.IsNullOrEmpty(authorizationHeader)) + { + requestMessage.Headers.Add("Authorization", new List() { authorizationHeader }); + } + } } } diff --git a/src/BuildingBlocks/Resilience/Resilience.Http/StandardHttpClient.cs b/src/BuildingBlocks/Resilience/Resilience.Http/StandardHttpClient.cs index 6cd378c88..a5f6a63c4 100644 --- a/src/BuildingBlocks/Resilience/Resilience.Http/StandardHttpClient.cs +++ b/src/BuildingBlocks/Resilience/Resilience.Http/StandardHttpClient.cs @@ -1,6 +1,8 @@ -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; using Newtonsoft.Json; using System; +using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -12,17 +14,21 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { private HttpClient _client; private ILogger _logger; + private readonly IHttpContextAccessor _httpContextAccessor; - public StandardHttpClient(ILogger logger) + public StandardHttpClient(ILogger logger, IHttpContextAccessor httpContextAccessor) { _client = new HttpClient(); _logger = logger; + _httpContextAccessor = httpContextAccessor; } public async Task GetStringAsync(string uri, string authorizationToken = null, string authorizationMethod = "Bearer") { var requestMessage = new HttpRequestMessage(HttpMethod.Get, uri); + SetAuthorizationHeader(requestMessage); + if (authorizationToken != null) { requestMessage.Headers.Authorization = new AuthenticationHeaderValue(authorizationMethod, authorizationToken); @@ -45,6 +51,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http var requestMessage = new HttpRequestMessage(method, uri); + SetAuthorizationHeader(requestMessage); + requestMessage.Content = new StringContent(JsonConvert.SerializeObject(item), System.Text.Encoding.UTF8, "application/json"); if (authorizationToken != null) @@ -84,6 +92,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http { var requestMessage = new HttpRequestMessage(HttpMethod.Delete, uri); + SetAuthorizationHeader(requestMessage); + if (authorizationToken != null) { requestMessage.Headers.Authorization = new AuthenticationHeaderValue(authorizationMethod, authorizationToken); @@ -96,6 +106,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http return await _client.SendAsync(requestMessage); } + + private void SetAuthorizationHeader(HttpRequestMessage requestMessage) + { + var authorizationHeader = _httpContextAccessor.HttpContext.Request.Headers["Authorization"]; + if (!string.IsNullOrEmpty(authorizationHeader)) + { + requestMessage.Headers.Add("Authorization", new List() { authorizationHeader }); + } + } } } diff --git a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs new file mode 100644 index 000000000..dfe690f6f --- /dev/null +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -0,0 +1,79 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Basket.API.Infrastructure.Middlewares +{ + class ByPassAuthMiddleware + { + private readonly RequestDelegate _next; + private string _currentUserId; + public ByPassAuthMiddleware(RequestDelegate next) + { + _next = next; + _currentUserId = null; + } + + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path; + if (path == "/noauth") + { + var userid = context.Request.Query["userid"]; + if (!string.IsNullOrEmpty(userid)) + { + _currentUserId = userid; + } + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to {_currentUserId}"); + } + + else if (path == "/noauth/reset") + { + _currentUserId = null; + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to none. Token required for protected endpoints."); + } + else + { + var currentUserId = _currentUserId; + + var authHeader = context.Request.Headers["Authorization"]; + if (authHeader != StringValues.Empty) + { + var header = authHeader.FirstOrDefault(); + if (!string.IsNullOrEmpty(header) && header.StartsWith("Email ") && header.Length > "Email ".Length) + { + currentUserId = header.Substring("Email ".Length); + } + } + + + if (!string.IsNullOrEmpty(currentUserId)) + { + var user = new ClaimsIdentity(new[] { + new Claim("emails", currentUserId), + new Claim("name", "Test user"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("ttp://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), + new Claim("sub", "1234"), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} + , "ByPassAuth"); + + context.User = new ClaimsPrincipal(user); + } + + await _next.Invoke(context); + } + } + } +} diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index f54db4697..d1550eec8 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -1,6 +1,7 @@ using Autofac; using Autofac.Extensions.DependencyInjection; using Basket.API.Infrastructure.Filters; +using Basket.API.Infrastructure.Middlewares; using Basket.API.IntegrationEvents.EventHandling; using Basket.API.IntegrationEvents.Events; using Microsoft.ApplicationInsights.Extensibility; @@ -210,16 +211,13 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => @@ -249,6 +247,11 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API protected virtual void ConfigureAuth(IApplicationBuilder app) { + if (Configuration.GetValue("UseLoadTest")) + { + app.UseMiddleware(); + } + app.UseAuthentication(); } diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index bfee8a8d2..6037b0eb0 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -208,16 +208,13 @@ { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 5e958b1b0..9b3a3a4c3 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -164,16 +164,13 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/src/Services/Location/Locations.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Services/Location/Locations.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs new file mode 100644 index 000000000..6814383b6 --- /dev/null +++ b/src/Services/Location/Locations.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -0,0 +1,78 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure.Middlewares +{ + class ByPassAuthMiddleware + { + private readonly RequestDelegate _next; + private string _currentUserId; + public ByPassAuthMiddleware(RequestDelegate next) + { + _next = next; + _currentUserId = null; + } + + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path; + if (path == "/noauth") + { + var userid = context.Request.Query["userid"]; + if (!string.IsNullOrEmpty(userid)) + { + _currentUserId = userid; + } + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to {_currentUserId}"); + } + + else if (path == "/noauth/reset") + { + _currentUserId = null; + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to none. Token required for protected endpoints."); + } + else + { + var currentUserId = _currentUserId; + + var authHeader = context.Request.Headers["Authorization"]; + if (authHeader != StringValues.Empty) + { + var header = authHeader.FirstOrDefault(); + if (!string.IsNullOrEmpty(header) && header.StartsWith("Email ") && header.Length > "Email ".Length) + { + currentUserId = header.Substring("Email ".Length); + } + } + + + if (!string.IsNullOrEmpty(currentUserId)) + { + var user = new ClaimsIdentity(new[] { + new Claim("emails", currentUserId), + new Claim("name", "Test user"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("ttp://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} + , "ByPassAuth"); + + context.User = new ClaimsPrincipal(user); + } + + await _next.Invoke(context); + } + } + } +} diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 645cabb73..0cf49a3b5 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; using Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure; using Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure.Filters; +using Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure.Middlewares; using Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Locations.API.Infrastructure.Services; using Microsoft.Extensions.Configuration; @@ -182,16 +183,13 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => @@ -219,6 +217,11 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API protected virtual void ConfigureAuth(IApplicationBuilder app) { + if (Configuration.GetValue("UseLoadTest")) + { + app.UseMiddleware(); + } + app.UseAuthentication(); } diff --git a/src/Services/Marketing/Marketing.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Services/Marketing/Marketing.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs new file mode 100644 index 000000000..8830e3b90 --- /dev/null +++ b/src/Services/Marketing/Marketing.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -0,0 +1,78 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure.Middlewares +{ + class ByPassAuthMiddleware + { + private readonly RequestDelegate _next; + private string _currentUserId; + public ByPassAuthMiddleware(RequestDelegate next) + { + _next = next; + _currentUserId = null; + } + + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path; + if (path == "/noauth") + { + var userid = context.Request.Query["userid"]; + if (!string.IsNullOrEmpty(userid)) + { + _currentUserId = userid; + } + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to {_currentUserId}"); + } + + else if (path == "/noauth/reset") + { + _currentUserId = null; + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to none. Token required for protected endpoints."); + } + else + { + var currentUserId = _currentUserId; + + var authHeader = context.Request.Headers["Authorization"]; + if (authHeader != StringValues.Empty) + { + var header = authHeader.FirstOrDefault(); + if (!string.IsNullOrEmpty(header) && header.StartsWith("Email ") && header.Length > "Email ".Length) + { + currentUserId = header.Substring("Email ".Length); + } + } + + + if (!string.IsNullOrEmpty(currentUserId)) + { + var user = new ClaimsIdentity(new[] { + new Claim("emails", currentUserId), + new Claim("name", "Test user"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("ttp://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} + , "ByPassAuth"); + + context.User = new ClaimsPrincipal(user); + } + + await _next.Invoke(context); + } + } + } +} diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index da805f0e8..461ecc080 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -25,6 +25,7 @@ using Microsoft.ApplicationInsights.ServiceFabric; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore.Diagnostics; + using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure.Middlewares; using RabbitMQ.Client; using Swashbuckle.AspNetCore.Swagger; using System; @@ -213,16 +214,13 @@ { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => @@ -295,6 +293,11 @@ protected virtual void ConfigureAuth(IApplicationBuilder app) { + if (Configuration.GetValue("UseLoadTest")) + { + app.UseMiddleware(); + } + app.UseAuthentication(); } } diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs new file mode 100644 index 000000000..426381448 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -0,0 +1,78 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Ordering.API.Infrastructure.Middlewares +{ + class ByPassAuthMiddleware + { + private readonly RequestDelegate _next; + private string _currentUserId; + public ByPassAuthMiddleware(RequestDelegate next) + { + _next = next; + _currentUserId = null; + } + + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path; + if (path == "/noauth") + { + var userid = context.Request.Query["userid"]; + if (!string.IsNullOrEmpty(userid)) + { + _currentUserId = userid; + } + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to {_currentUserId}"); + } + + else if (path == "/noauth/reset") + { + _currentUserId = null; + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to none. Token required for protected endpoints."); + } + else + { + var currentUserId = _currentUserId; + + var authHeader = context.Request.Headers["Authorization"]; + if (authHeader != StringValues.Empty) + { + var header = authHeader.FirstOrDefault(); + if (!string.IsNullOrEmpty(header) && header.StartsWith("Email ") && header.Length > "Email ".Length) + { + currentUserId = header.Substring("Email ".Length); + } + } + + + if (!string.IsNullOrEmpty(currentUserId)) + { + var user = new ClaimsIdentity(new[] { + new Claim("emails", currentUserId), + new Claim("name", "Test user"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("ttp://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} + , "ByPassAuth"); + + context.User = new ClaimsPrincipal(user); + } + + await _next.Invoke(context); + } + } + } +} diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index a61f7ed83..76cb274e7 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -7,6 +7,7 @@ using global::Ordering.API.Application.IntegrationEvents.Events; using global::Ordering.API.Infrastructure.Filters; using global::Ordering.API.Infrastructure.HostedServices; + using global::Ordering.API.Infrastructure.Middlewares; using Infrastructure.AutofacModules; using Infrastructure.Filters; using Infrastructure.Services; @@ -235,16 +236,13 @@ { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => @@ -286,6 +284,11 @@ protected virtual void ConfigureAuth(IApplicationBuilder app) { + if (Configuration.GetValue("UseLoadTest")) + { + app.UseMiddleware(); + } + app.UseAuthentication(); } diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 6f88785cc..4ddf7cebc 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -111,16 +111,13 @@ namespace Payment.API { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs new file mode 100644 index 000000000..72adaaa4d --- /dev/null +++ b/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -0,0 +1,80 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace WebMVC.Infrastructure.Middlewares +{ + class ByPassAuthMiddleware + { + private readonly RequestDelegate _next; + private string _currentUserId; + public ByPassAuthMiddleware(RequestDelegate next) + { + _next = next; + _currentUserId = null; + } + + + public async Task Invoke(HttpContext context) + { + var path = context.Request.Path; + if (path == "/noauth") + { + var userid = context.Request.Query["userid"]; + if (!string.IsNullOrEmpty(userid)) + { + _currentUserId = userid; + } + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to {_currentUserId}"); + } + + else if (path == "/noauth/reset") + { + _currentUserId = null; + context.Response.StatusCode = 200; + context.Response.ContentType = "text/string"; + await context.Response.WriteAsync($"User set to none. Token required for protected endpoints."); + } + else + { + var currentUserId = _currentUserId; + + var authHeader = context.Request.Headers["Authorization"]; + if (authHeader != StringValues.Empty) + { + var header = authHeader.FirstOrDefault(); + if (!string.IsNullOrEmpty(header) && header.StartsWith("Email ") && header.Length > "Email ".Length) + { + currentUserId = header.Substring("Email ".Length); + } + } + + + if (!string.IsNullOrEmpty(currentUserId)) + { + var user = new ClaimsIdentity(new[] { + new Claim("emails", currentUserId), + new Claim("name", "Test user"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("ttp://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("nonce", Guid.NewGuid().ToString()), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), + new Claim("sub", "1234"), + new Claim("card_expiration", "12/20"), + new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} + , "ByPassAuth"); + + context.User = new ClaimsPrincipal(user); + } + + await _next.Invoke(context); + } + } + } +} diff --git a/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs b/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs index 8805bc752..43eac7b30 100644 --- a/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs +++ b/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs @@ -1,4 +1,5 @@ -using Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http; +using Microsoft.AspNetCore.Http; +using Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http; using Microsoft.Extensions.Logging; using Polly; using System; @@ -11,17 +12,19 @@ namespace Microsoft.eShopOnContainers.WebMVC.Infrastructure private readonly ILogger _logger; private readonly int _retryCount; private readonly int _exceptionsAllowedBeforeBreaking; + private readonly IHttpContextAccessor _httpContextAccessor; - public ResilientHttpClientFactory(ILogger logger, int exceptionsAllowedBeforeBreaking = 5, int retryCount = 6) + public ResilientHttpClientFactory(ILogger logger, IHttpContextAccessor httpContextAccessor, int exceptionsAllowedBeforeBreaking = 5, int retryCount = 6) { _logger = logger; _exceptionsAllowedBeforeBreaking = exceptionsAllowedBeforeBreaking; _retryCount = retryCount; + _httpContextAccessor = httpContextAccessor; } public ResilientHttpClient CreateResilientHttpClient() - => new ResilientHttpClient((origin) => CreatePolicies(), _logger); + => new ResilientHttpClient((origin) => CreatePolicies(), _logger, _httpContextAccessor); private Policy[] CreatePolicies() => new Policy[] diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index 0dd967e41..63ce47045 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -17,6 +17,7 @@ using Microsoft.Extensions.Logging; using System; using System.IdentityModel.Tokens.Jwt; using WebMVC.Infrastructure; +using WebMVC.Infrastructure.Middlewares; using WebMVC.Services; namespace Microsoft.eShopOnContainers.WebMVC @@ -78,6 +79,7 @@ namespace Microsoft.eShopOnContainers.WebMVC services.AddSingleton(sp => { var logger = sp.GetRequiredService>(); + var httpContextAccessor = sp.GetRequiredService(); var retryCount = 6; if (!string.IsNullOrEmpty(Configuration["HttpClientRetryCount"])) @@ -91,7 +93,7 @@ namespace Microsoft.eShopOnContainers.WebMVC exceptionsAllowedBeforeBreaking = int.Parse(Configuration["HttpClientExceptionsAllowedBeforeBreaking"]); } - return new ResilientHttpClientFactory(logger, exceptionsAllowedBeforeBreaking, retryCount); + return new ResilientHttpClientFactory(logger, httpContextAccessor, exceptionsAllowedBeforeBreaking, retryCount); }); services.AddSingleton(sp => sp.GetService().CreateResilientHttpClient()); } @@ -159,6 +161,11 @@ namespace Microsoft.eShopOnContainers.WebMVC app.UseSession(); app.UseStaticFiles(); + if (Configuration.GetValue("UseLoadTest")) + { + app.UseMiddleware(); + } + app.UseAuthentication(); var log = loggerFactory.CreateLogger("identity"); @@ -181,16 +188,13 @@ namespace Microsoft.eShopOnContainers.WebMVC { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 56e3118e7..243976d8f 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -135,16 +135,13 @@ namespace eShopConContainers.WebSPA { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/src/Web/WebStatus/Startup.cs b/src/Web/WebStatus/Startup.cs index a17fd00f8..19aedc449 100644 --- a/src/Web/WebStatus/Startup.cs +++ b/src/Web/WebStatus/Startup.cs @@ -88,16 +88,13 @@ namespace WebStatus { services.AddApplicationInsightsTelemetry(Configuration); var orchestratorType = Configuration.GetValue("OrchestratorType"); - if (string.IsNullOrEmpty(orchestratorType)) - { - return; - } - if (orchestratorType.ToUpper().Equals("K8S")) + + if (orchestratorType?.ToUpper() == "K8S") { // Enable K8s telemetry initializer services.EnableKubernetes(); } - if (orchestratorType.ToUpper().Equals("SF")) + if (orchestratorType?.ToUpper() == "SF") { // Enable SF telemetry initializer services.AddSingleton((serviceProvider) => diff --git a/test/Services/LoadTest/Basket.API/AddBasket.webtest b/test/Services/LoadTest/Basket.API/AddBasket.webtest index a56ca94f0..756a1ed82 100644 --- a/test/Services/LoadTest/Basket.API/AddBasket.webtest +++ b/test/Services/LoadTest/Basket.API/AddBasket.webtest @@ -1,85 +1,13 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
ewAiAEIAdQB5AGUAcgBJAGQAIgA6ACIAewB7AEwAbwBjAGEAbABUAGUAcwB0AFMAZQB0AHQAaQBuAGcAcwAuAFUAcwBlAHIALgBpAGQAfQB9ACIAfQA= - - -
- - - - - diff --git a/test/Services/LoadTest/Basket.API/Checkout.webtest b/test/Services/LoadTest/Basket.API/Checkout.webtest index 0d2a179b8..ef7523bc3 100644 --- a/test/Services/LoadTest/Basket.API/Checkout.webtest +++ b/test/Services/LoadTest/Basket.API/Checkout.webtest @@ -1,86 +1,14 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
ewAiAEMAaQB0AHkAIgA6ACIAYwBpAHQAeQAiACwAIgBTAHQAcgBlAGUAdAAiADoAIgBzAHQAcgBlAGUAdAAiACwAIgBTAHQAYQB0AGUAIgA6ACIAcwB0AGEAdABlACIALAAiAEMAbwB1AG4AdAByAHkAIgA6ACIAYwBvAHUAdAByAHkAIgAsACIAWgBpAHAAQwBvAGQAZQAiADoAIgB6AGkAcABjAG8AZABlACIALAAiAEMAYQByAGQATgB1AG0AYgBlAHIAIgA6ACIAQwBhAHIAZABOAHUAbQBiAGUAcgAiACwAIgBDAGEAcgBkAEgAbwBsAGQAZQByAE4AYQBtAGUAIgA6ACIAQwBhAHIAZABIAG8AbABkAGUAcgBOAGEAbQBlACIALAAiAEMAYQByAGQARQB4AHAAaQByAGEAdABpAG8AbgAiADoAIgAyADAAMQA3AC0AMAA2AC0AMwAwAFQAMQAyADoAMgA1ADoAMwAxAC4AOAA3ADQANwAyADIANwBaACIALAAiAEMAYQByAGQAUwBlAGMAdQByAGkAdAB5AE4AdQBtAGIAZQByACIAOgAiADEAMgAzADQAIgAsACIAQwBhAHIAZABUAHkAcABlAEkAZAAiADoAMQAsACIAQgB1AHkAZQByACIAOgAiAEIAdQB5AGUAcgAiACwAIgBSAGUAcQB1AGUAcwB0AEkAZAAiADoAIgBlAGIAOAAwADAAMwA2ADQALQBiADQAZQAxAC0ANAA2AGUAYgAtADkAMgAzADUALQBlADgAYwA0ADcANAA3AGQAYQAyAGQANAAiAH0A - - -
- - - - - diff --git a/test/Services/LoadTest/Basket.API/DeleteBasket.webtest b/test/Services/LoadTest/Basket.API/DeleteBasket.webtest index dd38dcc60..c472bbefc 100644 --- a/test/Services/LoadTest/Basket.API/DeleteBasket.webtest +++ b/test/Services/LoadTest/Basket.API/DeleteBasket.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Basket.API/GetBasket.webtest b/test/Services/LoadTest/Basket.API/GetBasket.webtest index 4f3f7b8f4..8af000753 100644 --- a/test/Services/LoadTest/Basket.API/GetBasket.webtest +++ b/test/Services/LoadTest/Basket.API/GetBasket.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Location.API/CreateOrUpdateUserLocation.webtest b/test/Services/LoadTest/Location.API/CreateOrUpdateUserLocation.webtest index 6d3e0d887..d005c1c32 100644 --- a/test/Services/LoadTest/Location.API/CreateOrUpdateUserLocation.webtest +++ b/test/Services/LoadTest/Location.API/CreateOrUpdateUserLocation.webtest @@ -1,85 +1,13 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
ewAiAEwAbwBuAGcAaQB0AHUAZABlACIAOgAtADEAMgAxAC4AMAA0ADAAMwA2ACwAIgBMAGEAdABpAHQAdQBkAGUAIgA6ADQAOAAuADAAOQAxADYAMwAxAH0A - - -
- - - - - diff --git a/test/Services/LoadTest/Location.API/GetAllLocations.webtest b/test/Services/LoadTest/Location.API/GetAllLocations.webtest index b210918f4..86dc545f2 100644 --- a/test/Services/LoadTest/Location.API/GetAllLocations.webtest +++ b/test/Services/LoadTest/Location.API/GetAllLocations.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Location.API/GetLocation.webtest b/test/Services/LoadTest/Location.API/GetLocation.webtest index d9fee854c..72614cdf9 100644 --- a/test/Services/LoadTest/Location.API/GetLocation.webtest +++ b/test/Services/LoadTest/Location.API/GetLocation.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Location.API/GetUserLocation.webtest b/test/Services/LoadTest/Location.API/GetUserLocation.webtest index d17d7a7d0..8b9f2bf76 100644 --- a/test/Services/LoadTest/Location.API/GetUserLocation.webtest +++ b/test/Services/LoadTest/Location.API/GetUserLocation.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Marketing.API/GetAllCampaigns.webtest b/test/Services/LoadTest/Marketing.API/GetAllCampaigns.webtest index 652d9e84b..63383876e 100644 --- a/test/Services/LoadTest/Marketing.API/GetAllCampaigns.webtest +++ b/test/Services/LoadTest/Marketing.API/GetAllCampaigns.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Marketing.API/GetCampaign.webtest b/test/Services/LoadTest/Marketing.API/GetCampaign.webtest index 3d8df3f2c..c8a0623bf 100644 --- a/test/Services/LoadTest/Marketing.API/GetCampaign.webtest +++ b/test/Services/LoadTest/Marketing.API/GetCampaign.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Marketing.API/GetUserCampaigns.webtest b/test/Services/LoadTest/Marketing.API/GetUserCampaigns.webtest index 28351fcf3..aaf392ab2 100644 --- a/test/Services/LoadTest/Marketing.API/GetUserCampaigns.webtest +++ b/test/Services/LoadTest/Marketing.API/GetUserCampaigns.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Ordering.API/CancelOrder.webtest b/test/Services/LoadTest/Ordering.API/CancelOrder.webtest index 73eb70993..5f1a2204a 100644 --- a/test/Services/LoadTest/Ordering.API/CancelOrder.webtest +++ b/test/Services/LoadTest/Ordering.API/CancelOrder.webtest @@ -1,86 +1,13 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
-
+
ewAiAE8AcgBkAGUAcgBOAHUAbQBiAGUAcgAiADoAIAAxAH0A - - -
- - - - - diff --git a/test/Services/LoadTest/Ordering.API/GetAllOrders.webtest b/test/Services/LoadTest/Ordering.API/GetAllOrders.webtest index 256c957f0..614f2bd1f 100644 --- a/test/Services/LoadTest/Ordering.API/GetAllOrders.webtest +++ b/test/Services/LoadTest/Ordering.API/GetAllOrders.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest b/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest index 465af4b0e..28c40c85e 100644 --- a/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest +++ b/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Ordering.API/GetOrder.webtest b/test/Services/LoadTest/Ordering.API/GetOrder.webtest index b7175a3d2..d81388995 100644 --- a/test/Services/LoadTest/Ordering.API/GetOrder.webtest +++ b/test/Services/LoadTest/Ordering.API/GetOrder.webtest @@ -1,84 +1,12 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
- - -
- - - - - diff --git a/test/Services/LoadTest/Ordering.API/ShipOrder.webtest b/test/Services/LoadTest/Ordering.API/ShipOrder.webtest index 73ea953a3..36a778855 100644 --- a/test/Services/LoadTest/Ordering.API/ShipOrder.webtest +++ b/test/Services/LoadTest/Ordering.API/ShipOrder.webtest @@ -1,86 +1,14 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
+
ewAiAE8AcgBkAGUAcgBOAHUAbQBiAGUAcgAiADoAIAAxAH0A - - -
- - - - - diff --git a/test/Services/LoadTest/WebMVC/AddProducts.webtest b/test/Services/LoadTest/WebMVC/AddProducts.webtest index 3fc66d316..66c8df9f0 100644 --- a/test/Services/LoadTest/WebMVC/AddProducts.webtest +++ b/test/Services/LoadTest/WebMVC/AddProducts.webtest @@ -1,70 +1,6 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - @@ -76,33 +12,25 @@ - +
+
- - - - - - - - - - + + + + + + + + + - - -
- - - - - diff --git a/test/Services/LoadTest/WebMVC/CatalogFilter.webtest b/test/Services/LoadTest/WebMVC/CatalogFilter.webtest index 331623abd..1385cbf37 100644 --- a/test/Services/LoadTest/WebMVC/CatalogFilter.webtest +++ b/test/Services/LoadTest/WebMVC/CatalogFilter.webtest @@ -1,78 +1,10 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
+
@@ -98,7 +30,6 @@ - @@ -107,6 +38,7 @@
+
@@ -132,7 +64,6 @@ - @@ -141,24 +72,16 @@
+
- - - -
- - - - - diff --git a/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest b/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest index f749c3b51..bfa715cbb 100644 --- a/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest +++ b/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest @@ -1,95 +1,27 @@  - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
+
- - - - - - - - - - + + + + + + + + +
+
@@ -121,6 +53,7 @@
+
@@ -205,7 +138,7 @@ - + @@ -213,6 +146,7 @@
+
@@ -223,41 +157,29 @@ - - - - - + + + + + - - - + +
+
- - -
- - - - -
- - - - - + @@ -271,4 +193,12 @@ + + + + + + + + \ No newline at end of file