Browse Source

remove load test references

pull/1562/head
Borja García Rodríguez 4 years ago
parent
commit
c970512232
33 changed files with 3 additions and 302 deletions
  1. +0
    -1
      deploy/k8s/archived/helm/basket-api/templates/configmap.yaml
  2. +0
    -2
      deploy/k8s/archived/helm/basket-api/values.yaml
  3. +0
    -1
      deploy/k8s/archived/helm/inf.yaml
  4. +0
    -1
      deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml
  5. +0
    -1
      deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml
  6. +0
    -2
      deploy/k8s/archived/helm/ordering-api/values.yaml
  7. +0
    -1
      deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml
  8. +0
    -2
      deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml
  9. +0
    -1
      deploy/k8s/archived/helm/webmvc/templates/configmap.yaml
  10. +0
    -2
      deploy/k8s/archived/helm/webmvc/values.yaml
  11. +0
    -1
      deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml
  12. +0
    -2
      deploy/k8s/archived/helm/webspa/values.yaml
  13. +0
    -1
      deploy/k8s/helm/basket-api/templates/configmap.yaml
  14. +0
    -2
      deploy/k8s/helm/basket-api/values.yaml
  15. +0
    -1
      deploy/k8s/helm/inf.yaml
  16. +0
    -1
      deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml
  17. +0
    -1
      deploy/k8s/helm/ordering-api/templates/configmap.yaml
  18. +0
    -2
      deploy/k8s/helm/ordering-api/values.yaml
  19. +0
    -2
      deploy/k8s/helm/ordering-backgroundtasks/values.yaml
  20. +0
    -1
      deploy/k8s/helm/webmvc/templates/configmap.yaml
  21. +0
    -2
      deploy/k8s/helm/webmvc/values.yaml
  22. +0
    -1
      deploy/k8s/helm/webshoppingagg/templates/configmap.yaml
  23. +0
    -1
      deploy/k8s/helm/webspa/templates/configmap.yaml
  24. +0
    -2
      deploy/k8s/helm/webspa/values.yaml
  25. +0
    -1
      deploy/k8s/helm/webstatus/templates/configmap.yaml
  26. +1
    -2
      src/.env
  27. +0
    -79
      src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs
  28. +0
    -5
      src/Services/Basket/Basket.API/Startup.cs
  29. +0
    -79
      src/Services/Ordering/Ordering.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs
  30. +0
    -6
      src/Services/Ordering/Ordering.API/Startup.cs
  31. +0
    -7
      src/Services/Webhooks/Webhooks.API/Startup.cs
  32. +0
    -80
      src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs
  33. +2
    -9
      src/Web/WebMVC/Startup.cs

+ 0
- 1
deploy/k8s/archived/helm/basket-api/templates/configmap.yaml View File

@ -12,7 +12,6 @@ metadata:
data: data:
basket__ConnectionString: {{ .Values.inf.redis.basket.constr }} basket__ConnectionString: {{ .Values.inf.redis.basket.constr }}
urls__IdentityUrl: http://{{ .Values.app.svc.identity }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

+ 0
- 2
deploy/k8s/archived/helm/basket-api/values.yaml View File

@ -36,8 +36,6 @@ env:
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: IdentityUrl - name: IdentityUrl
key: urls__IdentityUrl key: urls__IdentityUrl
- name: UseLoadTest
key: basket__EnableLoadTest
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values: values:
- name: OrchestratorType - name: OrchestratorType


+ 0
- 1
deploy/k8s/archived/helm/inf.yaml View File

@ -38,7 +38,6 @@ inf:
dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED
local: false # True when deploying on "local K8s" provided by Docker Desktop. local: false # True when deploying on "local K8s" provided by Docker Desktop.
misc: # inf.misc contains miscellaneous configuration related to infrastructure misc: # inf.misc contains miscellaneous configuration related to infrastructure
useLoadTest: false # If running under loading test or not
useAzureStorage: false # If catalog api uses azure storage or not useAzureStorage: false # If catalog api uses azure storage or not
# registry: # Uncomment "registry" to specify registry secret # registry: # Uncomment "registry" to specify registry secret
# secretName: # secretName is the name of the secret inside k8s # secretName: # secretName is the name of the secret inside k8s


+ 0
- 1
deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml View File

@ -11,7 +11,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__basket: http://{{ .Values.app.svc.basket }}
internalurls__catalog: http://{{ .Values.app.svc.catalog }} internalurls__catalog: http://{{ .Values.app.svc.catalog }}


+ 0
- 1
deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml View File

@ -12,7 +12,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
urls__IdentityUrl: http://{{ .Values.app.svc.identity }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"

+ 0
- 2
deploy/k8s/archived/helm/ordering-api/values.yaml View File

@ -41,8 +41,6 @@ env:
key: all__EventBusConnection key: all__EventBusConnection
- name: AzureServiceBusEnabled - name: AzureServiceBusEnabled
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: UseLoadTest
key: ordering__EnableLoadTest
- name: IdentityUrl - name: IdentityUrl
key: urls__IdentityUrl key: urls__IdentityUrl
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)


+ 0
- 1
deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml View File

@ -13,7 +13,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"


+ 0
- 2
deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml View File

@ -44,8 +44,6 @@ env:
key: all__EventBusConnection key: all__EventBusConnection
- name: AzureServiceBusEnabled - name: AzureServiceBusEnabled
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: UseLoadTest
key: ordering__EnableLoadTest
- name: CheckUpdateTime - name: CheckUpdateTime
key: graceperiodmanager__CheckUpdateTime key: graceperiodmanager__CheckUpdateTime
- name: GracePeriodTime - name: GracePeriodTime


+ 0
- 1
deploy/k8s/archived/helm/webmvc/templates/configmap.yaml View File

@ -16,7 +16,6 @@ metadata:
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webmvc__keystore: {{ .Values.inf.redis.keystore.constr }} webmvc__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }}
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc


+ 0
- 2
deploy/k8s/archived/helm/webmvc/values.yaml View File

@ -32,8 +32,6 @@ env:
configmap: configmap:
- name: ApplicationInsights__InstrumentationKey - name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey key: all__InstrumentationKey
- name: UseLoadTest
key: all_EnableLoadTest
- name: DPConnectionString - name: DPConnectionString
key: webmvc__keystore key: webmvc__keystore
- name: PurchaseUrl - name: PurchaseUrl


+ 0
- 1
deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml View File

@ -11,7 +11,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__basket: http://{{ .Values.app.svc.basket }}
internalurls__catalog: http://{{ .Values.app.svc.catalog }} internalurls__catalog: http://{{ .Values.app.svc.catalog }}


+ 0
- 2
deploy/k8s/archived/helm/webspa/values.yaml View File

@ -32,8 +32,6 @@ env:
configmap: configmap:
- name: ApplicationInsights__InstrumentationKey - name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey key: all__InstrumentationKey
- name: UseLoadTest
key: all_EnableLoadTest
- name: DPConnectionString - name: DPConnectionString
key: webspa__keystore key: webspa__keystore
- name: PurchaseUrl - name: PurchaseUrl


+ 0
- 1
deploy/k8s/helm/basket-api/templates/configmap.yaml View File

@ -12,7 +12,6 @@ metadata:
data: data:
basket__ConnectionString: {{ .Values.inf.redis.basket.constr }} basket__ConnectionString: {{ .Values.inf.redis.basket.constr }}
urls__IdentityUrl: http://{{ .Values.app.svc.identity }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

+ 0
- 2
deploy/k8s/helm/basket-api/values.yaml View File

@ -36,8 +36,6 @@ env:
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: IdentityUrl - name: IdentityUrl
key: urls__IdentityUrl key: urls__IdentityUrl
- name: UseLoadTest
key: basket__EnableLoadTest
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values: values:
- name: OrchestratorType - name: OrchestratorType


+ 0
- 1
deploy/k8s/helm/inf.yaml View File

@ -38,7 +38,6 @@ inf:
dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED
local: false # True when deploying on "local K8s" provided by Docker Desktop. local: false # True when deploying on "local K8s" provided by Docker Desktop.
misc: # inf.misc contains miscellaneous configuration related to infrastructure misc: # inf.misc contains miscellaneous configuration related to infrastructure
useLoadTest: false # If running under loading test or not
useAzureStorage: false # If catalog api uses azure storage or not useAzureStorage: false # If catalog api uses azure storage or not
# registry: # Uncomment "registry" to specify registry secret # registry: # Uncomment "registry" to specify registry secret
# secretName: # secretName is the name of the secret inside k8s # secretName: # secretName is the name of the secret inside k8s


+ 0
- 1
deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml View File

@ -11,7 +11,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__basket: http://{{ .Values.app.svc.basket }}
internalurls__catalog: http://{{ .Values.app.svc.catalog }} internalurls__catalog: http://{{ .Values.app.svc.catalog }}


+ 0
- 1
deploy/k8s/helm/ordering-api/templates/configmap.yaml View File

@ -12,7 +12,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
urls__IdentityUrl: http://{{ .Values.app.svc.identity }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"

+ 0
- 2
deploy/k8s/helm/ordering-api/values.yaml View File

@ -41,8 +41,6 @@ env:
key: all__EventBusConnection key: all__EventBusConnection
- name: AzureServiceBusEnabled - name: AzureServiceBusEnabled
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: UseLoadTest
key: ordering__EnableLoadTest
- name: IdentityUrl - name: IdentityUrl
key: urls__IdentityUrl key: urls__IdentityUrl
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)


+ 0
- 2
deploy/k8s/helm/ordering-backgroundtasks/values.yaml View File

@ -44,8 +44,6 @@ env:
key: all__EventBusConnection key: all__EventBusConnection
- name: AzureServiceBusEnabled - name: AzureServiceBusEnabled
key: all__UseAzureServiceBus key: all__UseAzureServiceBus
- name: UseLoadTest
key: ordering__EnableLoadTest
- name: CheckUpdateTime - name: CheckUpdateTime
key: graceperiodmanager__CheckUpdateTime key: graceperiodmanager__CheckUpdateTime
- name: GracePeriodTime - name: GracePeriodTime


+ 0
- 1
deploy/k8s/helm/webmvc/templates/configmap.yaml View File

@ -16,7 +16,6 @@ metadata:
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webmvc__keystore: {{ .Values.inf.redis.keystore.constr }} webmvc__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }}
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc


+ 0
- 2
deploy/k8s/helm/webmvc/values.yaml View File

@ -32,8 +32,6 @@ env:
configmap: configmap:
- name: ApplicationInsights__InstrumentationKey - name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey key: all__InstrumentationKey
- name: UseLoadTest
key: all_EnableLoadTest
- name: DPConnectionString - name: DPConnectionString
key: webmvc__keystore key: webmvc__keystore
- name: PurchaseUrl - name: PurchaseUrl


+ 0
- 1
deploy/k8s/helm/webshoppingagg/templates/configmap.yaml View File

@ -11,7 +11,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__basket: http://{{ .Values.app.svc.basket }}
internalurls__catalog: http://{{ .Values.app.svc.catalog }} internalurls__catalog: http://{{ .Values.app.svc.catalog }}


+ 0
- 1
deploy/k8s/helm/webspa/templates/configmap.yaml View File

@ -16,7 +16,6 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webspa__keystore: {{ .Values.inf.redis.keystore.constr }} webspa__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }}
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc


+ 0
- 2
deploy/k8s/helm/webspa/values.yaml View File

@ -32,8 +32,6 @@ env:
configmap: configmap:
- name: ApplicationInsights__InstrumentationKey - name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey key: all__InstrumentationKey
- name: UseLoadTest
key: all_EnableLoadTest
- name: DPConnectionString - name: DPConnectionString
key: webspa__keystore key: webspa__keystore
- name: PurchaseUrl - name: PurchaseUrl


+ 0
- 1
deploy/k8s/helm/webstatus/templates/configmap.yaml View File

@ -16,7 +16,6 @@ metadata:
data: data:
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webstatus__keystore: {{ .Values.inf.redis.keystore.constr }} webstatus__keystore: {{ .Values.inf.redis.keystore.constr }}
name__mvc__hc: WebMVC HTTP Check name__mvc__hc: WebMVC HTTP Check
internalurls__mvc__hc: http://{{ .Values.app.svc.mvc }}/hc internalurls__mvc__hc: http://{{ .Values.app.svc.mvc }}/hc


+ 1
- 2
src/.env View File

@ -32,5 +32,4 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.162
#ESHOP_AZURE_STORAGE_CATALOG_KEY=<YourAzureStorageCatalogKey> #ESHOP_AZURE_STORAGE_CATALOG_KEY=<YourAzureStorageCatalogKey>
#ESHOP_SERVICE_BUS_USERNAME=<ServiceBusUserName-OnlyUsedIfUsingRabbitMQUnderwindows> #ESHOP_SERVICE_BUS_USERNAME=<ServiceBusUserName-OnlyUsedIfUsingRabbitMQUnderwindows>
#ESHOP_SERVICE_BUS_PASSWORD=<ServiceBusUserPassword-OnlyUsedIfUsingRabbitMQUnderwindows> #ESHOP_SERVICE_BUS_PASSWORD=<ServiceBusUserPassword-OnlyUsedIfUsingRabbitMQUnderwindows>
#INSTRUMENTATION_KEY=
#USE_LOADTEST=<True/False>
#INSTRUMENTATION_KEY=

+ 0
- 79
src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs View File

@ -1,79 +0,0 @@
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("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"),
new Claim("nonce", Guid.NewGuid().ToString()),
new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"),
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"),
new Claim("sub", currentUserId),
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")}
, "ByPassAuth");
context.User = new ClaimsPrincipal(user);
}
await _next.Invoke(context);
}
}
}
}

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

@ -275,11 +275,6 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
protected virtual void ConfigureAuth(IApplicationBuilder app) protected virtual void ConfigureAuth(IApplicationBuilder app)
{ {
if (Configuration.GetValue<bool>("UseLoadTest"))
{
app.UseMiddleware<ByPassAuthMiddleware>();
}
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
} }


+ 0
- 79
src/Services/Ordering/Ordering.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs View File

@ -1,79 +0,0 @@
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("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"),
new Claim("nonce", Guid.NewGuid().ToString()),
new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"),
new Claim("sub", currentUserId),
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);
}
}
}
}

+ 0
- 6
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -6,7 +6,6 @@
using global::Ordering.API.Application.IntegrationEvents; using global::Ordering.API.Application.IntegrationEvents;
using global::Ordering.API.Application.IntegrationEvents.Events; using global::Ordering.API.Application.IntegrationEvents.Events;
using global::Ordering.API.Infrastructure.Filters; using global::Ordering.API.Infrastructure.Filters;
using global::Ordering.API.Infrastructure.Middlewares;
using GrpcOrdering; using GrpcOrdering;
using HealthChecks.UI.Client; using HealthChecks.UI.Client;
using Infrastructure.AutofacModules; using Infrastructure.AutofacModules;
@ -149,11 +148,6 @@
protected virtual void ConfigureAuth(IApplicationBuilder app) protected virtual void ConfigureAuth(IApplicationBuilder app)
{ {
if (Configuration.GetValue<bool>("UseLoadTest"))
{
app.UseMiddleware<ByPassAuthMiddleware>();
}
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
} }


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

@ -112,13 +112,6 @@ namespace Webhooks.API
protected virtual void ConfigureAuth(IApplicationBuilder app) protected virtual void ConfigureAuth(IApplicationBuilder app)
{ {
/*
if (Configuration.GetValue<bool>("UseLoadTest"))
{
app.UseMiddleware<ByPassAuthMiddleware>();
}
*/
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
} }


+ 0
- 80
src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs View File

@ -1,80 +0,0 @@
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("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"),
new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"),
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"),
new Claim("sub", currentUserId),
new Claim("card_expiration", "12/21"),
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")}
, "ByPassAuth");
context.User = new ClaimsPrincipal(user);
}
await _next.Invoke(context);
}
}
}
}

+ 2
- 9
src/Web/WebMVC/Startup.cs View File

@ -21,7 +21,6 @@ using System;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Net.Http; using System.Net.Http;
using WebMVC.Infrastructure; using WebMVC.Infrastructure;
using WebMVC.Infrastructure.Middlewares;
using WebMVC.Services; using WebMVC.Services;
namespace Microsoft.eShopOnContainers.WebMVC namespace Microsoft.eShopOnContainers.WebMVC
@ -76,11 +75,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
app.UseStaticFiles(); app.UseStaticFiles();
app.UseSession(); app.UseSession();
if (Configuration.GetValue<bool>("UseLoadTest"))
{
app.UseMiddleware<ByPassAuthMiddleware>();
}
WebContextSeed.Seed(app, env); WebContextSeed.Seed(app, env);
// Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used // Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used
@ -185,7 +179,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration) public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
{ {
var useLoadTest = configuration.GetValue<bool>("UseLoadTest");
var identityUrl = configuration.GetValue<string>("IdentityUrl"); var identityUrl = configuration.GetValue<string>("IdentityUrl");
var callBackUrl = configuration.GetValue<string>("CallBackUrl"); var callBackUrl = configuration.GetValue<string>("CallBackUrl");
var sessionCookieLifetime = configuration.GetValue("SessionCookieLifetimeMinutes", 60); var sessionCookieLifetime = configuration.GetValue("SessionCookieLifetimeMinutes", 60);
@ -203,9 +196,9 @@ namespace Microsoft.eShopOnContainers.WebMVC
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.Authority = identityUrl.ToString(); options.Authority = identityUrl.ToString();
options.SignedOutRedirectUri = callBackUrl.ToString(); options.SignedOutRedirectUri = callBackUrl.ToString();
options.ClientId = useLoadTest ? "mvctest" : "mvc";
options.ClientId = "mvc";
options.ClientSecret = "secret"; options.ClientSecret = "secret";
options.ResponseType = useLoadTest ? "code id_token token" : "code id_token";
options.ResponseType = "code id_token";
options.SaveTokens = true; options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true; options.GetClaimsFromUserInfoEndpoint = true;
options.RequireHttpsMetadata = false; options.RequireHttpsMetadata = false;


Loading…
Cancel
Save