Browse Source

Configuration of envoy routes and minor code fixes

features/migration-dotnet3
eiximenis 5 years ago
parent
commit
d68c9e40aa
43 changed files with 204 additions and 88 deletions
  1. +2
    -2
      k8s/deploy.ps1
  2. +6
    -2
      k8s/helm/apigwmm/envoy.yaml
  3. +3
    -1
      k8s/helm/apigwmm/values.yaml
  4. +18
    -6
      k8s/helm/apigwms/envoy.yaml
  5. +3
    -1
      k8s/helm/apigwms/values.yaml
  6. +6
    -2
      k8s/helm/apigwwm/envoy.yaml
  7. +3
    -1
      k8s/helm/apigwwm/values.yaml
  8. +18
    -6
      k8s/helm/apigwws/envoy.yaml
  9. +3
    -1
      k8s/helm/apigwws/values.yaml
  10. +1
    -1
      k8s/helm/catalog-api/templates/configmap.yaml
  11. +2
    -2
      k8s/helm/deploy-all.ps1
  12. +28
    -0
      k8s/helm/identity-api/templates/ingress-dockerk8s.yaml
  13. +1
    -0
      k8s/helm/inf.yaml
  14. +2
    -0
      k8s/helm/ingress_values.yaml
  15. +2
    -0
      k8s/helm/ingress_values_dockerk8s.yaml
  16. +2
    -2
      k8s/helm/istio/doc.md
  17. +1
    -1
      k8s/helm/marketing-api/templates/configmap.yaml
  18. +0
    -1
      k8s/helm/webmvc/templates/configmap.yaml
  19. +28
    -0
      k8s/helm/webmvc/templates/ingress-dockerk8s.yaml
  20. +6
    -2
      src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml
  21. +18
    -6
      src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml
  22. +6
    -2
      src/ApiGateways/Envoy/config/webmarketing/envoy.yaml
  23. +18
    -6
      src/ApiGateways/Envoy/config/webshopping/envoy.yaml
  24. +1
    -6
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
  25. +1
    -5
      src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
  26. +1
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketService.cs
  27. +1
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs
  28. +1
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignService.cs
  29. +1
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderService.cs
  30. +0
    -1
      src/Services/Identity/Identity.API/Startup.cs
  31. +1
    -1
      src/Web/WebMVC/Services/BasketService.cs
  32. +1
    -1
      src/Web/WebMVC/Services/CampaignService.cs
  33. +1
    -1
      src/Web/WebMVC/Services/CatalogService.cs
  34. +1
    -1
      src/Web/WebMVC/Services/OrderingService.cs
  35. +4
    -3
      src/Web/WebMVC/Startup.cs
  36. +2
    -2
      src/Web/WebSPA/Client/modules/basket/basket.service.ts
  37. +2
    -2
      src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts
  38. +3
    -3
      src/Web/WebSPA/Client/modules/catalog/catalog.service.ts
  39. +2
    -2
      src/Web/WebSPA/Client/modules/orders/orders.service.ts
  40. +1
    -5
      src/Web/WebSPA/Startup.cs
  41. +0
    -3
      src/Web/WebStatus/Startup.cs
  42. +2
    -2
      src/docker-compose-tests.override.yml
  43. +1
    -1
      src/docker-compose.override.yml

+ 2
- 2
k8s/deploy.ps1 View File

@ -133,8 +133,8 @@ ExecKube -cmd 'create -f services.yaml'
ExecKube -cmd 'create -f internalurls.yaml' ExecKube -cmd 'create -f internalurls.yaml'
ExecKube -cmd 'create configmap urls ` ExecKube -cmd 'create configmap urls `
--from-literal=PicBaseUrl=http://$($externalDns)/webshoppingapigw/api/v1/c/catalog/items/[0]/pic/ `
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/webmarketingapigw/api/v1/m/campaigns/[0]/pic/ `
--from-literal=PicBaseUrl=http://$($externalDns)/webshoppingapigw/c/api/v1/catalog/items/[0]/pic/ `
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/webmarketingapigw/m/api/v1/campaigns/[0]/pic/ `
--from-literal=mvc_e=http://$($externalDns)/webmvc ` --from-literal=mvc_e=http://$($externalDns)/webmvc `
--from-literal=marketingapigw_e=http://$($externalDns)/webmarketingapigw ` --from-literal=marketingapigw_e=http://$($externalDns)/webmarketingapigw `
--from-literal=webshoppingapigw_e=http://$($externalDns)/webshoppingapigw ` --from-literal=webshoppingapigw_e=http://$($externalDns)/webshoppingapigw `


+ 6
- 2
k8s/helm/apigwmm/envoy.yaml View File

@ -24,9 +24,13 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/m/"
prefix: "/m/"
route:
prefix_rewrite: "/marketing-api/"
cluster: marketing
- match:
prefix: "/marketing-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: marketing cluster: marketing
http_filters: http_filters:
- name: envoy.router - name: envoy.router


+ 3
- 1
k8s/helm/apigwmm/values.yaml View File

@ -12,7 +12,9 @@ service:
ingress: ingress:
enabled: true enabled: true
annotations: {}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: [] tls: []
resources: {} resources: {}


+ 18
- 6
k8s/helm/apigwms/envoy.yaml View File

@ -24,20 +24,32 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/c/"
prefix: "/c/"
route: route:
prefix_rewrite: "/api/v1/"
prefix_rewrite: "/catalog-api/"
cluster: catalog cluster: catalog
- match: - match:
prefix: "/api/v1/o/"
prefix: "/catalog-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
cluster: ordering cluster: ordering
- match: - match:
prefix: "/api/v1/b/"
prefix: "/order-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/b/"
route:
prefix_rewrite: "/basket-api/"
cluster: basket cluster: basket
- match:
prefix: "/basket-api/"
route:
cluster: basket
- match: - match:
prefix: "/" prefix: "/"
route: route:


+ 3
- 1
k8s/helm/apigwms/values.yaml View File

@ -12,7 +12,9 @@ service:
ingress: ingress:
enabled: true enabled: true
annotations: {}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: [] tls: []
resources: {} resources: {}


+ 6
- 2
k8s/helm/apigwwm/envoy.yaml View File

@ -24,9 +24,13 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/m/"
prefix: "/m/"
route:
prefix_rewrite: "/marketing-api/"
cluster: marketing
- match:
prefix: "/marketing-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: marketing cluster: marketing
http_filters: http_filters:
- name: envoy.router - name: envoy.router


+ 3
- 1
k8s/helm/apigwwm/values.yaml View File

@ -12,7 +12,9 @@ service:
ingress: ingress:
enabled: true enabled: true
annotations: {}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: [] tls: []
resources: {} resources: {}


+ 18
- 6
k8s/helm/apigwws/envoy.yaml View File

@ -24,20 +24,32 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/c/"
prefix: "/c/"
route: route:
prefix_rewrite: "/api/v1/"
prefix_rewrite: "/catalog-api/"
cluster: catalog cluster: catalog
- match: - match:
prefix: "/api/v1/o/"
prefix: "/catalog-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
cluster: ordering cluster: ordering
- match: - match:
prefix: "/api/v1/b/"
prefix: "/order-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/b/"
route:
prefix_rewrite: "/basket-api/"
cluster: basket cluster: basket
- match:
prefix: "/basket-api/"
route:
cluster: basket
- match: - match:
prefix: "/" prefix: "/"
route: route:


+ 3
- 1
k8s/helm/apigwws/values.yaml View File

@ -12,7 +12,9 @@ service:
ingress: ingress:
enabled: true enabled: true
annotations: {}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: [] tls: []
resources: {} resources: {}


+ 1
- 1
k8s/helm/catalog-api/templates/configmap.yaml View File

@ -13,7 +13,7 @@ metadata:
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
data: data:
catalog__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.catalog.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; catalog__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.catalog.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}" catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"

+ 2
- 2
k8s/helm/deploy-all.ps1 View File

@ -83,11 +83,11 @@ if ($deployCharts) {
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) { if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) {
Write-Host "Installing: $chart" -ForegroundColor Green Write-Host "Installing: $chart" -ForegroundColor Green
if ($useCustomRegistry) { if ($useCustomRegistry) {
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s --name="$appName-$chart" $chart
} }
else { else {
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s --name="$appName-$chart" $chart
} }
} }
} }


+ 28
- 0
k8s/helm/identity-api/templates/ingress-dockerk8s.yaml View File

@ -0,0 +1,28 @@
{{- if .Values.ingress.enabled -}}
{{- if .Values.inf.k8s.local -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.identity }}
{{- $name := include "identity-api.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $name }}-local
labels:
app: {{ template "identity-api.name" . }}
chart: {{ template "identity-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
rules:
- http:
paths:
- backend:
serviceName: {{ $serviceName }}
servicePort: http
path: {{ $ingressPath }}
{{- end -}}
{{- end -}}

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

@ -41,6 +41,7 @@ inf:
key: "" # App insights to use key: "" # App insights to use
k8s: # inf.k8s defines Kubernetes cluster global config k8s: # inf.k8s defines Kubernetes cluster global config
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.
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 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


+ 2
- 0
k8s/helm/ingress_values.yaml View File

@ -1,3 +1,5 @@
# This file contains common annotations when using AKS with Http Application Routing
ingress: ingress:
annotations: annotations:
kubernetes.io/ingress.class: addon-http-application-routing kubernetes.io/ingress.class: addon-http-application-routing


+ 2
- 0
k8s/helm/ingress_values_dockerk8s.yaml View File

@ -1,3 +1,5 @@
# This file contains common ingress annotations when using Kubernetes included in Docker Desktop
ingress: ingress:
annotations: annotations:
kubernetes.io/ingress.class: "nginx" kubernetes.io/ingress.class: "nginx"


+ 2
- 2
k8s/helm/istio/doc.md View File

@ -173,7 +173,7 @@ The file `inf.yaml` contains the description of the infrastructure used. File is
Using Azure storage for catalog (and marketing) photos is not directly supported, but you can accomplish it by editing the file `k8s/helm/catalog-api/templates/configmap.yaml`. Search for lines: Using Azure storage for catalog (and marketing) photos is not directly supported, but you can accomplish it by editing the file `k8s/helm/catalog-api/templates/configmap.yaml`. Search for lines:
``` ```
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
``` ```
And replace it for: And replace it for:
@ -185,7 +185,7 @@ catalog__PicBaseUrl: http://<url-of-the-storage>/
In the same way, to use Azure storage for the marketing service, have to edit the file `k8s/helm/marketing-api/templates/configmap.yaml` and replacing the line: In the same way, to use Azure storage for the marketing service, have to edit the file `k8s/helm/marketing-api/templates/configmap.yaml` and replacing the line:
``` ```
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
``` ```
by: by:


+ 1
- 1
k8s/helm/marketing-api/templates/configmap.yaml View File

@ -23,4 +23,4 @@ data:
marketing__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.marketing.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; marketing__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.marketing.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
marketing__MongoConnectionString: mongodb://{{ $mongo }} marketing__MongoConnectionString: mongodb://{{ $mongo }}
marketing__MongoDatabase: {{ .Values.inf.mongo.marketing.database }} marketing__MongoDatabase: {{ .Values.inf.mongo.marketing.database }}
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/

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

@ -3,7 +3,6 @@
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} {{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}}
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:


+ 28
- 0
k8s/helm/webmvc/templates/ingress-dockerk8s.yaml View File

@ -0,0 +1,28 @@
{{- if .Values.ingress.enabled -}}
{{- if .Values.inf.k8s.local -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mvc }}
{{- $name := include "webmvc.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $name }}-local
labels:
app: {{ template "webmvc.name" . }}
chart: {{ template "webmvc.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
rules:
- http:
paths:
- backend:
serviceName: {{ $serviceName }}
servicePort: http
path: {{ $ingressPath }}
{{- end -}}
{{- end -}}

+ 6
- 2
src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml View File

@ -24,9 +24,13 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/m/"
prefix: "/m/"
route:
prefix_rewrite: "/marketing-api/"
cluster: marketing
- match:
prefix: "/marketing-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: marketing cluster: marketing
http_filters: http_filters:
- name: envoy.router - name: envoy.router


+ 18
- 6
src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml View File

@ -24,20 +24,32 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/c/"
prefix: "/c/"
route: route:
prefix_rewrite: "/api/v1/"
prefix_rewrite: "/catalog-api/"
cluster: catalog cluster: catalog
- match: - match:
prefix: "/api/v1/o/"
prefix: "/catalog-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
cluster: ordering cluster: ordering
- match: - match:
prefix: "/api/v1/b/"
prefix: "/order-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/b/"
route:
prefix_rewrite: "/basket-api/"
cluster: basket cluster: basket
- match:
prefix: "/basket-api/"
route:
cluster: basket
- match: - match:
prefix: "/" prefix: "/"
route: route:


+ 6
- 2
src/ApiGateways/Envoy/config/webmarketing/envoy.yaml View File

@ -24,9 +24,13 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/m/"
prefix: "/m/"
route:
prefix_rewrite: "/marketing-api/"
cluster: marketing
- match:
prefix: "/marketing-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: marketing cluster: marketing
http_filters: http_filters:
- name: envoy.router - name: envoy.router


+ 18
- 6
src/ApiGateways/Envoy/config/webshopping/envoy.yaml View File

@ -24,20 +24,32 @@ static_resources:
- "*" - "*"
routes: routes:
- match: - match:
prefix: "/api/v1/c/"
prefix: "/c/"
route: route:
prefix_rewrite: "/api/v1/"
prefix_rewrite: "/catalog-api/"
cluster: catalog cluster: catalog
- match: - match:
prefix: "/api/v1/o/"
prefix: "/catalog-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/o/"
route:
prefix_rewrite: "/order-api/"
cluster: ordering cluster: ordering
- match: - match:
prefix: "/api/v1/b/"
prefix: "/order-api/"
route: route:
prefix_rewrite: "/api/v1/"
cluster: catalog
- match:
prefix: "/b/"
route:
prefix_rewrite: "/basket-api/"
cluster: basket cluster: basket
- match:
prefix: "/basket-api/"
route:
cluster: basket
- match: - match:
prefix: "/" prefix: "/"
route: route:


+ 1
- 6
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs View File

@ -66,14 +66,9 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseCors("CorsPolicy"); app.UseCors("CorsPolicy");
app.UseHttpsRedirection();
app.UseSwagger().UseSwaggerUI(c => app.UseSwagger().UseSwaggerUI(c =>
{ {


+ 1
- 5
src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs View File

@ -67,11 +67,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseCors("CorsPolicy"); app.UseCors("CorsPolicy");
app.UseHttpsRedirection(); app.UseHttpsRedirection();


+ 1
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketService.cs View File

@ -12,7 +12,7 @@ namespace eShopOnContainers.Core.Services.Basket
private readonly IRequestProvider _requestProvider; private readonly IRequestProvider _requestProvider;
private readonly IFixUriService _fixUriService; private readonly IFixUriService _fixUriService;
private const string ApiUrlBase = "api/v1/b/basket";
private const string ApiUrlBase = "b/api/v1/basket";
public BasketService(IRequestProvider requestProvider, IFixUriService fixUriService) public BasketService(IRequestProvider requestProvider, IFixUriService fixUriService)
{ {


+ 1
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs View File

@ -15,7 +15,7 @@ namespace eShopOnContainers.Core.Services.Catalog
private readonly IRequestProvider _requestProvider; private readonly IRequestProvider _requestProvider;
private readonly IFixUriService _fixUriService; private readonly IFixUriService _fixUriService;
private const string ApiUrlBase = "api/v1/c/catalog";
private const string ApiUrlBase = "c/api/v1/catalog";
public CatalogService(IRequestProvider requestProvider, IFixUriService fixUriService) public CatalogService(IRequestProvider requestProvider, IFixUriService fixUriService)
{ {


+ 1
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignService.cs View File

@ -14,7 +14,7 @@ namespace eShopOnContainers.Core.Services.Marketing
private readonly IRequestProvider _requestProvider; private readonly IRequestProvider _requestProvider;
private readonly IFixUriService _fixUriService; private readonly IFixUriService _fixUriService;
private const string ApiUrlBase = "api/v1/m/campaigns";
private const string ApiUrlBase = "m/api/v1/campaigns";
public CampaignService(IRequestProvider requestProvider, IFixUriService fixUriService) public CampaignService(IRequestProvider requestProvider, IFixUriService fixUriService)
{ {


+ 1
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderService.cs View File

@ -12,7 +12,7 @@ namespace eShopOnContainers.Core.Services.Order
{ {
private readonly IRequestProvider _requestProvider; private readonly IRequestProvider _requestProvider;
private const string ApiUrlBase = "api/v1/o/orders";
private const string ApiUrlBase = "o/api/v1/orders";
public OrderService(IRequestProvider requestProvider) public OrderService(IRequestProvider requestProvider)
{ {


+ 0
- 1
src/Services/Identity/Identity.API/Startup.cs View File

@ -153,7 +153,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
app.UseForwardedHeaders(); app.UseForwardedHeaders();
// Adds IdentityServer // Adds IdentityServer
app.UseIdentityServer(); app.UseIdentityServer();
app.UseHttpsRedirection();
app.UseRouting(); app.UseRouting();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
{ {


+ 1
- 1
src/Web/WebMVC/Services/BasketService.cs View File

@ -27,7 +27,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
_settings = settings; _settings = settings;
_logger =logger; _logger =logger;
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/api/v1/b/basket";
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/b/api/v1/basket";
_purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1"; _purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1";
} }


+ 1
- 1
src/Web/WebMVC/Services/CampaignService.cs View File

@ -21,7 +21,7 @@
_httpClient = httpClient; _httpClient = httpClient;
_logger = logger; _logger = logger;
_remoteServiceBaseUrl = $"{_settings.Value.MarketingUrl}/api/v1/m/campaigns/";
_remoteServiceBaseUrl = $"{_settings.Value.MarketingUrl}/m/api/v1/campaigns/";
} }
public async Task<Campaign> GetCampaigns(int pageSize, int pageIndex) public async Task<Campaign> GetCampaigns(int pageSize, int pageIndex)


+ 1
- 1
src/Web/WebMVC/Services/CatalogService.cs View File

@ -25,7 +25,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
_settings = settings; _settings = settings;
_logger = logger; _logger = logger;
_remoteServiceBaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1/c/catalog/";
_remoteServiceBaseUrl = $"{_settings.Value.PurchaseUrl}/c/api/v1/catalog/";
} }
public async Task<Catalog> GetCatalogItems(int page, int take, int? brand, int? type) public async Task<Catalog> GetCatalogItems(int page, int take, int? brand, int? type)


+ 1
- 1
src/Web/WebMVC/Services/OrderingService.cs View File

@ -22,7 +22,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
_httpClient = httpClient; _httpClient = httpClient;
_settings = settings; _settings = settings;
_remoteServiceBaseUrl = $"{settings.Value.PurchaseUrl}/api/v1/o/orders";
_remoteServiceBaseUrl = $"{settings.Value.PurchaseUrl}/o/api/v1/orders";
} }
async public Task<Order> GetOrder(ApplicationUser user, string id) async public Task<Order> GetOrder(ApplicationUser user, string id)


+ 4
- 3
src/Web/WebMVC/Startup.cs View File

@ -14,6 +14,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Logging;
using Polly; using Polly;
using Polly.Extensions.Http; using Polly.Extensions.Http;
using StackExchange.Redis; using StackExchange.Redis;
@ -46,7 +47,9 @@ namespace Microsoft.eShopOnContainers.WebMVC
.AddDevspaces() .AddDevspaces()
.AddHttpClientServices(Configuration); .AddHttpClientServices(Configuration);
//.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config //.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
services.AddControllers(); services.AddControllers();
services.AddCustomAuthentication(Configuration); services.AddCustomAuthentication(Configuration);
@ -66,7 +69,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
else else
{ {
app.UseExceptionHandler("/Error"); app.UseExceptionHandler("/Error");
app.UseHsts();
} }
var pathBase = Configuration["PATH_BASE"]; var pathBase = Configuration["PATH_BASE"];
@ -87,7 +89,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
WebContextSeed.Seed(app, env, loggerFactory); WebContextSeed.Seed(app, env, loggerFactory);
app.UseHttpsRedirection();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();


+ 2
- 2
src/Web/WebSPA/Client/modules/basket/basket.service.ts View File

@ -68,7 +68,7 @@ export class BasketService {
} }
setBasketCheckout(basketCheckout): Observable<boolean> { setBasketCheckout(basketCheckout): Observable<boolean> {
let url = this.basketUrl + '/api/v1/b/basket/checkout';
let url = this.basketUrl + '/b/api/v1/basket/checkout';
return this.service.postWithId(url, basketCheckout).pipe(map((response: any) => { return this.service.postWithId(url, basketCheckout).pipe(map((response: any) => {
this.basketEvents.orderCreated(); this.basketEvents.orderCreated();
return true; return true;
@ -76,7 +76,7 @@ export class BasketService {
} }
getBasket(): Observable<IBasket> { getBasket(): Observable<IBasket> {
let url = this.basketUrl + '/api/v1/b/basket/' + this.basket.buyerId;
let url = this.basketUrl + '/b/api/v1/basket/' + this.basket.buyerId;
return this.service.get(url).pipe(map((response: any) => { return this.service.get(url).pipe(map((response: any) => {
if (response.status === 204) { if (response.status === 204) {
return null; return null;


+ 2
- 2
src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts View File

@ -29,7 +29,7 @@ export class CampaignsService {
} }
getCampaigns(pageIndex: number, pageSize: number): Observable<ICampaign> { getCampaigns(pageIndex: number, pageSize: number): Observable<ICampaign> {
let url = this.marketingUrl + '/api/v1/m/campaigns/user';
let url = this.marketingUrl + '/m/api/v1/campaigns/user';
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize; url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
return this.service.get(url).pipe(map((response: any) => { return this.service.get(url).pipe(map((response: any) => {
@ -38,7 +38,7 @@ export class CampaignsService {
} }
getCampaign(id: number): Observable<ICampaignItem> { getCampaign(id: number): Observable<ICampaignItem> {
let url = this.marketingUrl + '/api/v1/m/campaigns/' + id;
let url = this.marketingUrl + '/m/api/v1/campaigns/' + id;
return this.service.get(url).pipe(map((response: any) => { return this.service.get(url).pipe(map((response: any) => {
return response; return response;


+ 3
- 3
src/Web/WebSPA/Client/modules/catalog/catalog.service.ts View File

@ -18,9 +18,9 @@ export class CatalogService {
constructor(private service: DataService, private configurationService: ConfigurationService) { constructor(private service: DataService, private configurationService: ConfigurationService) {
this.configurationService.settingsLoaded$.subscribe(x => { this.configurationService.settingsLoaded$.subscribe(x => {
this.catalogUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/items';
this.brandUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/catalogbrands';
this.typesUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/catalogtypes';
this.catalogUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/items';
this.brandUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/catalogbrands';
this.typesUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/catalogtypes';
}); });
} }


+ 2
- 2
src/Web/WebSPA/Client/modules/orders/orders.service.ts View File

@ -25,7 +25,7 @@ export class OrdersService {
} }
getOrders(): Observable<IOrder[]> { getOrders(): Observable<IOrder[]> {
let url = this.ordersUrl + '/api/v1/o/orders';
let url = this.ordersUrl + '/o/api/v1/orders';
return this.service.get(url).pipe(map((response: any) => { return this.service.get(url).pipe(map((response: any) => {
return response; return response;
@ -33,7 +33,7 @@ export class OrdersService {
} }
getOrder(id: number): Observable<IOrderDetail> { getOrder(id: number): Observable<IOrderDetail> {
let url = this.ordersUrl + '/api/v1/o/orders/' + id;
let url = this.ordersUrl + '/o/api/v1/orders/' + id;
return this.service.get(url).pipe(map((response: any) => { return this.service.get(url).pipe(map((response: any) => {
return response; return response;


+ 1
- 5
src/Web/WebSPA/Startup.cs View File

@ -69,11 +69,7 @@ namespace eShopConContainers.WebSPA
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page // Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page
// load and passed back token on every subsequent async request // load and passed back token on every subsequent async request
// app.Use(async (context, next) => // app.Use(async (context, next) =>


+ 0
- 3
src/Web/WebStatus/Startup.cs View File

@ -47,8 +47,6 @@ namespace WebStatus
else else
{ {
app.UseExceptionHandler("/Home/Error"); app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
} }
var pathBase = Configuration["PATH_BASE"]; var pathBase = Configuration["PATH_BASE"];
@ -65,7 +63,6 @@ namespace WebStatus
app.UseStaticFiles(); app.UseStaticFiles();
app.UseHttpsRedirection();
app.UseRouting(); app.UseRouting();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
{ {


+ 2
- 2
src/docker-compose-tests.override.yml View File

@ -90,7 +90,7 @@ services:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80 - ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
@ -114,7 +114,7 @@ services:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80 - ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}


+ 1
- 1
src/docker-compose.override.yml View File

@ -78,7 +78,7 @@ services:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word} - ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110.
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110.
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq} - EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME} - EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD} - EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}


Loading…
Cancel
Save