Halil İbrahim Kalkan 5 years ago
parent
commit
eb367f9f5b
  1. 22
      apps/angular/package.json
  2. 200
      apps/angular/yarn.lock
  3. 22
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj
  4. 312
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs
  5. 60
      apps/auth-server/src/EShopOnAbp.AuthServer/Program.cs
  6. 19
      apps/auth-server/src/EShopOnAbp.AuthServer/Startup.cs
  7. 4
      apps/auth-server/src/EShopOnAbp.AuthServer/package.json
  8. 282
      apps/auth-server/src/EShopOnAbp.AuthServer/yarn.lock
  9. 20
      apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj
  10. 298
      apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs
  11. 64
      apps/public-web/src/EShopOnAbp.PublicWeb/Program.cs
  12. 25
      apps/public-web/src/EShopOnAbp.PublicWeb/Startup.cs
  13. 4
      apps/public-web/src/EShopOnAbp.PublicWeb/package.json
  14. 10
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/jquery/abp.jquery.js
  15. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/utils/abp-utils.umd.js.map
  16. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map
  17. 262
      apps/public-web/src/EShopOnAbp.PublicWeb/yarn.lock
  18. 135
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs
  19. 60
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/Program.cs
  20. 18
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/Startup.cs
  21. 1
      gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj
  22. 165
      gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs
  23. 60
      gateways/web/src/EShopOnAbp.WebGateway/Program.cs
  24. 19
      gateways/web/src/EShopOnAbp.WebGateway/Startup.cs
  25. 6
      services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj
  26. 6
      services/administration/src/EShopOnAbp.AdministrationService.Application/EShopOnAbp.AdministrationService.Application.csproj
  27. 8
      services/administration/src/EShopOnAbp.AdministrationService.Domain.Shared/EShopOnAbp.AdministrationService.Domain.Shared.csproj
  28. 12
      services/administration/src/EShopOnAbp.AdministrationService.Domain/EShopOnAbp.AdministrationService.Domain.csproj
  29. 12
      services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EShopOnAbp.AdministrationService.EntityFrameworkCore.csproj
  30. 6
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Client/EShopOnAbp.AdministrationService.HttpApi.Client.csproj
  31. 168
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs
  32. 8
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj
  33. 61
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Program.cs
  34. 18
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Startup.cs
  35. 6
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi/EShopOnAbp.AdministrationService.HttpApi.csproj
  36. 2
      services/administration/test/EShopOnAbp.AdministrationService.EntityFrameworkCore.Tests/EShopOnAbp.AdministrationService.EntityFrameworkCore.Tests.csproj
  37. 6
      services/administration/test/EShopOnAbp.AdministrationService.TestBase/EShopOnAbp.AdministrationService.TestBase.csproj
  38. 4
      services/basket/src/EShopOnAbp.BasketService.Application.Contracts/EShopOnAbp.BasketService.Application.Contracts.csproj
  39. 4
      services/basket/src/EShopOnAbp.BasketService.Application/EShopOnAbp.BasketService.Application.csproj
  40. 2
      services/basket/src/EShopOnAbp.BasketService.Domain.Shared/EShopOnAbp.BasketService.Domain.Shared.csproj
  41. 4
      services/basket/src/EShopOnAbp.BasketService.Domain/EShopOnAbp.BasketService.Domain.csproj
  42. 2
      services/basket/src/EShopOnAbp.BasketService.HttpApi.Client/EShopOnAbp.BasketService.HttpApi.Client.csproj
  43. 156
      services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/BasketServiceHttpApiHostModule.cs
  44. 75
      services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Program.cs
  45. 20
      services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Startup.cs
  46. 2
      services/basket/src/EShopOnAbp.BasketService.HttpApi/EShopOnAbp.BasketService.HttpApi.csproj
  47. 2
      services/basket/test/EShopOnAbp.BasketService.EntityFrameworkCore.Tests/EShopOnAbp.BasketService.EntityFrameworkCore.Tests.csproj
  48. 2
      services/basket/test/EShopOnAbp.BasketService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.BasketService.HttpApi.Client.ConsoleTestApp.csproj
  49. 6
      services/basket/test/EShopOnAbp.BasketService.TestBase/EShopOnAbp.BasketService.TestBase.csproj
  50. 4
      services/catalog/src/EShopOnAbp.CatalogService.Application.Contracts/EShopOnAbp.CatalogService.Application.Contracts.csproj
  51. 2
      services/catalog/src/EShopOnAbp.CatalogService.Application/EShopOnAbp.CatalogService.Application.csproj
  52. 2
      services/catalog/src/EShopOnAbp.CatalogService.Domain.Shared/EShopOnAbp.CatalogService.Domain.Shared.csproj
  53. 4
      services/catalog/src/EShopOnAbp.CatalogService.Domain/EShopOnAbp.CatalogService.Domain.csproj
  54. 2
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Client/EShopOnAbp.CatalogService.HttpApi.Client.csproj
  55. 182
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs
  56. 75
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Program.cs
  57. 20
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Startup.cs
  58. 2
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi/EShopOnAbp.CatalogService.HttpApi.csproj
  59. 2
      services/catalog/src/EShopOnAbp.CatalogService.MongoDB/EShopOnAbp.CatalogService.MongoDB.csproj
  60. 2
      services/catalog/test/EShopOnAbp.CatalogService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.CatalogService.HttpApi.Client.ConsoleTestApp.csproj
  61. 8
      services/catalog/test/EShopOnAbp.CatalogService.TestBase/EShopOnAbp.CatalogService.TestBase.csproj
  62. 2
      services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/EShopOnAbp.IdentityService.Application.Contracts.csproj
  63. 2
      services/identity/src/EShopOnAbp.IdentityService.Application/EShopOnAbp.IdentityService.Application.csproj
  64. 4
      services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/EShopOnAbp.IdentityService.Domain.Shared.csproj
  65. 4
      services/identity/src/EShopOnAbp.IdentityService.Domain/EShopOnAbp.IdentityService.Domain.csproj
  66. 6
      services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EShopOnAbp.IdentityService.EntityFrameworkCore.csproj
  67. 2
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/EShopOnAbp.IdentityService.HttpApi.Client.csproj
  68. 2
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj
  69. 155
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs
  70. 61
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Program.cs
  71. 18
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Startup.cs
  72. 2
      services/identity/src/EShopOnAbp.IdentityService.HttpApi/EShopOnAbp.IdentityService.HttpApi.csproj
  73. 2
      services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj
  74. 6
      services/identity/test/EShopOnAbp.IdentityService.TestBase/EShopOnAbp.IdentityService.TestBase.csproj
  75. 4
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/EShopOnAbp.OrderingService.Application.Contracts.csproj
  76. 4
      services/ordering/src/EShopOnAbp.OrderingService.Application/EShopOnAbp.OrderingService.Application.csproj
  77. 4
      services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/EShopOnAbp.OrderingService.Domain.Shared.csproj
  78. 2
      services/ordering/src/EShopOnAbp.OrderingService.Domain/EShopOnAbp.OrderingService.Domain.csproj
  79. 2
      services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EShopOnAbp.OrderingService.EntityFrameworkCore.csproj
  80. 2
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj
  81. 4
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj
  82. 172
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs
  83. 75
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Program.cs
  84. 20
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Startup.cs
  85. 2
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi/EShopOnAbp.OrderingService.HttpApi.csproj
  86. 2
      services/ordering/test/EShopOnAbp.OrderingService.EntityFrameworkCore.Tests/EShopOnAbp.OrderingService.EntityFrameworkCore.Tests.csproj
  87. 2
      services/ordering/test/EShopOnAbp.OrderingService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.OrderingService.HttpApi.Client.ConsoleTestApp.csproj
  88. 6
      services/ordering/test/EShopOnAbp.OrderingService.TestBase/EShopOnAbp.OrderingService.TestBase.csproj
  89. 4
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/EShopOnAbp.PaymentService.Application.Contracts.csproj
  90. 4
      services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj
  91. 2
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/EShopOnAbp.PaymentService.Domain.Shared.csproj
  92. 2
      services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj
  93. 2
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EShopOnAbp.PaymentService.EntityFrameworkCore.csproj
  94. 2
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/EShopOnAbp.PaymentService.HttpApi.Client.csproj
  95. 161
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs
  96. 75
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Program.cs
  97. 21
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Startup.cs
  98. 2
      services/payment/src/EShopOnAbp.PaymentService.HttpApi/EShopOnAbp.PaymentService.HttpApi.csproj
  99. 2
      services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj
  100. 2
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp.csproj

22
apps/angular/package.json

@ -12,15 +12,15 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@abp/ng.account": "5.0.1", "@abp/ng.account": "~5.1.2",
"@abp/ng.components": "5.0.1", "@abp/ng.components": "~5.1.2",
"@abp/ng.core": "5.0.1", "@abp/ng.core": "~5.1.2",
"@abp/ng.identity": "5.0.1", "@abp/ng.identity": "~5.1.2",
"@abp/ng.setting-management": "5.0.1", "@abp/ng.setting-management": "~5.1.2",
"@abp/ng.tenant-management": "5.0.1", "@abp/ng.tenant-management": "~5.1.2",
"@abp/ng.theme.basic": "5.0.1", "@abp/ng.theme.basic": "~5.1.2",
"@abp/ng.theme.lepton-x": "^1.0.0-alpha.2", "@abp/ng.theme.lepton-x": "~1.0.0-alpha.2",
"@abp/ng.theme.shared": "5.0.1", "@abp/ng.theme.shared": "~5.1.2",
"@angular/animations": "~12.2.8", "@angular/animations": "~12.2.8",
"@angular/common": "~12.2.8", "@angular/common": "~12.2.8",
"@angular/compiler": "~12.2.8", "@angular/compiler": "~12.2.8",
@ -35,7 +35,7 @@
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@abp/ng.schematics": "5.0.1", "@abp/ng.schematics": "~5.1.2",
"@angular-devkit/build-angular": "~12.2.8", "@angular-devkit/build-angular": "~12.2.8",
"@angular/cli": "~12.2.8", "@angular/cli": "~12.2.8",
"@angular/compiler-cli": "~12.2.8", "@angular/compiler-cli": "~12.2.8",
@ -57,4 +57,4 @@
"tslint": "~6.1.0", "tslint": "~6.1.0",
"typescript": "~4.3.5" "typescript": "~4.3.5"
} }
} }

200
apps/angular/yarn.lock

@ -2,72 +2,72 @@
# yarn lockfile v1 # yarn lockfile v1
"@abp/ng.account.core@~5.0.1": "@abp/ng.account.core@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.account.core/-/ng.account.core-5.0.1.tgz#ec29ad71cf88c9ac5975e7911e4263efc002d27d" resolved "https://registry.yarnpkg.com/@abp/ng.account.core/-/ng.account.core-5.1.2.tgz#857e5f28efb9eeed62971e0ce499e811aa3d2fa5"
integrity sha512-h6E8FWE3qJzDObYYtrWEjAqGaoKRhmOERATdndqBElCKWc88BAoO+tCJ67fdi9EGcSyLeYnX2y3fR5QBrThe+g== integrity sha512-Qrtk9AfxriSzHm9tnFfn5IAD/bWkB8VUyRmgtCqoiPQxHSkcOFTkhisSBD7eGOWvReDFfyi1DfRBgeD0nF8feQ==
dependencies: dependencies:
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.account@5.0.1": "@abp/ng.account@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.account/-/ng.account-5.0.1.tgz#aa428813454dd065edc97be0080ef04c403f2720" resolved "https://registry.yarnpkg.com/@abp/ng.account/-/ng.account-5.1.2.tgz#298912e8f84654f4e2e611dbf14c44d65b63020b"
integrity sha512-VeT2zJjB07gFh/wionYiwRbAY+H1ZHf4ueC0xJLP6oADxRf7IZHxFcujsmpv0eB66Zyy3DZ9j6gkx3Kva5B+Rg== integrity sha512-M/G2JJ0LnSitOJOA8iWz5dtzbBw0/PvriRZqRTIg9z55LE3JN29F5y3gEYP4qA+/vEG6a9nDfZISriyFKbhedA==
dependencies: dependencies:
"@abp/ng.account.core" "~5.0.1" "@abp/ng.account.core" "~5.1.2"
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.components@5.0.1", "@abp/ng.components@~5.0.1": "@abp/ng.components@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.components/-/ng.components-5.0.1.tgz#9cd10f91d4da45eb435109fe3c75619f866aad63" resolved "https://registry.yarnpkg.com/@abp/ng.components/-/ng.components-5.1.2.tgz#0f26b184226bd08ab06b3f4ce93b1d5b8b954ec4"
integrity sha512-SZR5+dlWydVJw27un+WFGb1Hnis3Dg+1hZXfHmIuAyX/Mr7l0X0JKKVxfWR+4u/A83xjBxYD4Zo6OaXpEn6cCg== integrity sha512-kyAz1tj3uwOXZECnPoX7AiVRvAmz7eFQEKc/OF0lqGVTqqClpVsI58NVjI/Ieom86NK7rclHJokxt9js9q5u0w==
dependencies: dependencies:
chart.js "^3.5.1" chart.js "^3.5.1"
ng-zorro-antd "^12.0.1" ng-zorro-antd "^13.0.0"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.core@5.0.1", "@abp/ng.core@~5.0.1": "@abp/ng.core@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-5.0.1.tgz#f507075dde476bb32d6b37792bce36443dd2fb83" resolved "https://registry.yarnpkg.com/@abp/ng.core/-/ng.core-5.1.2.tgz#c5602bdbac845370765ef2e27b0b45af46f2e141"
integrity sha512-Ta7SqOrrGXeXPM4N2bJuhK9awTHaYSsfE3GTCtOvBn11P/GxfsaUKJ7XFvAd1D/5+3BjF9+LF4EiWYZn1UaWUw== integrity sha512-HOupzvooN2D3oaymnPnAaTKqwwJpzHq8HPQwrXDNBBdm7CjB+KmlKJfigwPBFVwpdsUPb35u8xcHu6+n6VVGaA==
dependencies: dependencies:
"@abp/utils" "~5.0.1" "@abp/utils" "~5.1.10"
angular-oauth2-oidc "^12.1.0" angular-oauth2-oidc "^13.0.1"
just-clone "^3.2.1" just-clone "^3.2.1"
just-compare "^1.4.0" just-compare "^1.4.0"
ts-toolbelt "6.15.4" ts-toolbelt "6.15.4"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.feature-management@~5.0.1": "@abp/ng.feature-management@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-5.0.1.tgz#2cbc54f7ca209cc9397394eebabf69a9e5380613" resolved "https://registry.yarnpkg.com/@abp/ng.feature-management/-/ng.feature-management-5.1.2.tgz#3d5adabe3904e58b680533a85fdf206a181648da"
integrity sha512-evoX1hmFHdKWCW/H409KmXtcg2B9HKXgZTez9/yXV5+eluVm9HY/U/gtTmgMG3vMAfqAJMXQdOEeG/vo5JozsQ== integrity sha512-OYYD5mv3eJJSb3DvJzXQlU6h2AN3GAEygdHY0wjFrmbOtBKxA02UbtRl5hh7p+VqwdFgVinkE1M+/nB1TBUD2A==
dependencies: dependencies:
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.identity@5.0.1": "@abp/ng.identity@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-5.0.1.tgz#71e25af3c5fa1f00967b98ec983d013291d76adc" resolved "https://registry.yarnpkg.com/@abp/ng.identity/-/ng.identity-5.1.2.tgz#7a7d15cd4d9414f3d447477466838a11eddaad8b"
integrity sha512-AzrGyl88fX+qlZ3DiXqfxG5i4N4Yy6HTiOs6TFNwtEFfNICKXWWOAv6q6w8U50P35WpAytwyTnz9oYeAozn8cg== integrity sha512-ChnHtAI8RhFp1XfFkNIrK6947OFpv0TFxc2L86bDkeieBfjbf1ppXuDV2WGGo3JwyT40Wj0sr1sDt/PmE9zNFQ==
dependencies: dependencies:
"@abp/ng.permission-management" "~5.0.1" "@abp/ng.permission-management" "~5.1.2"
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.permission-management@~5.0.1": "@abp/ng.permission-management@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-5.0.1.tgz#aa712868055ec71b9367b758d899d783df7f7115" resolved "https://registry.yarnpkg.com/@abp/ng.permission-management/-/ng.permission-management-5.1.2.tgz#f3705605d1d6de63699f57e5cd14e57d166c3b2e"
integrity sha512-8ge0TIrdtshEe/hUmmcSBU8T8onKSIBRR3dAkitPJRfU/FSDVB/qM4pOTjWzgL/Rghem+9y9LTV4UXvM3fw8eQ== integrity sha512-WhrkEKu/Sge4mzE8OB6hwQNSY3IXlepB69YMBy1Z17JV3LqMUF9djya6ZIKsKv1M7F5gchQSdI1JRVTdPz/jww==
dependencies: dependencies:
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.schematics@5.0.1": "@abp/ng.schematics@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.schematics/-/ng.schematics-5.0.1.tgz#f80077c7503789738c9238f4e6f57301a648fc9d" resolved "https://registry.yarnpkg.com/@abp/ng.schematics/-/ng.schematics-5.1.2.tgz#8efcaf705f270f8c1131ab35e66d0a4aeb94c3ac"
integrity sha512-dRx1T/I+wAhb1oM+7M0qcnCPn6OPeDcm8NtTmolN8iLkCaMPUh5HkylPNnTvxLcUWXiOFqJtn2HBQn7SBD8Vnw== integrity sha512-SaPwTdHKmJqERGROpw0+8EsZEj8iJgMbqgMwQu6C8UbACxn+vM3/FhfvqwpwW1Z9Pvbp6Izor3Bl6n+kM2gdcA==
dependencies: dependencies:
"@angular-devkit/core" "~11.0.2" "@angular-devkit/core" "~11.0.2"
"@angular-devkit/schematics" "~11.0.2" "@angular-devkit/schematics" "~11.0.2"
@ -76,34 +76,34 @@
should-quote "^1.0.0" should-quote "^1.0.0"
typescript "~3.9.2" typescript "~3.9.2"
"@abp/ng.setting-management@5.0.1": "@abp/ng.setting-management@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-5.0.1.tgz#6d32ea9930ac23f56e91306872ce87ab5cc42e54" resolved "https://registry.yarnpkg.com/@abp/ng.setting-management/-/ng.setting-management-5.1.2.tgz#bb5a682fec9dc40d35ba7c0ee9723248987e5c72"
integrity sha512-5DhYj14JqT1z2IFnCL4lSOfyK3+ZdJ2y8LOJBROJ9xLnvYUfwFaVcn+V3Iz0kM8v5huWQ+EKgjIZ47qdc/tPCQ== integrity sha512-L6BfKpvdFIsWiobZ2K6xyH/ecNASMOsgOkUa8lcUzZg9HdkBsOaaIHo6+Fuj9Bv7XhrUWDOhrDMqc5YaSpC3Nw==
dependencies: dependencies:
"@abp/ng.components" "~5.0.1" "@abp/ng.components" "~5.1.2"
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.tenant-management@5.0.1": "@abp/ng.tenant-management@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-5.0.1.tgz#592da08b9376c00714bd4dd63f37e752c15de912" resolved "https://registry.yarnpkg.com/@abp/ng.tenant-management/-/ng.tenant-management-5.1.2.tgz#08a95cd5206a56441567ce964edea9a9cf65493e"
integrity sha512-8m9HuStDWZsLCv6g6vK7l9k6wvK0oamgFuZrac9DjIHsruGdpLFdEeUvqhDhsyulMyk83OUEIi1hRgEX2PdQfg== integrity sha512-F4kwxneOZ+FlQSqh9fG5k5kqLJjVAOeBLlYR9C5Xer8bjYuGg0CybcnuShcRuKtK8ACbd7P9NIqS0FIhsW2/TA==
dependencies: dependencies:
"@abp/ng.feature-management" "~5.0.1" "@abp/ng.feature-management" "~5.1.2"
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.theme.basic@5.0.1": "@abp/ng.theme.basic@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-5.0.1.tgz#87d4eec12296c6747b5d9d37781c180334e36fbb" resolved "https://registry.yarnpkg.com/@abp/ng.theme.basic/-/ng.theme.basic-5.1.2.tgz#ca4d6a6f3cbbdab5a90c20b4d7ffb2e2ffdf89d2"
integrity sha512-kzgc2plB9xPTFye8CVlALzCNL/UAAd+jVhl5wz1meau2l7vvnW5sCI6P64y9gpKipQYMSpRhbYYQSBi4JJGNeA== integrity sha512-zEX1mq5g2W60V5mBc1jliK3lEYWFhzL2gp8kUEzEMq9GowtxaqBRL82oGSu453d8ji6IDZqnQok7pY8jGkgESQ==
dependencies: dependencies:
"@abp/ng.account.core" "~5.0.1" "@abp/ng.account.core" "~5.1.2"
"@abp/ng.theme.shared" "~5.0.1" "@abp/ng.theme.shared" "~5.1.2"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/ng.theme.lepton-x@^1.0.0-alpha.2": "@abp/ng.theme.lepton-x@~1.0.0-alpha.2":
version "1.0.0-alpha.2" version "1.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.lepton-x/-/ng.theme.lepton-x-1.0.0-alpha.2.tgz#8422837050b4611cf3118920c23503fe063fa8c5" resolved "https://registry.yarnpkg.com/@abp/ng.theme.lepton-x/-/ng.theme.lepton-x-1.0.0-alpha.2.tgz#8422837050b4611cf3118920c23503fe063fa8c5"
integrity sha512-ayjb5AXbsk6Y9ScH2eKIjOISrX2cHlK3XMWGeF0taiXuHqtcSxR6taQfkzJdV0YS5DtaDDeVa4U8fSCHFXaAMQ== integrity sha512-ayjb5AXbsk6Y9ScH2eKIjOISrX2cHlK3XMWGeF0taiXuHqtcSxR6taQfkzJdV0YS5DtaDDeVa4U8fSCHFXaAMQ==
@ -111,23 +111,24 @@
"@volo/ngx-lepton-x.lite" "1.0.0-alpha.2" "@volo/ngx-lepton-x.lite" "1.0.0-alpha.2"
tslib "^2.1.0" tslib "^2.1.0"
"@abp/ng.theme.shared@5.0.1", "@abp/ng.theme.shared@~5.0.1": "@abp/ng.theme.shared@~5.1.2":
version "5.0.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-5.0.1.tgz#866e7733619c9c6bcb1d36c827369fff0e97c80b" resolved "https://registry.yarnpkg.com/@abp/ng.theme.shared/-/ng.theme.shared-5.1.2.tgz#14441a05c612c59c690ace51e3d34fe884dd260b"
integrity sha512-XT1BGJiG9sqZJJGZcCN6+WvlbRdZPRBRnc6NvzZTPXGgnnX107N2lanIShulJiVUX68chkBd4yNuM8tM/hLiOg== integrity sha512-rI2/edNcZsF18hSFZPBJbGFgFQZACpmApIp/Ta0tu7MAyJ+hzUMkL6duSZbcH2kop9sXLsdCXRXV/bqMp7awqA==
dependencies: dependencies:
"@abp/ng.core" "~5.0.1" "@abp/ng.core" "~5.1.2"
"@fortawesome/fontawesome-free" "^5.15.4" "@fortawesome/fontawesome-free" "^5.15.4"
"@ng-bootstrap/ng-bootstrap" "11.0.0-beta.2" "@ng-bootstrap/ng-bootstrap" "~12.0.0-beta.4"
"@ngx-validate/core" "^0.1.1" "@ngx-validate/core" "^0.1.1"
"@popperjs/core" "~2.11.2"
"@swimlane/ngx-datatable" "^19.0.0" "@swimlane/ngx-datatable" "^19.0.0"
bootstrap "^5.1.1" bootstrap "^5.1.1"
tslib "^2.0.0" tslib "^2.0.0"
"@abp/utils@~5.0.1": "@abp/utils@~5.1.10":
version "5.0.1" version "5.1.10"
resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.0.1.tgz#57934383004a21172bf7e08130813c08946894fb" resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.1.10.tgz#4512d09d374503c33872b7f68d8d3bc9c00f7ad9"
integrity sha512-WLCWe7iJ8krxsz8Z7E+8GDaGZuG/6PZDdqPcMIh95opi0kvcLxb+mjPXXpiXdtFzW7O09a+NaNOxorsEFxjoKw== integrity sha512-M6cTrx9vneyo4xNcHhMdtabajRWORs720zqaAnaIRfQP5YW60bEZZcUW0GgDTjLJ7Bb0A08A6yt4+OHoJTmpgQ==
dependencies: dependencies:
just-compare "^1.3.0" just-compare "^1.3.0"
@ -289,12 +290,12 @@
dependencies: dependencies:
tslib "^2.2.0" tslib "^2.2.0"
"@angular/cdk@^12.1.0": "@angular/cdk@^13.0.1":
version "12.2.13" version "13.1.3"
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-12.2.13.tgz#1fdbe814adfd6b4ff906c6d9c4c6df07b83f09d8" resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-13.1.3.tgz#a32306cd977fe59ded2dcc799ef844c0972232d3"
integrity sha512-zSKRhECyFqhingIeyRInIyTvYErt4gWo+x5DQr0b7YLUbU8DZSwWnG4w76Ke2s4U8T7ry1jpJBHoX/e8YBpGMg== integrity sha512-Psuri2mc6W+xKtZr39FHL+cDz7Le9kKTo8ziCtUiydikBBdqfOu6AnWUrEMEGFxS2wt8nolFXDAGUaMUAE3Ekg==
dependencies: dependencies:
tslib "^2.2.0" tslib "^2.3.0"
optionalDependencies: optionalDependencies:
parse5 "^5.0.0" parse5 "^5.0.0"
@ -423,10 +424,10 @@
dependencies: dependencies:
"@ctrl/tinycolor" "^3.3.1" "@ctrl/tinycolor" "^3.3.1"
"@ant-design/icons-angular@^12.0.3": "@ant-design/icons-angular@^13.0.1":
version "12.0.3" version "13.0.2"
resolved "https://registry.yarnpkg.com/@ant-design/icons-angular/-/icons-angular-12.0.3.tgz#3e99aa99ceebb978384a2926d06da19c043fc4bd" resolved "https://registry.yarnpkg.com/@ant-design/icons-angular/-/icons-angular-13.0.2.tgz#9bb74ea93b566fc54c28061afd325ddd6da6ce38"
integrity sha512-Jl/O7fQiFGsFHuesOp7Oo/TKTPSlWAqMa2DBQdgQbNzv2c3v1ijQWd54ymDC6ftIHMsKD30nJ6bekCiqdbfZuA== integrity sha512-5ub/tVR9Y1xAMeYzrfavL+Cma6SjpMYaKOn7Aa02P9vDEHIAwJHsgB2NbO+hlwyHmGX5MeCCVymrVf9US3W2iQ==
dependencies: dependencies:
"@ant-design/colors" "^5.0.0" "@ant-design/colors" "^5.0.0"
tslib "^2.0.0" tslib "^2.0.0"
@ -1464,12 +1465,12 @@
merge-source-map "^1.1.0" merge-source-map "^1.1.0"
schema-utils "^2.7.0" schema-utils "^2.7.0"
"@ng-bootstrap/ng-bootstrap@11.0.0-beta.2": "@ng-bootstrap/ng-bootstrap@~12.0.0-beta.4":
version "11.0.0-beta.2" version "12.0.0-beta.4"
resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-11.0.0-beta.2.tgz#4d0c1f23a050e2e07ea22cc0c017e0b3685cdbf9" resolved "https://registry.yarnpkg.com/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-12.0.0-beta.4.tgz#e27fb7b6672612c05bd40f1eec7f22e4396c4a11"
integrity sha512-H6Kdzw4DBsUIrlvoxEJHCValSTHq0XcsiTVNbb99PjgD6ZhkBjINenT0W62A91k0nQEQBZCjhGGv+aNU/XxQNg== integrity sha512-iOXZT4FLouAGJDRw4ruogyR+lg648nywNWKUxW7l+mtMC9i4kdpfo4beQ/nqb4Uq2zMDs9zj4MbKVI391+kMnA==
dependencies: dependencies:
tslib "^2.1.0" tslib "^2.3.0"
"@ngtools/webpack@12.2.14": "@ngtools/webpack@12.2.14":
version "12.2.14" version "12.2.14"
@ -1564,6 +1565,11 @@
node-gyp "^8.2.0" node-gyp "^8.2.0"
read-package-json-fast "^2.0.1" read-package-json-fast "^2.0.1"
"@popperjs/core@~2.11.2":
version "2.11.2"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.2.tgz#830beaec4b4091a9e9398ac50f865ddea52186b9"
integrity sha512-92FRmppjjqz29VMJ2dn+xdyXZBrMlE42AV6Kq6BwjWV7CNUW1hs2FtxSNLQE+gJhaZ6AAmYuO9y8dshhcBl7vA==
"@rollup/plugin-commonjs@^20.0.0": "@rollup/plugin-commonjs@^20.0.0":
version "20.0.0" version "20.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz#3246872dcbcb18a54aaa6277a8c7d7f1b155b745" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz#3246872dcbcb18a54aaa6277a8c7d7f1b155b745"
@ -2071,10 +2077,10 @@ alphanum-sort@^1.0.2:
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=
angular-oauth2-oidc@^12.1.0: angular-oauth2-oidc@^13.0.1:
version "12.1.0" version "13.0.1"
resolved "https://registry.yarnpkg.com/angular-oauth2-oidc/-/angular-oauth2-oidc-12.1.0.tgz#d15b40e52c149187303d4511dd0e4d9661281fc6" resolved "https://registry.yarnpkg.com/angular-oauth2-oidc/-/angular-oauth2-oidc-13.0.1.tgz#81a001b19452d19b1972035d742b777d75ef34fa"
integrity sha512-YUsNTWx8lccgo4e3qHvqJ6DOR9nfPVd+riyXzcy5nI4CB9cc2+SxaxiqQMGPAaKI2EOIfdxNobmUqUSEO+IXxA== integrity sha512-aL1VIv9Jqoqq31lbpUXIeNpM3GeN/ldb3KOlq0cV92amGpZs9J4YA+2rlJ5V9zb6NFNbvd7XfTntMbnNuS0+CQ==
dependencies: dependencies:
fast-sha256 "^1.3.0" fast-sha256 "^1.3.0"
tslib "^2.0.0" tslib "^2.0.0"
@ -3342,7 +3348,7 @@ dashdash@^1.12.0:
dependencies: dependencies:
assert-plus "^1.0.0" assert-plus "^1.0.0"
date-fns@^2.10.0: date-fns@^2.16.1:
version "2.28.0" version "2.28.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2"
integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw== integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==
@ -6090,15 +6096,15 @@ ng-packagr@^12.2.2:
optionalDependencies: optionalDependencies:
esbuild "0.13.8" esbuild "0.13.8"
ng-zorro-antd@^12.0.1: ng-zorro-antd@^13.0.0:
version "12.1.1" version "13.0.1"
resolved "https://registry.yarnpkg.com/ng-zorro-antd/-/ng-zorro-antd-12.1.1.tgz#20e43db3b1e2b5864b845a2259a70880ac0baf8e" resolved "https://registry.yarnpkg.com/ng-zorro-antd/-/ng-zorro-antd-13.0.1.tgz#9b6a98385ff87019f6893d93d5c7e4c37adaa007"
integrity sha512-5Pc8IZS7VCH+iJNumr84PjJY+tRcVQQ/2KihmABREXuFdYTARGPUDgZJt+v6MnMU1K926ym1sSx/cHfiRq2yiA== integrity sha512-ZoxzQ+VdkiUjbYeEIAvelLZPHFVfFiNE50Mkh2sCY5W/7R06DS/nVm+RRUgoy6gcZfBrpc757rDtrjrKDnkvaQ==
dependencies: dependencies:
"@angular/cdk" "^12.1.0" "@angular/cdk" "^13.0.1"
"@ant-design/icons-angular" "^12.0.3" "@ant-design/icons-angular" "^13.0.1"
date-fns "^2.10.0" date-fns "^2.16.1"
tslib "^2.2.0" tslib "^2.3.0"
nice-napi@^1.0.2: nice-napi@^1.0.2:
version "1.0.2" version "1.0.2"

22
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj

@ -5,20 +5,20 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="5.1.2" />
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="5.1.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs.RabbitMQ" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.BackgroundJobs.RabbitMQ" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Account.HttpApi" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Account.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Account.Application" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

312
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs

@ -34,206 +34,198 @@ using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.AuthServer namespace EShopOnAbp.AuthServer;
[DependsOn(
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpBackgroundJobsRabbitMqModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountApplicationModule),
typeof(EShopOnAbpSharedHostingAspNetCoreModule),
typeof(EShopOnAbpSharedLocalizationModule),
typeof(AdministrationServiceEntityFrameworkCoreModule),
typeof(IdentityServiceEntityFrameworkCoreModule)
)]
public class EShopOnAbpAuthServerModule : AbpModule
{ {
[DependsOn( public override void PreConfigureServices(ServiceConfigurationContext context)
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpBackgroundJobsRabbitMqModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountApplicationModule),
typeof(EShopOnAbpSharedHostingAspNetCoreModule),
typeof(EShopOnAbpSharedLocalizationModule),
typeof(AdministrationServiceEntityFrameworkCoreModule),
typeof(IdentityServiceEntityFrameworkCoreModule)
)]
public class EShopOnAbpAuthServerModule : AbpModule
{ {
public override void PreConfigureServices(ServiceConfigurationContext context) var hostingEnvironment = context.Services.GetHostingEnvironment();
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
if (!hostingEnvironment.IsDevelopment())
{
var configuration = context.Services.GetConfiguration();
PreConfigure<AbpIdentityServerBuilderOptions>(options =>
{
options.AddDeveloperSigningCredential = false;
});
PreConfigure<IIdentityServerBuilder>(builder => if (!hostingEnvironment.IsDevelopment())
{
builder.AddSigningCredential(GetSigningCertificate(hostingEnvironment));
});
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{ {
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
ConfigureSwagger(context, configuration); PreConfigure<AbpIdentityServerBuilderOptions>(options =>
context.Services.AddAuthentication()
.AddJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.Audience = "AccountService";
});
Configure<IdentityServerOptions>(options =>
{ {
options.IssuerUri = configuration["App:SelfUrl"]; options.AddDeveloperSigningCredential = false;
}); });
Configure<AbpClaimsServiceOptions>(options => PreConfigure<IIdentityServerBuilder>(builder =>
{
options.RequestedClaims.AddRange(new[]{
EShopConstants.AnonymousUserClaimName
});
});
Configure<AbpAuditingOptions>(options =>
{ {
options.ApplicationName = "AuthServer"; builder.AddSigningCredential(GetSigningCertificate(hostingEnvironment));
}); });
}
}
Configure<AppUrlOptions>(options => public override void ConfigureServices(ServiceConfigurationContext context)
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
ConfigureSwagger(context, configuration);
context.Services.AddAuthentication()
.AddJwtBearer(options =>
{ {
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; options.Authority = configuration["AuthServer:Authority"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(',')); options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.Audience = "AccountService";
}); });
Configure<AbpDistributedCacheOptions>(options => Configure<IdentityServerOptions>(options => { options.IssuerUri = configuration["App:SelfUrl"]; });
Configure<AbpClaimsServiceOptions>(options =>
{
options.RequestedClaims.AddRange(new[]
{ {
options.KeyPrefix = "EShopOnAbp:"; EShopConstants.AnonymousUserClaimName
}); });
});
Configure<AbpAuditingOptions>(options => { options.ApplicationName = "AuthServer"; });
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(','));
});
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "EShopOnAbp:"; });
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys")
.SetApplicationName("eShopOnAbp-AuthServer");
context.Services.AddCors(options => var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys")
.SetApplicationName("eShopOnAbp-AuthServer");
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{ {
options.AddDefaultPolicy(builder => builder
{ .WithOrigins(
builder configuration["App:CorsOrigins"]
.WithOrigins( .Split(",", StringSplitOptions.RemoveEmptyEntries)
configuration["App:CorsOrigins"] .Select(o => o.Trim().RemovePostFix("/"))
.Split(",", StringSplitOptions.RemoveEmptyEntries) .ToArray()
.Select(o => o.Trim().RemovePostFix("/")) )
.ToArray() .WithAbpExposedHeaders()
) .SetIsOriginAllowedToAllowWildcardSubdomains()
.WithAbpExposedHeaders() .AllowAnyHeader()
.SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyMethod()
.AllowAnyHeader() .AllowCredentials();
.AllowAnyMethod()
.AllowCredentials();
});
}); });
});
#if DEBUG #if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif #endif
if (hostingEnvironment.IsDevelopment()) if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<EShopOnAbpSharedLocalizationModule>(Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}shared{Path.DirectorySeparatorChar}EShopOnAbp.Shared.Localization"));
});
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); Configure<AbpVirtualFileSystemOptions>(options =>
var env = context.GetEnvironment();
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
app.Use(async (ctx, next) =>
{ {
if (ctx.Request.Headers.ContainsKey("from-ingress")) options.FileSets.ReplaceEmbeddedByPhysical<EShopOnAbpSharedLocalizationModule>(Path.Combine(
{ hostingEnvironment.ContentRootPath,
ctx.SetIdentityServerOrigin(configuration["App:SelfUrl"]); $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}shared{Path.DirectorySeparatorChar}EShopOnAbp.Shared.Localization"));
}
await next();
}); });
}
}
if (env.IsDevelopment()) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
app.UseDeveloperExceptionPage(); var app = context.GetApplicationBuilder();
} var env = context.GetEnvironment();
app.UseAbpRequestLocalization(); var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
if (!env.IsDevelopment()) app.Use(async (ctx, next) =>
{
if (ctx.Request.Headers.ContainsKey("from-ingress"))
{ {
app.UseErrorPage(); ctx.SetIdentityServerOrigin(configuration["App:SelfUrl"]);
} }
app.UseCorrelationId(); await next();
app.UseStaticFiles(); });
app.UseRouting();
app.UseCors(); if (env.IsDevelopment())
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Account Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAuditing();
app.UseConfiguredEndpoints();
}
private X509Certificate2 GetSigningCertificate(IWebHostEnvironment hostingEnv)
{ {
const string fileName = "eshoponabp-authserver.pfx"; app.UseDeveloperExceptionPage();
const string passPhrase = "780F3C11-0A96-40DE-B335-9848BE88C77D"; }
var file = Path.Combine(hostingEnv.ContentRootPath, fileName);
if (!File.Exists(file)) app.UseAbpRequestLocalization();
{
throw new FileNotFoundException($"Signing Certificate couldn't found: {file}");
}
return new X509Certificate2(file, passPhrase); if (!env.IsDevelopment())
{
app.UseErrorPage();
} }
private void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Account Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAuditing();
app.UseConfiguredEndpoints();
}
private X509Certificate2 GetSigningCertificate(IWebHostEnvironment hostingEnv)
{
const string fileName = "eshoponabp-authserver.pfx";
const string passPhrase = "780F3C11-0A96-40DE-B335-9848BE88C77D";
var file = Path.Combine(hostingEnv.ContentRootPath, fileName);
if (!File.Exists(file))
{ {
SwaggerWithAuthConfigurationHelper.Configure( throw new FileNotFoundException($"Signing Certificate couldn't found: {file}");
context: context, }
authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> return new X509Certificate2(file, passPhrase);
}
private void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration)
{
SwaggerWithAuthConfigurationHelper.Configure(
context: context,
authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string>
{
/* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
/* Requested scopes for authorization code request and descriptions for swagger UI only */ "AccountService",
{ "Account Service API"
"AccountService",
"Account Service API"
},
}, },
apiTitle: "Account Service API" },
); apiTitle: "Account Service API"
} );
} }
} }

60
apps/auth-server/src/EShopOnAbp.AuthServer/Program.cs

@ -1,46 +1,36 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
namespace EShopOnAbp.AuthServer namespace EShopOnAbp.AuthServer;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpAuthServerModule>(args);
return 0; await app.InitializeApplicationAsync();
} await app.RunAsync();
catch (Exception ex)
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) }
.UseAutofac() finally
.UseSerilog(); {
Log.CloseAndFlush();
}
} }
} }

19
apps/auth-server/src/EShopOnAbp.AuthServer/Startup.cs

@ -1,19 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.AuthServer
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<EShopOnAbpAuthServerModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.InitializeApplication();
}
}
}

4
apps/auth-server/src/EShopOnAbp.AuthServer/package.json

@ -3,7 +3,7 @@
"name": "EShopOnAbpAuthServer", "name": "EShopOnAbpAuthServer",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.0.0-rc.1", "@abp/aspnetcore.mvc.ui.theme.basic": "~5.1.2",
"@volo/account": "~5.0.0-rc.1" "@volo/account": "~5.1.2"
} }
} }

282
apps/auth-server/src/EShopOnAbp.AuthServer/yarn.lock

@ -2,37 +2,37 @@
# yarn lockfile v1 # yarn lockfile v1
"@abp/aspnetcore.mvc.ui.theme.basic@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui.theme.basic@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.0.0-rc.1.tgz#cd575ab35b5cf9c9c2d3ab02fc6ff5fb1851a622" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.1.2.tgz#e5bf1ba670f2344a341f3335051d5e37543bd99e"
integrity sha512-/tezLoIaqMJTlV78EbyKkJY30XpayiXJg2apq6/LnSddDIDKaRdlWe1gfXBjFrkOVkdhdSPrvOIy95a284cY/Q== integrity sha512-W3m8AWhyV91EMkudNVA9toYBskhrJ+YQNAYF52LglfEtvSlpo1eSMs/lIBkV6zjB03CdAjKHW3HHCqOx5ARDOQ==
dependencies: dependencies:
"@abp/aspnetcore.mvc.ui.theme.shared" "~5.0.0-rc.1" "@abp/aspnetcore.mvc.ui.theme.shared" "~5.1.2"
"@abp/aspnetcore.mvc.ui.theme.shared@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui.theme.shared@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.0.0-rc.1.tgz#053ee1d8f69eea1559d6600d7f7b5a645968d6bf" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.1.2.tgz#dc04a0fa16af599303d805f12baeaaf196e6a407"
integrity sha512-XbCXZ8mka5RCezYR54YRiUn+SgTyVgo/2F42UJ8ZJKMHKo8nQGMFANWuuJ4qHamApEqKZZmmdWp37BnpQ7JMMw== integrity sha512-SIXBYvMcRmH9+ndGuhQB0J8eeOmxr2An1a6VbQLK/S4YBIsVrBsp/g2RfRZLERuydt6idoQaB+ly31cc9Nif9g==
dependencies: dependencies:
"@abp/aspnetcore.mvc.ui" "~5.0.0-rc.1" "@abp/aspnetcore.mvc.ui" "~5.1.2"
"@abp/bootstrap" "~5.0.0-rc.1" "@abp/bootstrap" "~5.1.2"
"@abp/bootstrap-datepicker" "~5.0.0-rc.1" "@abp/bootstrap-datepicker" "~5.1.2"
"@abp/datatables.net-bs5" "~5.0.0-rc.1" "@abp/datatables.net-bs5" "~5.1.2"
"@abp/font-awesome" "~5.0.0-rc.1" "@abp/font-awesome" "~5.1.2"
"@abp/jquery-form" "~5.0.0-rc.1" "@abp/jquery-form" "~5.1.2"
"@abp/jquery-validation-unobtrusive" "~5.0.0-rc.1" "@abp/jquery-validation-unobtrusive" "~5.1.2"
"@abp/lodash" "~5.0.0-rc.1" "@abp/lodash" "~5.1.2"
"@abp/luxon" "~5.0.0-rc.1" "@abp/luxon" "~5.1.2"
"@abp/malihu-custom-scrollbar-plugin" "~5.0.0-rc.1" "@abp/malihu-custom-scrollbar-plugin" "~5.1.2"
"@abp/select2" "~5.0.0-rc.1" "@abp/select2" "~5.1.2"
"@abp/sweetalert2" "~5.0.0-rc.1" "@abp/sweetalert2" "~5.1.2"
"@abp/timeago" "~5.0.0-rc.1" "@abp/timeago" "~5.1.2"
"@abp/toastr" "~5.0.0-rc.1" "@abp/toastr" "~5.1.2"
"@abp/aspnetcore.mvc.ui@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.0.0-rc.1.tgz#17e16731a4b840ccf208ec9fa651783776b7ed28" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.1.2.tgz#21b664a59e0894fe484cfcd8b8eb8bdb1a86be29"
integrity sha512-eLH0tj5KMwwFRL1JnN1zjM1lkJyB16ElpQ0W56tjiTx0S++QChMrBFhbKXxIfsFylNv9bhaInamq3pXKrXKhAg== integrity sha512-7+WXmCmDNCxS9YpTLTX8Rid+Z7+C/BWisALFdAj56X4wGoLJgoxA2ImXDq0czc3mpaI/7u+xmdIOrcRxHdGx4g==
dependencies: dependencies:
ansi-colors "^4.1.1" ansi-colors "^4.1.1"
extend-object "^1.0.0" extend-object "^1.0.0"
@ -41,161 +41,161 @@
merge-stream "^2.0.0" merge-stream "^2.0.0"
micromatch "^4.0.2" micromatch "^4.0.2"
"@abp/bootstrap-datepicker@~5.0.0-rc.1": "@abp/bootstrap-datepicker@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.0.0-rc.1.tgz#750e3cfc93124ecb10805e511d499ba03ec8b446" resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.1.2.tgz#a4e94490736b2a7a9b893dd52dab0b340e703c0c"
integrity sha512-VkuX0qdHt8zYe7jJt4Y03kr4UnFYmqqBC2DyyaipUvy9KncUsui/t5enn7GN5ZWE9phF9ek4Fga3mRRIgs3bZg== integrity sha512-C7op/Qttg7ap5jo14WBK5dPZFLBpB0FE3rNiIdZPFByPqcKj2iQMAsxA5O36m3PcdOGeEwt4L3z7jnSX1qt1Sw==
dependencies: dependencies:
bootstrap-datepicker "^1.9.0" bootstrap-datepicker "^1.9.0"
"@abp/bootstrap@~5.0.0-rc.1": "@abp/bootstrap@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.0.0-rc.1.tgz#a9adb676908612e4f83c184d0d2188f1d561e6c4" resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.1.2.tgz#6536f02ec7c2e4db515e8e8a1962f0cffd4a8944"
integrity sha512-TCFwjX3o1lOkV4n3ZmD0PtsXPfBaaOAkLh4fMZTxF9EfBLtH6u0y3LsOviPAjiee+BmjYy2vO+9cgS6TQP8HBw== integrity sha512-UykBnl1Q8NBQbf/WIskju6K7w0mVy7yT2uDD8WLwzgDA07akcHWdF6vCFMnQ4p41Q4C8ijN3gCkwbfTRQz0iLg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
bootstrap "^5.1.0" bootstrap "^5.1.0"
bootstrap-v4-rtl "4.6.0-1" bootstrap-v4-rtl "4.6.0-1"
"@abp/core@~5.0.0-rc.1": "@abp/core@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.0.0-rc.1.tgz#1b7d88dcd2855e0fd0cec92b32f9a770f744c1da" resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.1.2.tgz#a557a59acea562cd9109f722186b5666c7e7d5ac"
integrity sha512-E/j8aAsgVPcUS2bhTggpbqBHoavlAW9s2IS5GZ2rd8nKTd8aV2oa9lH0CgYN2Yswgd1mr9aA4Mz+/Se5mumyRA== integrity sha512-sG/s9gNbfF0/Tu3zgLf/IGoah1Iw5AKd5P8QUXFqY/HkHh+ZmHSLVphJ2tz2iwQIciXTkjm0B8fXjw5ucfOt1g==
dependencies: dependencies:
"@abp/utils" "~5.0.0-rc.1" "@abp/utils" "~5.1.2"
"@abp/cropperjs@~5.0.0-rc.1": "@abp/cropperjs@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/cropperjs/-/cropperjs-5.0.0-rc.1.tgz#d8cdf262d4b668e1526d51d266f2d83c953c5b52" resolved "https://registry.yarnpkg.com/@abp/cropperjs/-/cropperjs-5.1.2.tgz#e4c877f8b6868002bcd744dc44384e78a0c8ede0"
integrity sha512-1cXg3rcX9J58DcYy6ZcjKbNZz0wzG283cuGmenXy9hcUc266QSUeux3yyxXyr4sb5HouckvEdPykIMRhT01kWw== integrity sha512-jeqFv32IyZ6w3fv5IEUvsA2ZJsrG04PdYxyucwGVtZBB2TducQXJa1h2dCvxd3/eIEws6AWKfFtTYyVyJ6etlQ==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
cropperjs "^1.5.7" cropperjs "^1.5.7"
"@abp/datatables.net-bs5@~5.0.0-rc.1": "@abp/datatables.net-bs5@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.0.0-rc.1.tgz#45998d0469ee79eb006973981b26b541cd1bc6d0" resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.1.2.tgz#945ab50eec007861894d8451e6d2c5ae9c6b14e5"
integrity sha512-TwSFY396xY9SRy93LNlKvuj3XnLpt3NGFv2/CnKizeVF6ike/nwun1NjNhLRZ1b1kfs6LsHoolYzhOfkJeoH1A== integrity sha512-TG5/iqRlRuINNDz3/POWvzYTC6Jqd3GIgm23GyRpqk2yXbz+PBjZ1Km3h/Tuf6ew+isb7pSYSdy0cEpOC4xdsg==
dependencies: dependencies:
"@abp/datatables.net" "~5.0.0-rc.1" "@abp/datatables.net" "~5.1.2"
datatables.net-bs5 "^1.10.25" datatables.net-bs5 "^1.10.25"
"@abp/datatables.net@~5.0.0-rc.1": "@abp/datatables.net@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.0.0-rc.1.tgz#4f286a2e253f67a7522a5e8b6f6767d5fc324983" resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.1.2.tgz#dfbd1299d9b411f51641c3bbb7e572fb40dc0b1d"
integrity sha512-r1RjBde+8zacolfsolc4DBcLVyG3A/Fb4ptP3x8/HPQl7lkLCLTd9xS0/w3HeD62wFiugZvHjt82gD5A48CYUA== integrity sha512-yyWjZ7kg/AIQihkwU22/Fa4uNkcxggtKVih+XgQHb1Xzr2k+IsDtpwAAtb5/Shuau6b0i7EBWYuwIv/QP7TMpw==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
datatables.net "^1.10.21" datatables.net "^1.10.21"
"@abp/font-awesome@~5.0.0-rc.1": "@abp/font-awesome@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.0.0-rc.1.tgz#a2fdcb8111ddac8558b92feb935abb12103d0592" resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.1.2.tgz#96afaaf9ab0ff34f20dc365f39c9bbfab84c60aa"
integrity sha512-1rinXJdRurXIwxIszYt/6dS5EKrJPgBWKF2E8Mxc+ODN3/NboMYNrdKm3FAxHX3YB36fmW+qsBXH9aTVDohvCw== integrity sha512-qFEsbEDGSqkCspFb7MFobQq0tl89XS5K7KU4Tmq9Mo/h55fo6wg3qvERR1sxDH8r+MyzpV7C+1fCEzVa3Zjtfw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
"@fortawesome/fontawesome-free" "^5.13.0" "@fortawesome/fontawesome-free" "^5.13.0"
"@abp/jquery-form@~5.0.0-rc.1": "@abp/jquery-form@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.0.0-rc.1.tgz#c2bbf6532d88d8f7eb96d5ff8f8720d9166ab106" resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.1.2.tgz#934671e64205840800fcdd88194b263c1d132666"
integrity sha512-Yz5RpBzslciR6DEOvw2OjA1uDD0zf2JECbzAoy1BaY3iEFy0EUwLDhYKQmWcyoo6/2yMrPMBJlghpirmi5B9Vg== integrity sha512-g8/MhfVklcs+l0N3mRO4bl1iUQuageWLMwbwGhwEFFseji5XEaIiDv0rm/MRvoT15LrB1UUYbkIe3FG1bjkVgg==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
jquery-form "^4.3.0" jquery-form "^4.3.0"
"@abp/jquery-validation-unobtrusive@~5.0.0-rc.1": "@abp/jquery-validation-unobtrusive@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.0.0-rc.1.tgz#6d39c58f1ad0b48d23521dc31904dfca4bc074c9" resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.1.2.tgz#0dab4b09840a051e94c985a4c2bda6615cd984d7"
integrity sha512-PcZE6JlcMRjIk042MkwvGQjJ88zdMM/o99A3cnT0UMkAwHl8z28R7OjWjhlZhrYznOtwEtp3yNhPrNn7OdtmNw== integrity sha512-lpd/kUlHo31LdKxDVAc8GhWCtDGGfhhppGYa1J6Ptncof+fN5GU7/PANOnsFiJcZcfiNnGB/fT304egVIncBrw==
dependencies: dependencies:
"@abp/jquery-validation" "~5.0.0-rc.1" "@abp/jquery-validation" "~5.1.2"
jquery-validation-unobtrusive "^3.2.11" jquery-validation-unobtrusive "^3.2.11"
"@abp/jquery-validation@~5.0.0-rc.1": "@abp/jquery-validation@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.0.0-rc.1.tgz#f76d5c631a24f292327e01dfa7f557a6643055b1" resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.1.2.tgz#3846b9969e785fec38b51bad2c1765f5429f65db"
integrity sha512-FZwDN6FVx2WAMfK2QSpI081H1GBd8Tdbw60T0Kmc6m/qfQqLuwY3gPbUCrAS1J91eyvwxOVEycIIJ1Np/UhRmA== integrity sha512-Ip0jKS3PnNba4ICGIyhdgq2/IVfPQjIXM6q18fjmZbvoCgBz2YcCa+FC3c1a5d2hfnlElH176z4VQNM71JdBYg==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
jquery-validation "^1.19.2" jquery-validation "^1.19.2"
"@abp/jquery@~5.0.0-rc.1": "@abp/jquery@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.0.0-rc.1.tgz#4ff643273b57dde7bb2af53ce62ab753bb13e0be" resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.1.2.tgz#2db1b01da2b50c251058781dde74fa7d98290cd3"
integrity sha512-tK/eE0mq7UhPjQLJgluR06pHHIH64fcHCtL+V2V/u1u0dmHa6Fd6LpHGuekGdlZI7QLs6n6DiG6tkv4Cdf8W/g== integrity sha512-lVDI91wlRHPDzqBQkSefRVNdW4YhD0kn1n4TEV1X0PI9Lh3LmdqTZqHtqDm9G5RsMWjxJg7dafk8DQgNWvEz3g==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
jquery "~3.6.0" jquery "~3.6.0"
"@abp/lodash@~5.0.0-rc.1": "@abp/lodash@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.0.0-rc.1.tgz#00e31f74eb28329caae96250c4439c5b2800acdb" resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.1.2.tgz#3cb657bc4267ed7cc0c62cf1c62b91615d323b72"
integrity sha512-6oO1m3vnXhNfITLyNubShKmIX92DMpgPJDJmUpoNiDMf0J1G0oHHauKW9X7aTEHlxIA0sK9xk8kIKSvgS9SThA== integrity sha512-YrhZCwUwGMnRz3XmGRmIRrm4Pkl2biVnpVQlmTRxDtJjL75IXrG12Ff3rXW78zrkCCvmXuu+41lEwX9ThqCT2Q==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
lodash "^4.17.15" lodash "^4.17.15"
"@abp/luxon@~5.0.0-rc.1": "@abp/luxon@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.0.0-rc.1.tgz#ce185ebdefe1c416fcf85124226440f1334b05a6" resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.1.2.tgz#323d733b184ca61a731780e4421cbd0bed013bec"
integrity sha512-fGN/6lHKIqCGe6pv49G2lRK5/7ezUYhZW+2A0oRtyEHsdjhXiZobTVnT/lqawqEs8aR2sJyc7lwCmRnO4jTrug== integrity sha512-jL8OahEJylMp488DflgP9NE5oin20cSu99GXnzQACcIIJtM/xDwIKm84B56NcdIBmpCWkHzsCnzMTdHKbcJCQw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
luxon "^1.24.1" luxon "^1.24.1"
"@abp/malihu-custom-scrollbar-plugin@~5.0.0-rc.1": "@abp/malihu-custom-scrollbar-plugin@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.0.0-rc.1.tgz#8b14c53b52603bcc283d1916133038ff25b5f18b" resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.1.2.tgz#1785ce9f6e9967573f5d2ab93f26ee27916e3089"
integrity sha512-lEM2UwfoK+sUZlL7QiNgvFrXxq1Vb4nJbFmz4eZftZ1Zhj7akq5xxfWdq2jTwM4DQWFhr1OOAVaYHYx0tSCHpA== integrity sha512-27toTKmQMFILnFjW97RLDKGAVTO8IgjTSL2FQatiS0uCyuUscRD399s7TWyG52qJxMZ8OrUyqq95tzCp+pbpaw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
malihu-custom-scrollbar-plugin "^3.1.5" malihu-custom-scrollbar-plugin "^3.1.5"
"@abp/select2@~5.0.0-rc.1": "@abp/select2@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.0.0-rc.1.tgz#2b1e554ec9c96d5259c56c8f20d4b1b3d0bdb559" resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.1.2.tgz#7d6236eb0b630f35e7e65e86596f242c68a8481f"
integrity sha512-usATVW8Mbd/iSt74BQQZbvFei+Fz3IqDCJXW6stHJ4CqOkoJit6lA0cfMv9Az0ApOFf4ucgNgmsrYW3k31jPlQ== integrity sha512-T5/B/F9lMx+ck2kVHqpbTyfqvF+Z1GJa8bjgZqb0g7x/YNRcgND94PF2H0BzGs+nBHvfH/KngALq2bgjM8yZqg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
select2 "^4.0.13" select2 "^4.0.13"
"@abp/sweetalert2@~5.0.0-rc.1": "@abp/sweetalert2@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.0.0-rc.1.tgz#f677853dd5e1e7bdba5d06cff816befcdf0e58b9" resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.1.2.tgz#f9bcd4e66dc55fb9ce4658cb8523c897e978119e"
integrity sha512-JW87ed0YhCCd1O2TGX7BoSs5ts0/F4O4D5nv3vvvDgoqXdn0Q1hCXKjeIjfstSIFXAt/e20Cw0azvsYCFaCh3w== integrity sha512-8244xULxjgwx3KF4JTF6RBKDIXdg/Wy10IBHXEVt8HyqC+PqP+tC4FNcm2i14hLkf0aPpxuGh8yq93E4g/VmHA==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
sweetalert2 "^11.0.18" sweetalert2 "^11.0.18"
"@abp/timeago@~5.0.0-rc.1": "@abp/timeago@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.0.0-rc.1.tgz#f826f111d9d89258d5ac57a633a86e55d5604033" resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.1.2.tgz#e9e3be395e4995cfe36902c49af60c2d0eeaff13"
integrity sha512-zcNG+3EnI/HLLKm4xJXbwjyFsUtFQey+j7zI9zEcXR4JZS+n5ltFSvcV+jLJDL0qcnwpB9008PXR0Jsqpzcmng== integrity sha512-PAjd1ZlJtOMJgmVdyA3Z8KBsCdKT7Qlyc7u31SyDKUyKWYH9m2nEedp9bRZ241mkDd/opuNLjTOe0+67ZwnL9Q==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
timeago "^1.6.7" timeago "^1.6.7"
"@abp/toastr@~5.0.0-rc.1": "@abp/toastr@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.0.0-rc.1.tgz#2c9a52c71eb60115a05f70465a191febb068ab2f" resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.1.2.tgz#9be7d0ccaddcefb035f03f9f2dda3dd60ccede45"
integrity sha512-SItT5xMfAQsb7ME+v9PQ+6+dUa905T5+Ws7CNMDKZWD59HPxqaoTRHtTOqzn/8pGMyCiXYzNeTdCESkRFdKWKQ== integrity sha512-oqGrYVXova4OSMkL0JNq/Aq1GDLelAHdUULFb1pGQZHfkfaZtGCCZJhgyr4+ugHznit4fuu9ip2r0SEUxtdJiw==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
toastr "^2.1.4" toastr "^2.1.4"
"@abp/uppy@~5.0.0-rc.1": "@abp/uppy@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/uppy/-/uppy-5.0.0-rc.1.tgz#a13de305265c0dc843eed46c6af9f3239f7601e4" resolved "https://registry.yarnpkg.com/@abp/uppy/-/uppy-5.1.2.tgz#bc73a73c8a5d47a21ac7e1195a02295211c35f4b"
integrity sha512-HfwE9kzMBCcnpX8IplGWos5UF+CDb81yApmwQwA30IJv7LGqO0PIVFvlkv2YopYYvG65f8tEFEbyUkpdXMw7SQ== integrity sha512-G8La/S6eBTyfXXER0aL/duTsRBmMzf7ffN0R9rtt+Ff+SbK94Gh7DyI6oQ6YeYp6bfqMPMcg9c6iYNzgyPPRyg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
uppy "^1.16.1" uppy "^1.16.1"
"@abp/utils@~5.0.0-rc.1": "@abp/utils@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.0.0-rc.1.tgz#ba89a9de73288661db295f3bce9ea0e47c669f42" resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.1.2.tgz#9116999e6fbc07c6f1d81ab8cdc380c4330d7e1d"
integrity sha512-bOgH+hz7B7MnrqR/Aqy34CKiAnZItD/tLBXysea+MldzvAKdssmqe2RLA/6lApzLaF3SbOttoXXpa1q432vAlg== integrity sha512-/bOqM4Jp2HM1tZC5A45oH0CMOA9ZEb3jiJYHwCiu/6aALXunC4KOeMOOMEgr/S1HaEtA/2aImD8gp3tYNjtEJw==
dependencies: dependencies:
just-compare "^1.3.0" just-compare "^1.3.0"
@ -498,21 +498,21 @@
"@uppy/utils" "^3.3.0" "@uppy/utils" "^3.3.0"
cuid "^2.1.1" cuid "^2.1.1"
"@volo/abp.aspnetcore.mvc.ui.theme.commercial@~5.0.0-rc.1": "@volo/abp.aspnetcore.mvc.ui.theme.commercial@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@volo/abp.aspnetcore.mvc.ui.theme.commercial/-/abp.aspnetcore.mvc.ui.theme.commercial-5.0.0-rc.1.tgz#88cf6979de98c7ccff43d63ab5d044e2ce791522" resolved "https://registry.yarnpkg.com/@volo/abp.aspnetcore.mvc.ui.theme.commercial/-/abp.aspnetcore.mvc.ui.theme.commercial-5.1.2.tgz#60f9d56851860618ae317332bf52e25a0472bcbc"
integrity sha512-S2upgNDFjKRvJvi/V9pPsk1gr5yJxGWsJ7HD8bfm+0LzOQLgobLiL3lW/86CU7jS6C1Z5yfxeJC1GiYQ/bqBGw== integrity sha512-pFd0cWieG6vYecO6s3HgBNjXPsxBZPUUkTSO9izV3llh6KroSdd7JFA4cv+2vQUuwkFFKyPFz/hKTIryD0eDIQ==
dependencies: dependencies:
"@abp/aspnetcore.mvc.ui.theme.shared" "~5.0.0-rc.1" "@abp/aspnetcore.mvc.ui.theme.shared" "~5.1.2"
"@volo/account@~5.0.0-rc.1": "@volo/account@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@volo/account/-/account-5.0.0-rc.1.tgz#1d7b7e64fab4636718860b9a0a5dbcd7cc232d38" resolved "https://registry.yarnpkg.com/@volo/account/-/account-5.1.2.tgz#25e2ac672d730a4c3f6b08f3e65bea2926dbad82"
integrity sha512-gh4wi2vZ5PKXCycqHZLK773IsfGSxDjJcTFGRvBO2K80AkI0VsFZfhnzDfGkH77T8uM+a6v/B8mnUqzi04fjdQ== integrity sha512-Yy2SojI4rAkOOIWTGDWOZ+8T/wLCoFbjle+B9dQ1YDAXBzztmCJ/Levdt6mp2a2MxM5vH7I+Fk9d01hC51aMZQ==
dependencies: dependencies:
"@abp/cropperjs" "~5.0.0-rc.1" "@abp/cropperjs" "~5.1.2"
"@abp/uppy" "~5.0.0-rc.1" "@abp/uppy" "~5.1.2"
"@volo/abp.aspnetcore.mvc.ui.theme.commercial" "~5.0.0-rc.1" "@volo/abp.aspnetcore.mvc.ui.theme.commercial" "~5.1.2"
abortcontroller-polyfill@^1.4.0: abortcontroller-polyfill@^1.4.0:
version "1.5.0" version "1.5.0"

20
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj

@ -5,20 +5,20 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.1" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" />
<PackageReference Include="Yarp.ReverseProxy" Version="1.0.0" /> <PackageReference Include="Yarp.ReverseProxy" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="5.1.2" />
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.OpenIdConnect" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

298
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs

@ -40,190 +40,172 @@ using EShopOnAbp.PublicWeb.PaymentMethods;
using EShopOnAbp.PaymentService.PaymentMethods; using EShopOnAbp.PaymentService.PaymentMethods;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
namespace EShopOnAbp.PublicWeb namespace EShopOnAbp.PublicWeb;
[DependsOn(
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpAspNetCoreMvcClientModule),
typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAccountHttpApiClientModule),
typeof(EShopOnAbpSharedHostingAspNetCoreModule),
typeof(EShopOnAbpSharedLocalizationModule),
typeof(CatalogServiceHttpApiClientModule),
typeof(BasketServiceHttpApiClientModule),
typeof(OrderingServiceHttpApiClientModule),
typeof(AbpAspNetCoreSignalRModule),
typeof(PaymentServiceHttpApiClientModule),
typeof(AbpAutoMapperModule)
)]
public class EShopOnAbpPublicWebModule : AbpModule
{ {
[DependsOn( public override void PreConfigureServices(ServiceConfigurationContext context)
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpAspNetCoreMvcClientModule),
typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAccountHttpApiClientModule),
typeof(EShopOnAbpSharedHostingAspNetCoreModule),
typeof(EShopOnAbpSharedLocalizationModule),
typeof(CatalogServiceHttpApiClientModule),
typeof(BasketServiceHttpApiClientModule),
typeof(OrderingServiceHttpApiClientModule),
typeof(AbpAspNetCoreSignalRModule),
typeof(PaymentServiceHttpApiClientModule),
typeof(AbpAutoMapperModule)
)]
public class EShopOnAbpPublicWebModule : AbpModule
{ {
public override void PreConfigureServices(ServiceConfigurationContext context) context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{ {
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options => options.AddAssemblyResource(
{ typeof(EShopOnAbpResource),
options.AddAssemblyResource( typeof(EShopOnAbpPublicWebModule).Assembly
typeof(EShopOnAbpResource), );
typeof(EShopOnAbpPublicWebModule).Assembly });
); }
});
} public override void ConfigureServices(ServiceConfigurationContext context)
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
context.Services.AddAutoMapperObjectMapper<EShopOnAbpPublicWebModule>();
Configure<AbpAutoMapperOptions>(options => { options.AddMaps<EShopOnAbpPublicWebModule>(validate: true); });
public override void ConfigureServices(ServiceConfigurationContext context) Configure<AbpBundlingOptions>(options =>
{ {
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; options.StyleBundles.Configure(
var hostingEnvironment = context.Services.GetHostingEnvironment(); BasicThemeBundles.Styles.Global,
var configuration = context.Services.GetConfiguration(); bundle => { bundle.AddContributors(typeof(CartWidgetStyleContributor)); }
);
});
context.Services.AddAutoMapperObjectMapper<EShopOnAbpPublicWebModule>(); Configure<AbpMultiTenancyOptions>(options => { options.IsEnabled = true; });
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<EShopOnAbpPublicWebModule>(validate: true);
});
Configure<AbpBundlingOptions>(options => Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "EShopOnAbp:"; });
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
bundle =>
{
bundle.AddContributors(typeof(CartWidgetStyleContributor));
}
);
});
Configure<AbpMultiTenancyOptions>(options => Configure<AppUrlOptions>(options => { options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; });
{
options.IsEnabled = true;
});
Configure<AbpDistributedCacheOptions>(options => ConfigurePayment(configuration);
{
options.KeyPrefix = "EShopOnAbp:";
});
Configure<AppUrlOptions>(options => context.Services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options => { options.ExpireTimeSpan = TimeSpan.FromDays(365); })
.AddAbpOpenIdConnect("oidc", options =>
{ {
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.ClientId = configuration["AuthServer:ClientId"];
options.ClientSecret = configuration["AuthServer:ClientSecret"];
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("role");
options.Scope.Add("email");
options.Scope.Add("phone");
options.Scope.Add("AccountService");
options.Scope.Add("AdministrationService");
options.Scope.Add("BasketService");
options.Scope.Add("CatalogService");
options.Scope.Add("PaymentService");
options.Scope.Add("OrderingService");
}); });
ConfigurePayment(configuration); var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
context.Services.AddAuthentication(options => .AddDataProtection()
{ .PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys")
options.DefaultScheme = "Cookies"; .SetApplicationName("eShopOnAbp-PublicWeb");
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options =>
{
options.ExpireTimeSpan = TimeSpan.FromDays(365);
})
.AddAbpOpenIdConnect("oidc", options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.ClientId = configuration["AuthServer:ClientId"];
options.ClientSecret = configuration["AuthServer:ClientSecret"];
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("role");
options.Scope.Add("email");
options.Scope.Add("phone");
options.Scope.Add("AccountService");
options.Scope.Add("AdministrationService");
options.Scope.Add("BasketService");
options.Scope.Add("CatalogService");
options.Scope.Add("PaymentService");
options.Scope.Add("OrderingService");
});
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); Configure<AbpNavigationOptions>(options =>
context.Services {
.AddDataProtection() options.MenuContributors.Add(new EShopOnAbpPublicWebMenuContributor(configuration));
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys") });
.SetApplicationName("eShopOnAbp-PublicWeb");
Configure<AbpNavigationOptions>(options => Configure<AbpToolbarOptions>(options =>
{ {
options.MenuContributors.Add(new EShopOnAbpPublicWebMenuContributor(configuration)); options.Contributors.Add(new EShopOnAbpPublicWebToolbarContributor());
}); });
Configure<AbpToolbarOptions>(options => context.Services
.AddReverseProxy()
.LoadFromConfig(configuration.GetSection("ReverseProxy"))
.AddTransforms(builderContext =>
{ {
options.Contributors.Add(new EShopOnAbpPublicWebToolbarContributor()); builderContext.AddRequestTransform(async (transformContext) =>
});
context.Services
.AddReverseProxy()
.LoadFromConfig(configuration.GetSection("ReverseProxy"))
.AddTransforms(builderContext =>
{ {
builderContext.AddRequestTransform(async (transformContext) => transformContext.ProxyRequest.Headers
{ .Authorization = new AuthenticationHeaderValue(
transformContext.ProxyRequest.Headers "Bearer",
.Authorization = new AuthenticationHeaderValue( await transformContext.HttpContext.GetTokenAsync("access_token")
"Bearer", );
await transformContext.HttpContext.GetTokenAsync("access_token")
);
});
}); });
} });
}
private void ConfigurePayment(IConfiguration configuration) private void ConfigurePayment(IConfiguration configuration)
{
Configure<EShopOnAbpPublicWebPaymentOptions>(options =>
{ {
Configure<EShopOnAbpPublicWebPaymentOptions>(options => options.PaymentSuccessfulCallbackUrl =
{ configuration["App:SelfUrl"].EnsureEndsWith('/') + "PaymentCompleted";
options.PaymentSuccessfulCallbackUrl = configuration["App:SelfUrl"].EnsureEndsWith('/') + "PaymentCompleted"; });
});
Configure<PaymentMethodUiOptions>(options => Configure<PaymentMethodUiOptions>(options =>
{ {
options.ConfigureIcon(PaymentMethodNames.PayPal, "fa-cc-paypal paypal"); options.ConfigureIcon(PaymentMethodNames.PayPal, "fa-cc-paypal paypal");
}); });
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.Use((ctx, next) =>
{ {
var app = context.GetApplicationBuilder(); ctx.Request.Scheme = "https";
var env = context.GetEnvironment(); return next();
});
app.Use((ctx, next) =>
{
ctx.Request.Scheme = "https";
return next();
});
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
if (!env.IsDevelopment()) if (!env.IsDevelopment())
{ {
app.UseErrorPage(); app.UseErrorPage();
}
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
// app.UseHttpMetrics();
app.UseAuthentication();
app.UseAbpSerilogEnrichers();
app.UseAuthorization();
app.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapReverseProxy();
// endpoints.MapMetrics();
});
} }
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
// app.UseHttpMetrics();
app.UseAuthentication();
app.UseAbpSerilogEnrichers();
app.UseAuthorization();
app.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapReverseProxy();
// endpoints.MapMetrics();
});
} }
} }

64
apps/public-web/src/EShopOnAbp.PublicWeb/Program.cs

@ -1,52 +1,36 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog; using Serilog;
namespace EShopOnAbp.PublicWeb namespace EShopOnAbp.PublicWeb;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpPublicWebModule>(args);
return 0; await app.InitializeApplicationAsync();
} await app.RunAsync();
catch (Exception ex)
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => }
{ finally
webBuilder.UseStartup<Startup>(); {
}) Log.CloseAndFlush();
.UseAutofac() }
.UseSerilog();
} }
} }

25
apps/public-web/src/EShopOnAbp.PublicWeb/Startup.cs

@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace EShopOnAbp.PublicWeb
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<EShopOnAbpPublicWebModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.InitializeApplication();
}
}
}

4
apps/public-web/src/EShopOnAbp.PublicWeb/package.json

@ -3,7 +3,7 @@
"name": "EShopOnAbpPublicWeb", "name": "EShopOnAbpPublicWeb",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.0.0-rc.1", "@abp/aspnetcore.mvc.ui.theme.basic": "~5.1.2",
"@abp/signalr": "~5.0.0-rc.1" "@abp/signalr": "~5.1.2"
} }
} }

10
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/jquery/abp.jquery.js

@ -205,14 +205,16 @@ var abp = abp || {};
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
var messagePromise = null; var messagePromise = null;
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText);
if (userOptions.abpHandleError !== false) { if (userOptions.abpHandleError !== false) {
messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); messagePromise = abp.ajax.showError(responseJSON.error);
} }
abp.ajax.logError(jqXHR.responseJSON.error); abp.ajax.logError(responseJSON.error);
$dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); $dfd && $dfd.reject(responseJSON.error, jqXHR);
userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); userOptions.error && userOptions.error(responseJSON.error, jqXHR);
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
abp.ajax.handleUnAuthorizedRequest(messagePromise); abp.ajax.handleUnAuthorizedRequest(messagePromise);

2
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/utils/abp-utils.umd.js.map

File diff suppressed because one or more lines are too long

2
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map

File diff suppressed because one or more lines are too long

262
apps/public-web/src/EShopOnAbp.PublicWeb/yarn.lock

@ -2,37 +2,37 @@
# yarn lockfile v1 # yarn lockfile v1
"@abp/aspnetcore.mvc.ui.theme.basic@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui.theme.basic@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.0.0-rc.1.tgz#cd575ab35b5cf9c9c2d3ab02fc6ff5fb1851a622" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.1.2.tgz#e5bf1ba670f2344a341f3335051d5e37543bd99e"
integrity sha512-/tezLoIaqMJTlV78EbyKkJY30XpayiXJg2apq6/LnSddDIDKaRdlWe1gfXBjFrkOVkdhdSPrvOIy95a284cY/Q== integrity sha512-W3m8AWhyV91EMkudNVA9toYBskhrJ+YQNAYF52LglfEtvSlpo1eSMs/lIBkV6zjB03CdAjKHW3HHCqOx5ARDOQ==
dependencies: dependencies:
"@abp/aspnetcore.mvc.ui.theme.shared" "~5.0.0-rc.1" "@abp/aspnetcore.mvc.ui.theme.shared" "~5.1.2"
"@abp/aspnetcore.mvc.ui.theme.shared@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui.theme.shared@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.0.0-rc.1.tgz#053ee1d8f69eea1559d6600d7f7b5a645968d6bf" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.1.2.tgz#dc04a0fa16af599303d805f12baeaaf196e6a407"
integrity sha512-XbCXZ8mka5RCezYR54YRiUn+SgTyVgo/2F42UJ8ZJKMHKo8nQGMFANWuuJ4qHamApEqKZZmmdWp37BnpQ7JMMw== integrity sha512-SIXBYvMcRmH9+ndGuhQB0J8eeOmxr2An1a6VbQLK/S4YBIsVrBsp/g2RfRZLERuydt6idoQaB+ly31cc9Nif9g==
dependencies: dependencies:
"@abp/aspnetcore.mvc.ui" "~5.0.0-rc.1" "@abp/aspnetcore.mvc.ui" "~5.1.2"
"@abp/bootstrap" "~5.0.0-rc.1" "@abp/bootstrap" "~5.1.2"
"@abp/bootstrap-datepicker" "~5.0.0-rc.1" "@abp/bootstrap-datepicker" "~5.1.2"
"@abp/datatables.net-bs5" "~5.0.0-rc.1" "@abp/datatables.net-bs5" "~5.1.2"
"@abp/font-awesome" "~5.0.0-rc.1" "@abp/font-awesome" "~5.1.2"
"@abp/jquery-form" "~5.0.0-rc.1" "@abp/jquery-form" "~5.1.2"
"@abp/jquery-validation-unobtrusive" "~5.0.0-rc.1" "@abp/jquery-validation-unobtrusive" "~5.1.2"
"@abp/lodash" "~5.0.0-rc.1" "@abp/lodash" "~5.1.2"
"@abp/luxon" "~5.0.0-rc.1" "@abp/luxon" "~5.1.2"
"@abp/malihu-custom-scrollbar-plugin" "~5.0.0-rc.1" "@abp/malihu-custom-scrollbar-plugin" "~5.1.2"
"@abp/select2" "~5.0.0-rc.1" "@abp/select2" "~5.1.2"
"@abp/sweetalert2" "~5.0.0-rc.1" "@abp/sweetalert2" "~5.1.2"
"@abp/timeago" "~5.0.0-rc.1" "@abp/timeago" "~5.1.2"
"@abp/toastr" "~5.0.0-rc.1" "@abp/toastr" "~5.1.2"
"@abp/aspnetcore.mvc.ui@~5.0.0-rc.1": "@abp/aspnetcore.mvc.ui@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.0.0-rc.1.tgz#17e16731a4b840ccf208ec9fa651783776b7ed28" resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.1.2.tgz#21b664a59e0894fe484cfcd8b8eb8bdb1a86be29"
integrity sha512-eLH0tj5KMwwFRL1JnN1zjM1lkJyB16ElpQ0W56tjiTx0S++QChMrBFhbKXxIfsFylNv9bhaInamq3pXKrXKhAg== integrity sha512-7+WXmCmDNCxS9YpTLTX8Rid+Z7+C/BWisALFdAj56X4wGoLJgoxA2ImXDq0czc3mpaI/7u+xmdIOrcRxHdGx4g==
dependencies: dependencies:
ansi-colors "^4.1.1" ansi-colors "^4.1.1"
extend-object "^1.0.0" extend-object "^1.0.0"
@ -41,167 +41,153 @@
merge-stream "^2.0.0" merge-stream "^2.0.0"
micromatch "^4.0.2" micromatch "^4.0.2"
"@abp/bootstrap-datepicker@~5.0.0-rc.1": "@abp/bootstrap-datepicker@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.0.0-rc.1.tgz#750e3cfc93124ecb10805e511d499ba03ec8b446" resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.1.2.tgz#a4e94490736b2a7a9b893dd52dab0b340e703c0c"
integrity sha512-VkuX0qdHt8zYe7jJt4Y03kr4UnFYmqqBC2DyyaipUvy9KncUsui/t5enn7GN5ZWE9phF9ek4Fga3mRRIgs3bZg== integrity sha512-C7op/Qttg7ap5jo14WBK5dPZFLBpB0FE3rNiIdZPFByPqcKj2iQMAsxA5O36m3PcdOGeEwt4L3z7jnSX1qt1Sw==
dependencies: dependencies:
bootstrap-datepicker "^1.9.0" bootstrap-datepicker "^1.9.0"
"@abp/bootstrap@~5.0.0-rc.1": "@abp/bootstrap@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.0.0-rc.1.tgz#a9adb676908612e4f83c184d0d2188f1d561e6c4" resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.1.2.tgz#6536f02ec7c2e4db515e8e8a1962f0cffd4a8944"
integrity sha512-TCFwjX3o1lOkV4n3ZmD0PtsXPfBaaOAkLh4fMZTxF9EfBLtH6u0y3LsOviPAjiee+BmjYy2vO+9cgS6TQP8HBw== integrity sha512-UykBnl1Q8NBQbf/WIskju6K7w0mVy7yT2uDD8WLwzgDA07akcHWdF6vCFMnQ4p41Q4C8ijN3gCkwbfTRQz0iLg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
bootstrap "^5.1.0" bootstrap "^5.1.0"
bootstrap-v4-rtl "4.6.0-1" bootstrap-v4-rtl "4.6.0-1"
"@abp/core@~5.0.0-rc.1": "@abp/core@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.0.0-rc.1.tgz#1b7d88dcd2855e0fd0cec92b32f9a770f744c1da" resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.1.2.tgz#a557a59acea562cd9109f722186b5666c7e7d5ac"
integrity sha512-E/j8aAsgVPcUS2bhTggpbqBHoavlAW9s2IS5GZ2rd8nKTd8aV2oa9lH0CgYN2Yswgd1mr9aA4Mz+/Se5mumyRA== integrity sha512-sG/s9gNbfF0/Tu3zgLf/IGoah1Iw5AKd5P8QUXFqY/HkHh+ZmHSLVphJ2tz2iwQIciXTkjm0B8fXjw5ucfOt1g==
dependencies:
"@abp/utils" "~5.0.0-rc.1"
"@abp/core@~5.0.0-rc.2":
version "5.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.0.0-rc.2.tgz#44e773fe2b6e17b037859cb99e14dbd17a3ec1cd"
integrity sha512-sdxKIEnIxnVXmai2zPvrMsF4t8CZ5K7p5yw64QsuGfy2jMOz+wWrzS6Zbhv8aUdgwvHy/d6GyNYRV///Kxel8g==
dependencies: dependencies:
"@abp/utils" "~5.0.0-rc.2" "@abp/utils" "~5.1.2"
"@abp/datatables.net-bs5@~5.0.0-rc.1": "@abp/datatables.net-bs5@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.0.0-rc.1.tgz#45998d0469ee79eb006973981b26b541cd1bc6d0" resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.1.2.tgz#945ab50eec007861894d8451e6d2c5ae9c6b14e5"
integrity sha512-TwSFY396xY9SRy93LNlKvuj3XnLpt3NGFv2/CnKizeVF6ike/nwun1NjNhLRZ1b1kfs6LsHoolYzhOfkJeoH1A== integrity sha512-TG5/iqRlRuINNDz3/POWvzYTC6Jqd3GIgm23GyRpqk2yXbz+PBjZ1Km3h/Tuf6ew+isb7pSYSdy0cEpOC4xdsg==
dependencies: dependencies:
"@abp/datatables.net" "~5.0.0-rc.1" "@abp/datatables.net" "~5.1.2"
datatables.net-bs5 "^1.10.25" datatables.net-bs5 "^1.10.25"
"@abp/datatables.net@~5.0.0-rc.1": "@abp/datatables.net@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.0.0-rc.1.tgz#4f286a2e253f67a7522a5e8b6f6767d5fc324983" resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.1.2.tgz#dfbd1299d9b411f51641c3bbb7e572fb40dc0b1d"
integrity sha512-r1RjBde+8zacolfsolc4DBcLVyG3A/Fb4ptP3x8/HPQl7lkLCLTd9xS0/w3HeD62wFiugZvHjt82gD5A48CYUA== integrity sha512-yyWjZ7kg/AIQihkwU22/Fa4uNkcxggtKVih+XgQHb1Xzr2k+IsDtpwAAtb5/Shuau6b0i7EBWYuwIv/QP7TMpw==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
datatables.net "^1.10.21" datatables.net "^1.10.21"
"@abp/font-awesome@~5.0.0-rc.1": "@abp/font-awesome@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.0.0-rc.1.tgz#a2fdcb8111ddac8558b92feb935abb12103d0592" resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.1.2.tgz#96afaaf9ab0ff34f20dc365f39c9bbfab84c60aa"
integrity sha512-1rinXJdRurXIwxIszYt/6dS5EKrJPgBWKF2E8Mxc+ODN3/NboMYNrdKm3FAxHX3YB36fmW+qsBXH9aTVDohvCw== integrity sha512-qFEsbEDGSqkCspFb7MFobQq0tl89XS5K7KU4Tmq9Mo/h55fo6wg3qvERR1sxDH8r+MyzpV7C+1fCEzVa3Zjtfw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
"@fortawesome/fontawesome-free" "^5.13.0" "@fortawesome/fontawesome-free" "^5.13.0"
"@abp/jquery-form@~5.0.0-rc.1": "@abp/jquery-form@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.0.0-rc.1.tgz#c2bbf6532d88d8f7eb96d5ff8f8720d9166ab106" resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.1.2.tgz#934671e64205840800fcdd88194b263c1d132666"
integrity sha512-Yz5RpBzslciR6DEOvw2OjA1uDD0zf2JECbzAoy1BaY3iEFy0EUwLDhYKQmWcyoo6/2yMrPMBJlghpirmi5B9Vg== integrity sha512-g8/MhfVklcs+l0N3mRO4bl1iUQuageWLMwbwGhwEFFseji5XEaIiDv0rm/MRvoT15LrB1UUYbkIe3FG1bjkVgg==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
jquery-form "^4.3.0" jquery-form "^4.3.0"
"@abp/jquery-validation-unobtrusive@~5.0.0-rc.1": "@abp/jquery-validation-unobtrusive@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.0.0-rc.1.tgz#6d39c58f1ad0b48d23521dc31904dfca4bc074c9" resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.1.2.tgz#0dab4b09840a051e94c985a4c2bda6615cd984d7"
integrity sha512-PcZE6JlcMRjIk042MkwvGQjJ88zdMM/o99A3cnT0UMkAwHl8z28R7OjWjhlZhrYznOtwEtp3yNhPrNn7OdtmNw== integrity sha512-lpd/kUlHo31LdKxDVAc8GhWCtDGGfhhppGYa1J6Ptncof+fN5GU7/PANOnsFiJcZcfiNnGB/fT304egVIncBrw==
dependencies: dependencies:
"@abp/jquery-validation" "~5.0.0-rc.1" "@abp/jquery-validation" "~5.1.2"
jquery-validation-unobtrusive "^3.2.11" jquery-validation-unobtrusive "^3.2.11"
"@abp/jquery-validation@~5.0.0-rc.1": "@abp/jquery-validation@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.0.0-rc.1.tgz#f76d5c631a24f292327e01dfa7f557a6643055b1" resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.1.2.tgz#3846b9969e785fec38b51bad2c1765f5429f65db"
integrity sha512-FZwDN6FVx2WAMfK2QSpI081H1GBd8Tdbw60T0Kmc6m/qfQqLuwY3gPbUCrAS1J91eyvwxOVEycIIJ1Np/UhRmA== integrity sha512-Ip0jKS3PnNba4ICGIyhdgq2/IVfPQjIXM6q18fjmZbvoCgBz2YcCa+FC3c1a5d2hfnlElH176z4VQNM71JdBYg==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
jquery-validation "^1.19.2" jquery-validation "^1.19.2"
"@abp/jquery@~5.0.0-rc.1": "@abp/jquery@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.0.0-rc.1.tgz#4ff643273b57dde7bb2af53ce62ab753bb13e0be" resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.1.2.tgz#2db1b01da2b50c251058781dde74fa7d98290cd3"
integrity sha512-tK/eE0mq7UhPjQLJgluR06pHHIH64fcHCtL+V2V/u1u0dmHa6Fd6LpHGuekGdlZI7QLs6n6DiG6tkv4Cdf8W/g== integrity sha512-lVDI91wlRHPDzqBQkSefRVNdW4YhD0kn1n4TEV1X0PI9Lh3LmdqTZqHtqDm9G5RsMWjxJg7dafk8DQgNWvEz3g==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
jquery "~3.6.0" jquery "~3.6.0"
"@abp/lodash@~5.0.0-rc.1": "@abp/lodash@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.0.0-rc.1.tgz#00e31f74eb28329caae96250c4439c5b2800acdb" resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.1.2.tgz#3cb657bc4267ed7cc0c62cf1c62b91615d323b72"
integrity sha512-6oO1m3vnXhNfITLyNubShKmIX92DMpgPJDJmUpoNiDMf0J1G0oHHauKW9X7aTEHlxIA0sK9xk8kIKSvgS9SThA== integrity sha512-YrhZCwUwGMnRz3XmGRmIRrm4Pkl2biVnpVQlmTRxDtJjL75IXrG12Ff3rXW78zrkCCvmXuu+41lEwX9ThqCT2Q==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
lodash "^4.17.15" lodash "^4.17.15"
"@abp/luxon@~5.0.0-rc.1": "@abp/luxon@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.0.0-rc.1.tgz#ce185ebdefe1c416fcf85124226440f1334b05a6" resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.1.2.tgz#323d733b184ca61a731780e4421cbd0bed013bec"
integrity sha512-fGN/6lHKIqCGe6pv49G2lRK5/7ezUYhZW+2A0oRtyEHsdjhXiZobTVnT/lqawqEs8aR2sJyc7lwCmRnO4jTrug== integrity sha512-jL8OahEJylMp488DflgP9NE5oin20cSu99GXnzQACcIIJtM/xDwIKm84B56NcdIBmpCWkHzsCnzMTdHKbcJCQw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
luxon "^1.24.1" luxon "^1.24.1"
"@abp/malihu-custom-scrollbar-plugin@~5.0.0-rc.1": "@abp/malihu-custom-scrollbar-plugin@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.0.0-rc.1.tgz#8b14c53b52603bcc283d1916133038ff25b5f18b" resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.1.2.tgz#1785ce9f6e9967573f5d2ab93f26ee27916e3089"
integrity sha512-lEM2UwfoK+sUZlL7QiNgvFrXxq1Vb4nJbFmz4eZftZ1Zhj7akq5xxfWdq2jTwM4DQWFhr1OOAVaYHYx0tSCHpA== integrity sha512-27toTKmQMFILnFjW97RLDKGAVTO8IgjTSL2FQatiS0uCyuUscRD399s7TWyG52qJxMZ8OrUyqq95tzCp+pbpaw==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
malihu-custom-scrollbar-plugin "^3.1.5" malihu-custom-scrollbar-plugin "^3.1.5"
"@abp/select2@~5.0.0-rc.1": "@abp/select2@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.0.0-rc.1.tgz#2b1e554ec9c96d5259c56c8f20d4b1b3d0bdb559" resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.1.2.tgz#7d6236eb0b630f35e7e65e86596f242c68a8481f"
integrity sha512-usATVW8Mbd/iSt74BQQZbvFei+Fz3IqDCJXW6stHJ4CqOkoJit6lA0cfMv9Az0ApOFf4ucgNgmsrYW3k31jPlQ== integrity sha512-T5/B/F9lMx+ck2kVHqpbTyfqvF+Z1GJa8bjgZqb0g7x/YNRcgND94PF2H0BzGs+nBHvfH/KngALq2bgjM8yZqg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
select2 "^4.0.13" select2 "^4.0.13"
"@abp/signalr@~5.0.0-rc.1": "@abp/signalr@~5.1.2":
version "5.0.0-rc.2" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/signalr/-/signalr-5.0.0-rc.2.tgz#bb99e65f547cee8032ccfd86a9239dea4c40330d" resolved "https://registry.yarnpkg.com/@abp/signalr/-/signalr-5.1.2.tgz#543ba66d4f02e48e9d73fa183e54dd45cbdd4d66"
integrity sha512-Tm7EjgTVE7iLC/2eJLTC17Nv68FQbV1WWvWqblZOBQIKu/rDIFMX5otdVklrjte2hjWqyFYopXXpBeWNP0mq4A== integrity sha512-MQU9EVY2EyAkaIUnJIewRNicyjWSyhziucea44G6mWkJaDNOa/EZES8lPhLj7jcH7klbObVKuToo57wNwGEeTg==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.2" "@abp/core" "~5.1.2"
"@microsoft/signalr" "~3.1.5" "@microsoft/signalr" "~3.1.5"
"@abp/sweetalert2@~5.0.0-rc.1": "@abp/sweetalert2@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.0.0-rc.1.tgz#f677853dd5e1e7bdba5d06cff816befcdf0e58b9" resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.1.2.tgz#f9bcd4e66dc55fb9ce4658cb8523c897e978119e"
integrity sha512-JW87ed0YhCCd1O2TGX7BoSs5ts0/F4O4D5nv3vvvDgoqXdn0Q1hCXKjeIjfstSIFXAt/e20Cw0azvsYCFaCh3w== integrity sha512-8244xULxjgwx3KF4JTF6RBKDIXdg/Wy10IBHXEVt8HyqC+PqP+tC4FNcm2i14hLkf0aPpxuGh8yq93E4g/VmHA==
dependencies: dependencies:
"@abp/core" "~5.0.0-rc.1" "@abp/core" "~5.1.2"
sweetalert2 "^11.0.18" sweetalert2 "^11.0.18"
"@abp/timeago@~5.0.0-rc.1": "@abp/timeago@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.0.0-rc.1.tgz#f826f111d9d89258d5ac57a633a86e55d5604033" resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.1.2.tgz#e9e3be395e4995cfe36902c49af60c2d0eeaff13"
integrity sha512-zcNG+3EnI/HLLKm4xJXbwjyFsUtFQey+j7zI9zEcXR4JZS+n5ltFSvcV+jLJDL0qcnwpB9008PXR0Jsqpzcmng== integrity sha512-PAjd1ZlJtOMJgmVdyA3Z8KBsCdKT7Qlyc7u31SyDKUyKWYH9m2nEedp9bRZ241mkDd/opuNLjTOe0+67ZwnL9Q==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
timeago "^1.6.7" timeago "^1.6.7"
"@abp/toastr@~5.0.0-rc.1": "@abp/toastr@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.0.0-rc.1.tgz#2c9a52c71eb60115a05f70465a191febb068ab2f" resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.1.2.tgz#9be7d0ccaddcefb035f03f9f2dda3dd60ccede45"
integrity sha512-SItT5xMfAQsb7ME+v9PQ+6+dUa905T5+Ws7CNMDKZWD59HPxqaoTRHtTOqzn/8pGMyCiXYzNeTdCESkRFdKWKQ== integrity sha512-oqGrYVXova4OSMkL0JNq/Aq1GDLelAHdUULFb1pGQZHfkfaZtGCCZJhgyr4+ugHznit4fuu9ip2r0SEUxtdJiw==
dependencies: dependencies:
"@abp/jquery" "~5.0.0-rc.1" "@abp/jquery" "~5.1.2"
toastr "^2.1.4" toastr "^2.1.4"
"@abp/utils@~5.0.0-rc.1": "@abp/utils@~5.1.2":
version "5.0.0-rc.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.0.0-rc.1.tgz#ba89a9de73288661db295f3bce9ea0e47c669f42" resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.1.2.tgz#9116999e6fbc07c6f1d81ab8cdc380c4330d7e1d"
integrity sha512-bOgH+hz7B7MnrqR/Aqy34CKiAnZItD/tLBXysea+MldzvAKdssmqe2RLA/6lApzLaF3SbOttoXXpa1q432vAlg== integrity sha512-/bOqM4Jp2HM1tZC5A45oH0CMOA9ZEb3jiJYHwCiu/6aALXunC4KOeMOOMEgr/S1HaEtA/2aImD8gp3tYNjtEJw==
dependencies:
just-compare "^1.3.0"
"@abp/utils@~5.0.0-rc.2":
version "5.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.0.0-rc.2.tgz#4ffc8e937c2e83f91c60a2f1222d8e046ab7dd54"
integrity sha512-/6QL6EdCatyz4igdPA0K0Cs/0fe3AatGyYYtwb+SBnZBcySqF+BUBWVlwMDJks8V/oUrJMQNy41foNuLGJb3jQ==
dependencies: dependencies:
just-compare "^1.3.0" just-compare "^1.3.0"

135
gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs

@ -1,5 +1,4 @@
using System; using EShopOnAbp.Shared.Hosting.Gateways;
using EShopOnAbp.Shared.Hosting.Gateways;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -8,84 +7,82 @@ using Ocelot.Middleware;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Cors;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace EShopOnAbp.WebPublicGateway namespace EShopOnAbp.WebPublicGateway;
[DependsOn(
typeof(EShopOnAbpSharedHostingGatewaysModule)
)]
public class EShopOnAbpWebPublicGatewayModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(EShopOnAbpSharedHostingGatewaysModule)
)]
public class EShopOnAbpWebPublicGatewayModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{ var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment();
SwaggerWithAuthConfigurationHelper.Configure( SwaggerWithAuthConfigurationHelper.Configure(
context: context, context: context,
authority: configuration["AuthServer:Authority"], authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */ scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{ "AccountService", "Account Service API" }, { "AccountService", "Account Service API" },
{ "IdentityService", "Identity Service API" }, { "IdentityService", "Identity Service API" },
{ "AdministrationService", "Administration Service API" }, { "AdministrationService", "Administration Service API" },
{ "CatalogService", "Catalog Service API" }, { "CatalogService", "Catalog Service API" },
{ "BasketService", "Basket Service API" }, { "BasketService", "Basket Service API" },
{ "PaymentService", "Payment Service API" }, { "PaymentService", "Payment Service API" },
{ "OrderingService", "Ordering Service API" }, { "OrderingService", "Ordering Service API" },
}, },
apiTitle: "WebPublic Gateway" apiTitle: "WebPublic Gateway"
); );
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment(); var env = context.GetEnvironment();
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseCorrelationId(); app.UseCorrelationId();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>(); var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
var routes = configuration.GetSection("Routes").Get<List<OcelotConfiguration>>(); var routes = configuration.GetSection("Routes").Get<List<OcelotConfiguration>>();
var routedServices = routes var routedServices = routes
.GroupBy(t => t.ServiceKey) .GroupBy(t => t.ServiceKey)
.Select(r => r.First()) .Select(r => r.First())
.Distinct(); .Distinct();
foreach (var config in routedServices) foreach (var config in routedServices)
{ {
var url = var url =
$"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}"; $"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
if (!env.IsDevelopment()) if (!env.IsDevelopment())
{
url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
}
options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
}
});
app.MapWhen(
ctx => ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
app2 =>
{ {
app2.UseRouting(); url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
app2.UseConfiguredEndpoints();
} }
);
app.UseOcelot().Wait(); options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
} options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
}
});
app.MapWhen(
ctx => ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
app2 =>
{
app2.UseRouting();
app2.UseConfiguredEndpoints();
}
);
app.UseOcelot().Wait();
} }
} }

60
gateways/web-public/src/EShopOnAbp.WebPublicGateway/Program.cs

@ -1,46 +1,36 @@
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
namespace EShopOnAbp.WebPublicGateway namespace EShopOnAbp.WebPublicGateway;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpWebPublicGatewayModule>(args);
return 0; await app.InitializeApplicationAsync();
} await app.RunAsync();
catch (Exception ex)
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true, reloadOnChange:true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) }
.UseAutofac() finally
.UseSerilog(); {
Log.CloseAndFlush();
}
} }
} }

18
gateways/web-public/src/EShopOnAbp.WebPublicGateway/Startup.cs

@ -1,18 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.WebPublicGateway
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<EShopOnAbpWebPublicGatewayModule>();
}
public void Configure(IApplicationBuilder app)
{
app.InitializeApplication();
}
}
}

1
gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj

@ -4,7 +4,6 @@
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\..\shared\EShopOnAbp.Shared.Hosting.Gateways\EShopOnAbp.Shared.Hosting.Gateways.csproj" /> <ProjectReference Include="..\..\..\..\shared\EShopOnAbp.Shared.Hosting.Gateways\EShopOnAbp.Shared.Hosting.Gateways.csproj" />
</ItemGroup> </ItemGroup>

165
gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs

@ -9,104 +9,103 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.OpenApi.Models;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace EShopOnAbp.WebGateway namespace EShopOnAbp.WebGateway;
{
[DependsOn( [DependsOn(
typeof(EShopOnAbpSharedHostingGatewaysModule) typeof(EShopOnAbpSharedHostingGatewaysModule)
)] )]
public class EShopOnAbpWebGatewayModule : AbpModule public class EShopOnAbpWebGatewayModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{ var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment(); SwaggerWithAuthConfigurationHelper.Configure(
context: context,
SwaggerWithAuthConfigurationHelper.Configure( authority: configuration["AuthServer:Authority"],
context: context, scopes: new
authority: configuration["AuthServer:Authority"], Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{ "AccountService", "Account Service API" }, {"AccountService", "Account Service API"},
{ "IdentityService", "Identity Service API" }, {"IdentityService", "Identity Service API"},
{ "AdministrationService", "Administration Service API" }, {"AdministrationService", "Administration Service API"},
{ "CatalogService", "Catalog Service API" }, {"CatalogService", "Catalog Service API"},
{ "BasketService", "Basket Service API" }, {"BasketService", "Basket Service API"},
{ "PaymentService", "Payment Service API" }, {"PaymentService", "Payment Service API"},
{ "OrderingService", "Ordering Service API" }, {"OrderingService", "Ordering Service API"},
}, },
apiTitle: "Web Gateway" apiTitle: "Web Gateway"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{ {
options.AddDefaultPolicy(builder => builder
{ .WithOrigins(
builder configuration["App:CorsOrigins"]
.WithOrigins( .Split(",", StringSplitOptions.RemoveEmptyEntries)
configuration["App:CorsOrigins"] .Select(o => o.Trim().RemovePostFix("/"))
.Split(",", StringSplitOptions.RemoveEmptyEntries) .ToArray()
.Select(o => o.Trim().RemovePostFix("/")) )
.ToArray() .WithAbpExposedHeaders()
) .SetIsOriginAllowedToAllowWildcardSubdomains()
.WithAbpExposedHeaders() .AllowAnyHeader()
.SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyMethod()
.AllowAnyHeader() .AllowCredentials();
.AllowAnyMethod()
.AllowCredentials();
});
}); });
} });
}
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{ {
var app = context.GetApplicationBuilder(); app.UseDeveloperExceptionPage();
var env = context.GetEnvironment(); }
if (env.IsDevelopment()) app.UseCorrelationId();
{ app.UseAbpSerilogEnrichers();
app.UseDeveloperExceptionPage(); app.UseCors();
} app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
var routes = configuration.GetSection("Routes").Get<List<OcelotConfiguration>>();
var routedServices = routes
.GroupBy(t => t.ServiceKey)
.Select(r => r.First())
.Distinct();
app.UseCorrelationId(); foreach (var config in routedServices)
app.UseAbpSerilogEnrichers();
app.UseCors();
app.UseSwagger();
app.UseSwaggerUI(options =>
{ {
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>(); var url =
var routes = configuration.GetSection("Routes").Get<List<OcelotConfiguration>>(); $"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
var routedServices = routes if (!env.IsDevelopment())
.GroupBy(t => t.ServiceKey)
.Select(r => r.First())
.Distinct();
foreach (var config in routedServices)
{
var url =
$"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
if (!env.IsDevelopment())
{
url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
}
options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
}
});
app.MapWhen(
ctx => ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
app2 =>
{ {
app2.UseRouting(); url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
app2.UseConfiguredEndpoints();
} }
);
app.UseOcelot().Wait(); options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
} options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
}
});
app.MapWhen(
ctx => ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
app2 =>
{
app2.UseRouting();
app2.UseConfiguredEndpoints();
}
);
app.UseOcelot().Wait();
} }
} }

60
gateways/web/src/EShopOnAbp.WebGateway/Program.cs

@ -1,46 +1,36 @@
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
namespace EShopOnAbp.WebGateway namespace EShopOnAbp.WebGateway;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper.BuildApplicationAsync<EShopOnAbpWebGatewayModule>(args);
return 0; await app.InitializeApplicationAsync();
} await app.RunAsync();
catch (Exception ex)
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) }
.UseAutofac() finally
.UseSerilog(); {
Log.CloseAndFlush();
}
} }
} }

19
gateways/web/src/EShopOnAbp.WebGateway/Startup.cs

@ -1,19 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.WebGateway
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<EShopOnAbpWebGatewayModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.InitializeApplication();
}
}
}

6
services/administration/src/EShopOnAbp.AdministrationService.Application.Contracts/EShopOnAbp.AdministrationService.Application.Contracts.csproj

@ -11,9 +11,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="5.1.2" />
</ItemGroup> </ItemGroup>

6
services/administration/src/EShopOnAbp.AdministrationService.Application/EShopOnAbp.AdministrationService.Application.csproj

@ -11,9 +11,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.Application" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

8
services/administration/src/EShopOnAbp.AdministrationService.Domain.Shared/EShopOnAbp.AdministrationService.Domain.Shared.csproj

@ -11,10 +11,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

12
services/administration/src/EShopOnAbp.AdministrationService.Domain/EShopOnAbp.AdministrationService.Domain.csproj

@ -10,12 +10,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain" Version="5.1.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="5.1.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

12
services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EShopOnAbp.AdministrationService.EntityFrameworkCore.csproj

@ -13,12 +13,12 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EShopOnAbp.AdministrationService.Domain\EShopOnAbp.AdministrationService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.AdministrationService.Domain\EShopOnAbp.AdministrationService.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.1.2" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="5.1.2" />
<PackageReference Include="Volo.Abp.BlobStoring.Database.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.BlobStoring.Database.EntityFrameworkCore" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

6
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Client/EShopOnAbp.AdministrationService.HttpApi.Client.csproj

@ -10,9 +10,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.HttpApi.Client" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

168
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using EShopOnAbp.AdministrationService.DbMigrations; using EShopOnAbp.AdministrationService.DbMigrations;
using EShopOnAbp.AdministrationService.EntityFrameworkCore; using EShopOnAbp.AdministrationService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
@ -17,104 +18,97 @@ using Volo.Abp.Identity;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
namespace EShopOnAbp.AdministrationService namespace EShopOnAbp.AdministrationService;
[DependsOn(
typeof(AdministrationServiceHttpApiModule),
typeof(AdministrationServiceApplicationModule),
typeof(AdministrationServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpIdentityHttpApiClientModule)
)]
public class AdministrationServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(AdministrationServiceHttpApiModule),
typeof(AdministrationServiceApplicationModule),
typeof(AdministrationServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpIdentityHttpApiClientModule)
)]
public class AdministrationServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{
var configuration = context.Services.GetConfiguration(); JwtBearerConfigurationHelper.Configure(context, "AdministrationService");
JwtBearerConfigurationHelper.Configure(context, "AdministrationService"); SwaggerWithAuthConfigurationHelper.Configure(
context: context,
SwaggerWithAuthConfigurationHelper.Configure( authority: configuration["AuthServer:Authority"],
context: context, scopes: new
authority: configuration["AuthServer:Authority"], Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{"AdministrationService", "Administration Service API"}, {"AdministrationService", "Administration Service API"}
}, },
apiTitle: "Administration Service API" apiTitle: "Administration Service API"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{ {
options.AddDefaultPolicy(builder => builder
{ .WithOrigins(
builder configuration["App:CorsOrigins"]
.WithOrigins( .Split(",", StringSplitOptions.RemoveEmptyEntries)
configuration["App:CorsOrigins"] .Select(o => o.Trim().RemovePostFix("/"))
.Split(",", StringSplitOptions.RemoveEmptyEntries) .ToArray()
.Select(o => o.Trim().RemovePostFix("/")) )
.ToArray() .WithAbpExposedHeaders()
) .SetIsOriginAllowedToAllowWildcardSubdomains()
.WithAbpExposedHeaders() .AllowAnyHeader()
.SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyMethod()
.AllowAnyHeader() .AllowCredentials();
.AllowAnyMethod()
.AllowCredentials();
});
}); });
} });
public override void OnApplicationInitialization(ApplicationInitializationContext context) }
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment()) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
app.UseDeveloperExceptionPage(); var app = context.GetApplicationBuilder();
} var env = context.GetEnvironment();
app.UseCorrelationId(); if (env.IsDevelopment())
app.UseCors(); {
app.UseAbpRequestLocalization(); app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Administration Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
} }
public override void OnPostApplicationInitialization(ApplicationInitializationContext context) app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{ {
using (var scope = context.ServiceProvider.CreateScope()) var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "Administration Service API");
AsyncHelper.RunSync( options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
() => scope.ServiceProvider options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
.GetRequiredService<AdministrationServiceDatabaseMigrationChecker>() });
.CheckAsync() app.UseAbpSerilogEnrichers();
); app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
//Log.Information("Sending event..."); public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<AdministrationServiceDatabaseMigrationChecker>()
.CheckAsync();
}
//AsyncHelper.RunSync( public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
// () => scope.ServiceProvider {
// .GetRequiredService<IDistributedEventBus>() AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
// .PublishAsync(new TenantCreatedEto { Id = Guid.Empty, Name = "Sample" })
// );
}
}
} }
} }

8
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj

@ -7,15 +7,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.1.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

61
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Program.cs

@ -1,46 +1,37 @@
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
namespace EShopOnAbp.AdministrationService namespace EShopOnAbp.AdministrationService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper
return 0; .BuildApplicationAsync<AdministrationServiceHttpApiHostModule>(args);
} await app.InitializeApplicationAsync();
catch (Exception ex) await app.RunAsync();
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) }
.UseAutofac() finally
.UseSerilog(); {
Log.CloseAndFlush();
}
} }
} }

18
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/Startup.cs

@ -1,18 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.AdministrationService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AdministrationServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app)
{
app.InitializeApplication();
}
}
}

6
services/administration/src/EShopOnAbp.AdministrationService.HttpApi/EShopOnAbp.AdministrationService.HttpApi.csproj

@ -10,9 +10,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="5.1.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="5.1.2" />
<PackageReference Include="Volo.Abp.SettingManagement.HttpApi" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.SettingManagement.HttpApi" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/administration/test/EShopOnAbp.AdministrationService.EntityFrameworkCore.Tests/EShopOnAbp.AdministrationService.EntityFrameworkCore.Tests.csproj

@ -8,7 +8,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\EShopOnAbp.AdministrationService.EntityFrameworkCore\EShopOnAbp.AdministrationService.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.AdministrationService.EntityFrameworkCore\EShopOnAbp.AdministrationService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopOnAbp.AdministrationService.TestBase\EShopOnAbp.AdministrationService.TestBase.csproj" /> <ProjectReference Include="..\EShopOnAbp.AdministrationService.TestBase\EShopOnAbp.AdministrationService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

6
services/administration/test/EShopOnAbp.AdministrationService.TestBase/EShopOnAbp.AdministrationService.TestBase.csproj

@ -5,9 +5,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.TestBase" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.AdministrationService.Domain\EShopOnAbp.AdministrationService.Domain.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.AdministrationService.Domain\EShopOnAbp.AdministrationService.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
services/basket/src/EShopOnAbp.BasketService.Application.Contracts/EShopOnAbp.BasketService.Application.Contracts.csproj

@ -12,8 +12,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

4
services/basket/src/EShopOnAbp.BasketService.Application/EShopOnAbp.BasketService.Application.csproj

@ -14,8 +14,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/basket/src/EShopOnAbp.BasketService.Domain.Shared/EShopOnAbp.BasketService.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Validation" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

4
services/basket/src/EShopOnAbp.BasketService.Domain/EShopOnAbp.BasketService.Domain.csproj

@ -12,8 +12,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Caching" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Caching" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/basket/src/EShopOnAbp.BasketService.HttpApi.Client/EShopOnAbp.BasketService.HttpApi.Client.csproj

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

156
services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/BasketServiceHttpApiHostModule.cs

@ -13,98 +13,96 @@ using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace EShopOnAbp.BasketService namespace EShopOnAbp.BasketService;
[DependsOn(
typeof(BasketServiceHttpApiModule),
typeof(BasketServiceApplicationModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class BasketServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(BasketServiceHttpApiModule),
typeof(BasketServiceApplicationModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class BasketServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment();
JwtBearerConfigurationHelper.Configure(context, var configuration = context.Services.GetConfiguration();
"AdministrationService"); //TODO: Should be "BasketService", but didn't work :( var hostingEnvironment = context.Services.GetHostingEnvironment();
SwaggerWithAuthConfigurationHelper.Configure( JwtBearerConfigurationHelper.Configure(context, "BasketService");
context: context,
authority: configuration["AuthServer:Authority"],
scopes: new
Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{
{"BasketService", "Catalog Service API"},
},
apiTitle: "Basket Service API"
);
context.Services.AddCors(options => SwaggerWithAuthConfigurationHelper.Configure(
{ context: context,
options.AddDefaultPolicy(builder => authority: configuration["AuthServer:Authority"],
scopes: new
Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
builder {"BasketService", "Basket Service API"}
.WithOrigins( },
configuration["App:CorsOrigins"] apiTitle: "Basket Service API"
.Split(",", StringSplitOptions.RemoveEmptyEntries) );
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
Configure<AbpAspNetCoreMvcOptions>(options => context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{ {
options.ConventionalControllers.Create( builder
typeof(BasketServiceApplicationModule).Assembly, opts => .WithOrigins(
{ configuration["App:CorsOrigins"]
opts.RootPath = "basket"; .Split(",", StringSplitOptions.RemoveEmptyEntries)
opts.RemoteServiceName = "Basket"; .Select(o => o.Trim().RemovePostFix("/"))
}); .ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
}); });
});
Configure<AbpAntiForgeryOptions>(options => { options.AutoValidate = false; }); Configure<AbpAspNetCoreMvcOptions>(options =>
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); options.ConventionalControllers.Create(
var env = context.GetEnvironment(); typeof(BasketServiceApplicationModule).Assembly, opts =>
{
opts.RootPath = "basket";
opts.RemoteServiceName = "Basket";
});
});
if (env.IsDevelopment()) Configure<AbpAntiForgeryOptions>(options => { options.AutoValidate = false; });
{ }
app.UseDeveloperExceptionPage();
}
app.UseCorrelationId(); public override void OnApplicationInitialization(ApplicationInitializationContext context)
app.UseCors(); {
app.UseAbpRequestLocalization(); var app = context.GetApplicationBuilder();
app.UseStaticFiles(); var env = context.GetEnvironment();
app.UseRouting();
app.UseAuthentication(); if (env.IsDevelopment())
app.UseAbpClaimsMap(); {
app.UseAuthorization(); app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Basket Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
} }
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Basket Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
} }
} }

75
services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Program.cs

@ -1,56 +1,37 @@
using System; using System;
using Microsoft.AspNetCore.Hosting; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.Extensions.Hosting; using Microsoft.AspNetCore.Builder;
using Serilog; using Serilog;
using Serilog.Events;
namespace EShopOnAbp.BasketService namespace EShopOnAbp.BasketService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static int Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName);
try
{ {
Log.Logger = new LoggerConfiguration() Log.Information($"Starting {assemblyName}.");
#if DEBUG var app = await ApplicationBuilderHelper
.MinimumLevel.Debug() .BuildApplicationAsync<BasketServiceHttpApiHostModule>(args);
#else await app.InitializeApplicationAsync();
.MinimumLevel.Information() await app.RunAsync();
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try return 0;
{ }
Log.Information("Starting EShopOnAbp.BasketService.HttpApi.Host."); catch (Exception ex)
CreateHostBuilder(args).Build().Run(); {
return 0; Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
} return 1;
catch (Exception ex) }
{ finally
Log.Fatal(ex, "Host terminated unexpectedly!"); {
return 1; Log.CloseAndFlush();
}
finally
{
Log.CloseAndFlush();
}
} }
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
} }
} }

20
services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Startup.cs

@ -1,20 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace EShopOnAbp.BasketService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BasketServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

2
services/basket/src/EShopOnAbp.BasketService.HttpApi/EShopOnAbp.BasketService.HttpApi.csproj

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/basket/test/EShopOnAbp.BasketService.EntityFrameworkCore.Tests/EShopOnAbp.BasketService.EntityFrameworkCore.Tests.csproj

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EShopOnAbp.BasketService.TestBase\EShopOnAbp.BasketService.TestBase.csproj" /> <ProjectReference Include="..\EShopOnAbp.BasketService.TestBase\EShopOnAbp.BasketService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
services/basket/test/EShopOnAbp.BasketService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.BasketService.HttpApi.Client.ConsoleTestApp.csproj

@ -19,7 +19,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.BasketService.HttpApi.Client\EShopOnAbp.BasketService.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.BasketService.HttpApi.Client\EShopOnAbp.BasketService.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

6
services/basket/test/EShopOnAbp.BasketService.TestBase/EShopOnAbp.BasketService.TestBase.csproj

@ -8,9 +8,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.TestBase" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.BasketService.Domain\EShopOnAbp.BasketService.Domain.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.BasketService.Domain\EShopOnAbp.BasketService.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
services/catalog/src/EShopOnAbp.CatalogService.Application.Contracts/EShopOnAbp.CatalogService.Application.Contracts.csproj

@ -12,8 +12,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/catalog/src/EShopOnAbp.CatalogService.Application/EShopOnAbp.CatalogService.Application.csproj

@ -13,7 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/catalog/src/EShopOnAbp.CatalogService.Domain.Shared/EShopOnAbp.CatalogService.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Validation" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

4
services/catalog/src/EShopOnAbp.CatalogService.Domain/EShopOnAbp.CatalogService.Domain.csproj

@ -12,8 +12,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Client/EShopOnAbp.CatalogService.HttpApi.Client.csproj

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

182
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs

@ -8,6 +8,7 @@ using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using EShopOnAbp.CatalogService.MongoDB; using EShopOnAbp.CatalogService.MongoDB;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Volo.Abp; using Volo.Abp;
@ -17,114 +18,111 @@ using Volo.Abp.Modularity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Uow; using Volo.Abp.Uow;
namespace EShopOnAbp.CatalogService namespace EShopOnAbp.CatalogService;
[DependsOn(
typeof(CatalogServiceHttpApiModule),
typeof(CatalogServiceApplicationModule),
typeof(CatalogServiceMongoDbModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class CatalogServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(CatalogServiceHttpApiModule),
typeof(CatalogServiceApplicationModule),
typeof(CatalogServiceMongoDbModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class CatalogServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{
var configuration = context.Services.GetConfiguration();
JwtBearerConfigurationHelper.Configure(context, "CatalogService"); JwtBearerConfigurationHelper.Configure(context, "CatalogService");
SwaggerWithAuthConfigurationHelper.Configure( SwaggerWithAuthConfigurationHelper.Configure(
context: context, context: context,
authority: configuration["AuthServer:Authority"], authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */ scopes: new
Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{"CatalogService", "Catalog Service API"}, {"CatalogService", "Catalog Service API"}
}, },
apiTitle: "Catalog Service API" apiTitle: "Catalog Service API"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{ {
options.AddDefaultPolicy(builder => options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(CatalogServiceApplicationModule).Assembly, opts =>
{
opts.RootPath = "catalog";
opts.RemoteServiceName = "Catalog";
});
});
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{ {
//Standalone MongoDB servers don't support transactions builder
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; .WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
}); });
});
Configure<AbpAntiForgeryOptions>(options =>
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(CatalogServiceApplicationModule).Assembly, opts =>
{ {
options.AutoValidate = false; opts.RootPath = "catalog";
opts.RemoteServiceName = "Catalog";
}); });
} });
public override void OnApplicationInitialization(ApplicationInitializationContext context) Configure<AbpUnitOfWorkDefaultOptions>(options =>
{ {
var app = context.GetApplicationBuilder(); //Standalone MongoDB servers don't support transactions
var env = context.GetEnvironment(); options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
if (env.IsDevelopment()) Configure<AbpAntiForgeryOptions>(options => { options.AutoValidate = false; });
{ }
app.UseDeveloperExceptionPage();
}
app.UseCorrelationId(); public override void OnApplicationInitialization(ApplicationInitializationContext context)
app.UseCors(); {
app.UseAbpRequestLocalization(); var app = context.GetApplicationBuilder();
app.UseStaticFiles(); var env = context.GetEnvironment();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Catalog Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context) if (env.IsDevelopment())
{ {
using (var scope = context.ServiceProvider.CreateScope()) app.UseDeveloperExceptionPage();
{
AsyncHelper.RunSync(
() => scope.ServiceProvider
.GetRequiredService<CatalogServiceDatabaseMigrationChecker>()
.CheckAsync()
);
}
} }
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Catalog Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<CatalogServiceDatabaseMigrationChecker>()
.CheckAsync();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
} }
} }

75
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Program.cs

@ -1,56 +1,37 @@
using System; using System;
using Microsoft.AspNetCore.Hosting; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.Extensions.Hosting; using Microsoft.AspNetCore.Builder;
using Serilog; using Serilog;
using Serilog.Events;
namespace EShopOnAbp.CatalogService namespace EShopOnAbp.CatalogService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static int Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName);
try
{ {
Log.Logger = new LoggerConfiguration() Log.Information($"Starting {assemblyName}.");
#if DEBUG var app = await ApplicationBuilderHelper
.MinimumLevel.Debug() .BuildApplicationAsync<CatalogServiceHttpApiHostModule>(args);
#else await app.InitializeApplicationAsync();
.MinimumLevel.Information() await app.RunAsync();
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try return 0;
{ }
Log.Information("Starting EShopOnAbp.CatalogService.HttpApi.Host."); catch (Exception ex)
CreateHostBuilder(args).Build().Run(); {
return 0; Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
} return 1;
catch (Exception ex) }
{ finally
Log.Fatal(ex, "Host terminated unexpectedly!"); {
return 1; Log.CloseAndFlush();
}
finally
{
Log.CloseAndFlush();
}
} }
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
} }
} }

20
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Startup.cs

@ -1,20 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace EShopOnAbp.CatalogService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<CatalogServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

2
services/catalog/src/EShopOnAbp.CatalogService.HttpApi/EShopOnAbp.CatalogService.HttpApi.csproj

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/catalog/src/EShopOnAbp.CatalogService.MongoDB/EShopOnAbp.CatalogService.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.MongoDB" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.CatalogService.Domain\EShopOnAbp.CatalogService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.CatalogService.Domain\EShopOnAbp.CatalogService.Domain.csproj" />
</ItemGroup> </ItemGroup>

2
services/catalog/test/EShopOnAbp.CatalogService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.CatalogService.HttpApi.Client.ConsoleTestApp.csproj

@ -19,7 +19,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.CatalogService.HttpApi.Client\EShopOnAbp.CatalogService.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.CatalogService.HttpApi.Client\EShopOnAbp.CatalogService.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

8
services/catalog/test/EShopOnAbp.CatalogService.TestBase/EShopOnAbp.CatalogService.TestBase.csproj

@ -8,10 +8,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.TestBase" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.CatalogService.Domain\EShopOnAbp.CatalogService.Domain.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.CatalogService.Domain\EShopOnAbp.CatalogService.Domain.csproj" />
</ItemGroup> </ItemGroup>

2
services/identity/src/EShopOnAbp.IdentityService.Application.Contracts/EShopOnAbp.IdentityService.Application.Contracts.csproj

@ -10,7 +10,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/identity/src/EShopOnAbp.IdentityService.Application/EShopOnAbp.IdentityService.Application.csproj

@ -11,7 +11,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.Application" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

4
services/identity/src/EShopOnAbp.IdentityService.Domain.Shared/EShopOnAbp.IdentityService.Domain.Shared.csproj

@ -10,8 +10,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="5.1.2" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

4
services/identity/src/EShopOnAbp.IdentityService.Domain/EShopOnAbp.IdentityService.Domain.csproj

@ -10,8 +10,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.Domain" Version="5.1.2" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

6
services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EShopOnAbp.IdentityService.EntityFrameworkCore.csproj

@ -16,9 +16,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="5.1.2" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Client/EShopOnAbp.IdentityService.HttpApi.Client.csproj

@ -10,7 +10,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

155
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using EShopOnAbp.IdentityService.DbMigrations; using EShopOnAbp.IdentityService.DbMigrations;
using EShopOnAbp.IdentityService.EntityFrameworkCore; using EShopOnAbp.IdentityService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
@ -15,96 +16,96 @@ using Volo.Abp;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
namespace EShopOnAbp.IdentityService namespace EShopOnAbp.IdentityService;
[DependsOn(
typeof(EShopOnAbpSharedHostingMicroservicesModule),
typeof(IdentityServiceHttpApiModule),
typeof(IdentityServiceApplicationModule),
typeof(IdentityServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingGatewaysModule)
)]
public class IdentityServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(EShopOnAbpSharedHostingMicroservicesModule),
typeof(IdentityServiceHttpApiModule),
typeof(IdentityServiceApplicationModule),
typeof(IdentityServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingGatewaysModule)
)]
public class IdentityServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{
var configuration = context.Services.GetConfiguration(); JwtBearerConfigurationHelper.Configure(context, "IdentityService");
JwtBearerConfigurationHelper.Configure(context, "IdentityService"); SwaggerWithAuthConfigurationHelper.Configure(
context: context,
SwaggerWithAuthConfigurationHelper.Configure( authority: configuration["AuthServer:Authority"],
context: context, scopes: new
authority: configuration["AuthServer:Authority"], Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{"IdentityService", "Identity Service API"} {"IdentityService", "Identity Service API"}
}, },
apiTitle: "IdentityService Gateway API" apiTitle: "IdentityService Gateway API"
); );
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context) context.Services.AddCors(options =>
{ {
var app = context.GetApplicationBuilder(); options.AddDefaultPolicy(builder =>
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{ {
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>(); builder
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); .WithOrigins(
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); configuration["App:CorsOrigins"]
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); .Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
}); });
app.UseAbpSerilogEnrichers(); });
app.UseAuditing(); }
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{ {
using (var scope = context.ServiceProvider.CreateScope()) app.UseDeveloperExceptionPage();
{
AsyncHelper.RunSync(
() => scope.ServiceProvider
.GetRequiredService<IdentityServiceDatabaseMigrationChecker>()
.CheckAsync()
);
}
} }
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<IdentityServiceDatabaseMigrationChecker>()
.CheckAsync();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
} }
} }

61
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Program.cs

@ -1,46 +1,37 @@
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
namespace EShopOnAbp.IdentityService namespace EShopOnAbp.IdentityService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static async Task<int> Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName); SerilogConfigurationHelper.Configure(assemblyName);
try try
{ {
Log.Information($"Starting {assemblyName}."); Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync(); var app = await ApplicationBuilderHelper
return 0; .BuildApplicationAsync<IdentityServiceHttpApiHostModule>(args);
} await app.InitializeApplicationAsync();
catch (Exception ex) await app.RunAsync();
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) => return 0;
Host.CreateDefaultBuilder(args) }
.ConfigureAppConfiguration(build => catch (Exception ex)
{ {
build.AddJsonFile("appsettings.secrets.json", optional: true); Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
}) return 1;
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }) }
.UseAutofac() finally
.UseSerilog(); {
Log.CloseAndFlush();
}
} }
} }

18
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/Startup.cs

@ -1,18 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.IdentityService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<IdentityServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app)
{
app.InitializeApplication();
}
}
}

2
services/identity/src/EShopOnAbp.IdentityService.HttpApi/EShopOnAbp.IdentityService.HttpApi.csproj

@ -10,7 +10,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.HttpApi" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/identity/test/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests/EShopOnAbp.IdentityService.EntityFrameworkCore.Tests.csproj

@ -8,7 +8,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\EShopOnAbp.IdentityService.EntityFrameworkCore\EShopOnAbp.IdentityService.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.IdentityService.EntityFrameworkCore\EShopOnAbp.IdentityService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopOnAbp.IdentityService.TestBase\EShopOnAbp.IdentityService.TestBase.csproj" /> <ProjectReference Include="..\EShopOnAbp.IdentityService.TestBase\EShopOnAbp.IdentityService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

6
services/identity/test/EShopOnAbp.IdentityService.TestBase/EShopOnAbp.IdentityService.TestBase.csproj

@ -6,9 +6,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.TestBase" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.IdentityService.Domain\EShopOnAbp.IdentityService.Domain.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.IdentityService.Domain\EShopOnAbp.IdentityService.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/EShopOnAbp.OrderingService.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Domain.Shared\EShopOnAbp.OrderingService.Domain.Shared.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Domain.Shared\EShopOnAbp.OrderingService.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

4
services/ordering/src/EShopOnAbp.OrderingService.Application/EShopOnAbp.OrderingService.Application.csproj

@ -8,8 +8,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
services/ordering/src/EShopOnAbp.OrderingService.Domain.Shared/EShopOnAbp.OrderingService.Domain.Shared.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" /> <Import Project="..\..\..\..\common.props" />
@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Validation" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
services/ordering/src/EShopOnAbp.OrderingService.Domain/EShopOnAbp.OrderingService.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Domain.Shared\EShopOnAbp.OrderingService.Domain.Shared.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Domain.Shared\EShopOnAbp.OrderingService.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

2
services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EShopOnAbp.OrderingService.EntityFrameworkCore.csproj

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

4
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj

@ -10,8 +10,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

172
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs

@ -9,112 +9,112 @@ using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
namespace EShopOnAbp.OrderingService namespace EShopOnAbp.OrderingService;
[DependsOn(
typeof(OrderingServiceHttpApiModule),
typeof(OrderingServiceApplicationModule),
typeof(OrderingServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class OrderingServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(OrderingServiceHttpApiModule),
typeof(OrderingServiceApplicationModule),
typeof(OrderingServiceEntityFrameworkCoreModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class OrderingServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration();
{ var hostingEnvironment = context.Services.GetHostingEnvironment();
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
JwtBearerConfigurationHelper.Configure(context, "OrderingService"); JwtBearerConfigurationHelper.Configure(context, "OrderingService");
SwaggerWithAuthConfigurationHelper.Configure( SwaggerWithAuthConfigurationHelper.Configure(
context: context, context: context,
authority: configuration["AuthServer:Authority"], authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */ scopes: new
Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{"OrderingService", "Ordering Service API"}, {"OrderingService", "Ordering Service API"}
}, },
apiTitle: "Ordering Service API" apiTitle: "Ordering Service API"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{ {
options.AddDefaultPolicy(builder => options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
// TODO: Crate controller instead of auto-controller configuration
Configure<AbpAspNetCoreMvcOptions>(options =>
{ {
options.ConventionalControllers.Create(typeof(OrderingServiceApplicationModule).Assembly, opts => builder
{ .WithOrigins(
opts.RootPath = "ordering"; configuration["App:CorsOrigins"]
opts.RemoteServiceName = "Ordering"; .Split(",", StringSplitOptions.RemoveEmptyEntries)
}); .Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
}); });
} });
public override void OnApplicationInitialization(ApplicationInitializationContext context) // TODO: Crate controller instead of auto-controller configuration
Configure<AbpAspNetCoreMvcOptions>(options =>
{ {
var app = context.GetApplicationBuilder(); options.ConventionalControllers.Create(typeof(OrderingServiceApplicationModule).Assembly, opts =>
var env = context.GetEnvironment();
if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); opts.RootPath = "ordering";
} opts.RemoteServiceName = "Ordering";
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Ordering Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
}); });
app.UseAbpSerilogEnrichers(); });
app.UseAuditing(); }
app.UseUnitOfWork();
app.UseConfiguredEndpoints(); public override void OnApplicationInitialization(ApplicationInitializationContext context)
} {
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
public override void OnPostApplicationInitialization(ApplicationInitializationContext context) if (env.IsDevelopment())
{ {
using (var scope = context.ServiceProvider.CreateScope()) app.UseDeveloperExceptionPage();
{
AsyncHelper.RunSync(
() => scope.ServiceProvider
.GetRequiredService<OrderingServiceDatabaseMigrationChecker>()
.CheckAsync()
);
}
} }
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Ordering Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}
public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<OrderingServiceDatabaseMigrationChecker>()
.CheckAsync();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
} }
} }

75
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Program.cs

@ -1,56 +1,37 @@
using System; using System;
using System.IO; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.Extensions.Configuration; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events;
namespace EShopOnAbp.OrderingService namespace EShopOnAbp.OrderingService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static int Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName);
try
{ {
Log.Logger = new LoggerConfiguration() Log.Information($"Starting {assemblyName}.");
#if DEBUG var app = await ApplicationBuilderHelper
.MinimumLevel.Debug() .BuildApplicationAsync<OrderingServiceHttpApiHostModule>(args);
#else await app.InitializeApplicationAsync();
.MinimumLevel.Information() await app.RunAsync();
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try return 0;
{ }
Log.Information("Starting web host."); catch (Exception ex)
CreateHostBuilder(args).Build().Run(); {
return 0; Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
} return 1;
catch (Exception ex) }
{ finally
Log.Fatal(ex, "Host terminated unexpectedly!"); {
return 1; Log.CloseAndFlush();
}
finally
{
Log.CloseAndFlush();
}
} }
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
} }
} }

20
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Startup.cs

@ -1,20 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace EShopOnAbp.OrderingService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<OrderingServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

2
services/ordering/src/EShopOnAbp.OrderingService.HttpApi/EShopOnAbp.OrderingService.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.Application.Contracts\EShopOnAbp.OrderingService.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

2
services/ordering/test/EShopOnAbp.OrderingService.EntityFrameworkCore.Tests/EShopOnAbp.OrderingService.EntityFrameworkCore.Tests.csproj

@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" />
<ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.EntityFrameworkCore\EShopOnAbp.OrderingService.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.EntityFrameworkCore\EShopOnAbp.OrderingService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopOnAbp.OrderingService.TestBase\EShopOnAbp.OrderingService.TestBase.csproj" /> <ProjectReference Include="..\EShopOnAbp.OrderingService.TestBase\EShopOnAbp.OrderingService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/ordering/test/EShopOnAbp.OrderingService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.OrderingService.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.HttpApi.Client\EShopOnAbp.OrderingService.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.HttpApi.Client\EShopOnAbp.OrderingService.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

6
services/ordering/test/EShopOnAbp.OrderingService.TestBase/EShopOnAbp.OrderingService.TestBase.csproj

@ -14,9 +14,9 @@
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" /> <PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.TestBase" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.OrderingService.Domain\EShopOnAbp.OrderingService.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/EShopOnAbp.PaymentService.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Authorization" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

4
services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj

@ -9,8 +9,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="PayPalCheckoutSdk" Version="1.0.4" /> <PackageReference Include="PayPalCheckoutSdk" Version="1.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Application" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" />
</ItemGroup> </ItemGroup>

2
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/EShopOnAbp.PaymentService.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Validation" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

2
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EShopOnAbp.PaymentService.EntityFrameworkCore.csproj

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/EShopOnAbp.PaymentService.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

161
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs

@ -9,102 +9,103 @@ using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
namespace EShopOnAbp.PaymentService namespace EShopOnAbp.PaymentService;
[DependsOn(
typeof(PaymentServiceApplicationModule),
typeof(PaymentServiceEntityFrameworkCoreModule),
typeof(PaymentServiceHttpApiModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class PaymentServiceHttpApiHostModule : AbpModule
{ {
[DependsOn( public override void ConfigureServices(ServiceConfigurationContext context)
typeof(PaymentServiceApplicationModule),
typeof(PaymentServiceEntityFrameworkCoreModule),
typeof(PaymentServiceHttpApiModule),
typeof(EShopOnAbpSharedHostingMicroservicesModule)
)]
public class PaymentServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true; var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
JwtBearerConfigurationHelper.Configure(context, "PaymentService");
SwaggerWithAuthConfigurationHelper.Configure( JwtBearerConfigurationHelper.Configure(context, "PaymentService");
context: context,
authority: configuration["AuthServer:Authority"], SwaggerWithAuthConfigurationHelper.Configure(
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */ context: context,
authority: configuration["AuthServer:Authority"],
scopes: new
Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{ {
{"PaymentService", "Payment Service API"}, {"PaymentService", "Payment Service API"}
}, },
apiTitle: "Payment Service API" apiTitle: "Payment Service API"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{ {
options.AddDefaultPolicy(builder => builder
{ .WithOrigins(
builder configuration["App:CorsOrigins"]
.WithOrigins( .Split(",", StringSplitOptions.RemoveEmptyEntries)
configuration["App:CorsOrigins"] .Select(o => o.Trim().RemovePostFix("/"))
.Split(",", StringSplitOptions.RemoveEmptyEntries) .ToArray()
.Select(o => o.Trim().RemovePostFix("/")) )
.ToArray() .WithAbpExposedHeaders()
) .SetIsOriginAllowedToAllowWildcardSubdomains()
.WithAbpExposedHeaders() .AllowAnyHeader()
.SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyMethod()
.AllowAnyHeader() .AllowCredentials();
.AllowAnyMethod()
.AllowCredentials();
});
}); });
} });
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment()) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
app.UseDeveloperExceptionPage(); var app = context.GetApplicationBuilder();
} var env = context.GetEnvironment();
app.UseCorrelationId(); if (env.IsDevelopment())
app.UseCors(); {
app.UseAbpRequestLocalization(); app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Payment Service API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
} }
public override void OnPostApplicationInitialization(ApplicationInitializationContext context) app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{ {
using (var scope = context.ServiceProvider.CreateScope()) var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "Payment Service API");
AsyncHelper.RunSync( options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
() => scope.ServiceProvider options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
.GetRequiredService<PaymentServiceDatabaseMigrationChecker>() });
.CheckAsync() app.UseAbpSerilogEnrichers();
); app.UseAuditing();
} app.UseUnitOfWork();
} app.UseConfiguredEndpoints();
}
public override async Task OnPostApplicationInitializationAsync(ApplicationInitializationContext context)
{
await context.ServiceProvider
.GetRequiredService<PaymentServiceDatabaseMigrationChecker>()
.CheckAsync();
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
} }
} }

75
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Program.cs

@ -1,56 +1,37 @@
using System; using System;
using System.IO; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.Extensions.Configuration; using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events;
namespace EShopOnAbp.PaymentService namespace EShopOnAbp.PaymentService;
public class Program
{ {
public class Program public static async Task<int> Main(string[] args)
{ {
public static int Main(string[] args) var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName);
try
{ {
Log.Logger = new LoggerConfiguration() Log.Information($"Starting {assemblyName}.");
#if DEBUG var app = await ApplicationBuilderHelper
.MinimumLevel.Debug() .BuildApplicationAsync<PaymentServiceHttpApiHostModule>(args);
#else await app.InitializeApplicationAsync();
.MinimumLevel.Information() await app.RunAsync();
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try return 0;
{ }
Log.Information("Starting web host."); catch (Exception ex)
CreateHostBuilder(args).Build().Run(); {
return 0; Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
} return 1;
catch (Exception ex) }
{ finally
Log.Fatal(ex, "Host terminated unexpectedly!"); {
return 1; Log.CloseAndFlush();
}
finally
{
Log.CloseAndFlush();
}
} }
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
} }
} }

21
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Startup.cs

@ -1,21 +0,0 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace EShopOnAbp.PaymentService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<PaymentServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

2
services/payment/src/EShopOnAbp.PaymentService.HttpApi/EShopOnAbp.PaymentService.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.1.2" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

2
services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj

@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" />
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.EntityFrameworkCore\EShopOnAbp.PaymentService.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.EntityFrameworkCore\EShopOnAbp.PaymentService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.TestBase\EShopOnAbp.PaymentService.TestBase.csproj" /> <ProjectReference Include="..\EShopOnAbp.PaymentService.TestBase\EShopOnAbp.PaymentService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.1.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.0.0-rc.1" /> <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.1.2" />
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.HttpApi.Client\EShopOnAbp.PaymentService.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.HttpApi.Client\EShopOnAbp.PaymentService.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save