Browse Source

Merge

pull/20539/head
Mark Cilia Vincenti 2 years ago
parent
commit
52ee7cf45e
  1. 94
      .github/ISSUE_TEMPLATE/03_studio.yml
  2. 0
      .github/ISSUE_TEMPLATE/04_article_request.yml
  3. 0
      .github/ISSUE_TEMPLATE/05_performance_issue.md
  4. 0
      .github/ISSUE_TEMPLATE/06_blank_issue.md
  5. 3
      Directory.Packages.props
  6. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en-GB.json
  7. 9
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  8. 11
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
  9. 64
      docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/POST.md
  10. BIN
      docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/images/book.jpg
  11. BIN
      docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/images/cover.png
  12. 85
      docs/en/Community-Articles/2024-08-29-What-is-Angular-Schematics/Post.md
  13. BIN
      docs/en/Community-Articles/2024-08-29-What-is-Angular-Schematics/cover.png
  14. 123
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/Post.md
  15. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/coupled-tenants.png
  16. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/cover.png
  17. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/questions.png
  18. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/security-gdpr-db-retention.png
  19. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/shared-entity.png
  20. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/tenancy-schema.png
  21. BIN
      docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/user-multiple-membership.png
  22. 20
      docs/en/cli/index.md
  23. 18
      docs/en/docs-nav.json
  24. 4
      docs/en/framework/api-development/index.md
  25. 69
      docs/en/framework/infrastructure/background-jobs/hangfire.md
  26. 70
      docs/en/framework/infrastructure/blob-storing/google.md
  27. 1
      docs/en/framework/infrastructure/blob-storing/index.md
  28. 75
      docs/en/framework/infrastructure/data-filtering.md
  29. 2
      docs/en/framework/ui/angular/theming.md
  30. 2
      docs/en/framework/ui/mvc-razor-pages/overall.md
  31. 2
      docs/en/framework/ui/mvc-razor-pages/security-headers.md
  32. 2
      docs/en/framework/ui/mvc-razor-pages/theming.md
  33. 4
      docs/en/get-started/layered-web-application.md
  34. 2
      docs/en/get-started/microservice.md
  35. 4
      docs/en/get-started/single-layer-web-application.md
  36. 19
      docs/en/guides/migrating-from-open-source.md
  37. BIN
      docs/en/images/payment-module-subscription-flow.png
  38. 4
      docs/en/modules/audit-logging-pro.md
  39. 1
      docs/en/modules/cms-kit-pro/index.md
  40. 2
      docs/en/modules/database-tables.md
  41. 2
      docs/en/modules/identity.md
  42. 2
      docs/en/modules/payment.md
  43. 2
      docs/en/modules/text-template-management.md
  44. 7
      docs/en/release-info/migration-guides/abp-8-2.md
  45. 6
      docs/en/release-info/migration-guides/openiddict-step-by-step.md
  46. 2
      docs/en/release-info/release-notes.md
  47. 129
      docs/en/release-info/road-map.md
  48. 12
      docs/en/samples/index.md
  49. 6
      docs/en/solution-templates/microservice/adding-new-api-gateways.md
  50. 6
      docs/en/solution-templates/microservice/adding-new-applications.md
  51. 365
      docs/en/solution-templates/microservice/adding-new-microservices.md
  52. BIN
      docs/en/solution-templates/microservice/images/folder-structure.png
  53. 4
      docs/en/studio/concepts.md
  54. BIN
      docs/en/studio/images/abp-studio-switch-to-preview.png
  55. 2
      docs/en/studio/monitoring-applications.md
  56. 8
      docs/en/studio/overview.md
  57. 91
      docs/en/studio/release-notes.md
  58. 2
      docs/en/studio/solution-explorer.md
  59. 15
      docs/en/studio/version-compatibility.md
  60. 2
      docs/en/suite/generating-crud-page.md
  61. 16
      docs/en/tutorials/todo/layered/index.md
  62. 4
      docs/en/ui-themes/lepton-x/mvc.md
  63. 14
      framework/Volo.Abp.sln
  64. 29
      framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs
  65. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs
  66. 7
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  67. 16
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs
  68. 15
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs
  69. 6
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsOptions.cs
  70. 93
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs
  71. 6
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/IAbpMvcLibsService.cs
  72. 9
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/ApplicationInitializationContextExtensions.cs
  73. 19
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs
  74. 24
      framework/src/Volo.Abp.BlobStoring.Google/Volo.Abp.BlobStoring.Google.csproj
  75. 9
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleModule.cs
  76. 21
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/DefaultGoogleBlobNameCalculator.cs
  77. 24
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobContainerConfigurationExtensions.cs
  78. 120
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobNamingNormalizer.cs
  79. 161
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProvider.cs
  80. 79
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProviderConfiguration.cs
  81. 12
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProviderConfigurationNames.cs
  82. 6
      framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/IGoogleBlobNameCalculator.cs
  83. 28
      framework/src/Volo.Abp.Core/Volo/Abp/Http/UrlHelpers.cs
  84. 12
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs
  85. 9
      framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs
  86. 4
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs
  87. 16
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json
  88. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs
  89. 19
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo.Abp.BlobStoring.Google.Tests.csproj
  90. 19
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleTestBase.cs
  91. 90
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleTestModule.cs
  92. 94
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/DefaultGoogleBlobNamingNormalizerProvider_Tests.cs
  93. 13
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/GoogleBlobContainer_Tests.cs
  94. 56
      framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/GoogleBlobNameCalculator_Tests.cs
  95. 43
      framework/test/Volo.Abp.Core.Tests/Volo/Abp/Http/UrlHelpers_Tests.cs
  96. 22
      framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Domain/ExtraProperties_Tests.cs
  97. 4
      framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/City.cs
  98. 3
      framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs
  99. 3
      framework/test/Volo.Abp.TextTemplating.Razor.Tests/Volo/Abp/TextTemplating/Razor/RazorLocalizedTemplateContentReaderFactory_Tests.cs
  100. 3
      framework/test/Volo.Abp.TextTemplating.Scriban.Tests/Volo/Abp/TextTemplating/Scriban/ScribanLocalizedTemplateContentReaderFactory_Tests.cs

94
.github/ISSUE_TEMPLATE/03_studio.yml

@ -0,0 +1,94 @@
name: 🤠 ABP Studio
description: Create a report to help us improve the ABP Studio
labels: [studio]
body:
- type: markdown
attributes:
value: |
We welcome bug reports! This template will help us gather the information we need to start the triage process.
Please keep in mind that the GitHub issue tracker is not intended as a general support forum, but for reporting **non-security** bugs and feature requests.
If you believe you have an issue that affects the SECURITY of the platform, please do NOT create an issue and instead email your issue details to info@abp.io.
For other types of questions, consider using [StackOverflow](https://stackoverflow.com/questions/tagged/abp).
- type: checkboxes
id: searched
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered or feature request ([abp/issues](https://github.com/abpframework/abp/issues?q=is%3Aopen+is%3Aissue+label%3Astudio)).
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: background
attributes:
label: Description
description: Please share a clear and concise description of the problem.
placeholder: Description
validations:
required: true
- type: markdown
attributes:
value: |
## Setup
Please provide more information on your ABP Studio setup.
- type: input
id: version
attributes:
label: Version
description: Which version of ABP Studio are you using?
placeholder: Version
validations:
required: true
- type: dropdown
id: Operation-System
attributes:
label: Operation System
description: What is the operation system of the computer?
options:
- Windows (Default)
- Linux
- macOS
- Others
validations:
required: true
- type: textarea
id: solution-config
attributes:
label: Solution Configuration
description: |
If there is an open solution, what are the configurations of the solution?
🧐 Hint: You can see all the information about your solution from the configuration window, which opens when you right-click on the [solution](https://abp.io/docs/latest/studio/solution-explorer#solution) and click on the `Solution Configuration` button.
placeholder: |
- **Template**: app
- **Created ABP Studio Version**: 0.7.9
- **Tiered**: No
- **UI Framework**: mvc
- **Theme**: leptonx
- **Theme Style**: system
- **Database Provider**: ef
- **Database Management System**: sqlserver
- **Separate Tenant Schema**: No
- **Mobile Framework**: none
- **Public Website**: No
- **Optional Modules**:
* GDPR
* TextTemplateManagement
* LanguageManagement
* AuditLogging
* SaaS
* OpenIddictAdmin
validations:
required: false
- type: markdown
attributes:
value: |
---
- type: textarea
id: other-info
attributes:
label: Other information
description: |
If you have an idea where the problem might lie, let us know that here. Please include any pointers to code, relevant changes, or related issues you know of.
placeholder: Other information
validations:
required: false

0
.github/ISSUE_TEMPLATE/03_article_request.yml → .github/ISSUE_TEMPLATE/04_article_request.yml

0
.github/ISSUE_TEMPLATE/04_performance_issue.md → .github/ISSUE_TEMPLATE/05_performance_issue.md

0
.github/ISSUE_TEMPLATE/05_blank_issue.md → .github/ISSUE_TEMPLATE/06_blank_issue.md

3
Directory.Packages.props

@ -6,7 +6,7 @@
<PackageVersion Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="2.0.24" />
<PackageVersion Include="aliyun-net-sdk-sts" Version="3.1.2" />
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageVersion Include="AsyncKeyedLock" Version="7.0.0" />
<PackageVersion Include="AsyncKeyedLock" Version="7.0.1" />
<PackageVersion Include="Autofac" Version="8.0.0" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
@ -38,6 +38,7 @@
<PackageVersion Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.3" />
<PackageVersion Include="EphemeralMongo6.runtime.win-x64" Version="1.1.3" />
<PackageVersion Include="FluentValidation" Version="11.8.0" />
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageVersion Include="Hangfire.AspNetCore" Version="1.8.14" />
<PackageVersion Include="Hangfire.SqlServer" Version="1.8.14" />
<PackageVersion Include="HtmlSanitizer" Version="8.0.746" />

4
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en-GB.json

@ -15,6 +15,7 @@
"Permission:Maintain": "Maintain",
"Permission:ClearCaches": "Clear caches",
"Permission:Modules": "Modules",
"Permission:UserDownloads": "User Downloads",
"Permission:Packages": "Packages",
"Permission:Edit": "Edit",
"Permission:Delete": "Delete",
@ -102,6 +103,9 @@
"DoYouWantToCreateNewUser": "Do you want to create new user?",
"MasterModules": "Master Modules",
"OrganizationName": "Organisation name",
"DownloadType": "Download type",
"UserDownloads": "User Downloads",
"AcceptNewsletter": "Accept newsletter",
"CreationDate": "Creation date",
"LicenseStartDate": "License start date",
"LicenseEndDate": "License end date",

9
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json

@ -120,8 +120,15 @@
"PurchaseOrderNo": "Purchase order no",
"QuotationDate": "Quotation date",
"CompanyName": "Company name",
"DownloadType": "Download type",
"UserDownloads": "User Downloads",
"AcceptNewsletter": "Accept newsletter",
"CompanyAddress": "Company address",
"Price": "Price",
"Unknown": "Unknown",
"DddEBook": "Ddd EBook",
"MasteringAbpFrameworkEBook": "Mastering AbpFramework EBook",
"MicroserviceEBook": "Microservice EBook",
"DiscountText": "Discount text",
"DiscountQuantity": "Discount quantity",
"DiscountPrice": "Discount price",
@ -284,6 +291,7 @@
"Menu:Quotation": "Quotation",
"Menu:Invoice": "Invoice",
"Menu:Quotation/Invoice": "Quotation/Invoice",
"Menu:UserDownloads": "User Downloads",
"Menu:PaymentRequests": "Payment Requests",
"Permission:PaymentRequests": "Payment Requests",
"PaymentRequests": "Payment Requests",
@ -566,6 +574,7 @@
"AllowAbpStudioBetaAccess": "Allow ABP Studio Beta Access",
"TotalQuestionCanNotBeNullMessage": "Total Question can not be null",
"Permission:OrganizationAutoRenewalPayments": "Organization Auto Renewal Payments",
"Permission:UserDownloads": "User Downloads",
"Permission:RetryFailedPayments": "Retry Failed Payments",
"AutoRenewalIsNotEnabled": "Auto Renewal is not enabled!",
"LicenseIsNotExpired": "License is not expired!",

11
abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json

@ -569,6 +569,11 @@
"CreatePostTitleInfo": "Title of the post to be shown on the post list.",
"CreatePostSummaryInfo": "A short summary of the post to be shown on the post list. Maximum length: <b>{0}</b>",
"CreatePostCoverInfo": "For creating an effective post, add a cover photo. Upload 16:9 aspect ratio pictures for the best view.<br/> Maximum file size: <b>1MB.</b>",
"CreatePostCoverInfo_Title": "<strong>Add a cover image to your post.</strong>",
"CreatePostCoverInfo1": "<i class='bi bi-dot'></i> Accepted file types : <strong>JPEG, JPG, PNG</strong>",
"CreatePostCoverInfo2": "<i class='bi bi-dot'></i> Max file size : <strong>1 MB</strong>",
"CreatePostCoverInfo3": "<i class='bi bi-dot'></i> Image proportion : <strong>16:9</strong>",
"CreatePostCoverInfo4": "<i class='bi bi-dot'></i> <a href='https://abp.io/assets/example-post-image.png'> Download a sample cover image </a>",
"ThisExtensionIsNotAllowed": "This extension is not allowed.",
"TheFileIsTooLarge": "The file is too large.",
"GoToThePost": "Go to the Post",
@ -1440,6 +1445,7 @@
"MAUI": "MAUI",
"HowItWorks_Page_Title": "How it Works?",
"HowItWorks_Page_Description": "Understand how ABP Framework works with detailed documentation, including guides and best practices.",
"HowItWorks_Description_Title": "What’s possible with ASP.NET Core, easier with ABP!",
"HowItWorks_Description1": "ABP extends the .NET platform. So, anything you can do with a plain .NET solution is already possible with ABP. That makes it easy to get started with a low learning curve.",
"HowItWorks_Description2": "Once you start learning and using ABP features, developing your software will be much more enjoyable than ever.",
"HowItWorks_Description3": "This page basically explains how you use the ABP Platform as a .NET developer.",
@ -1823,6 +1829,9 @@
"BackgroundWorkers": "Background Workers",
"BackgroundWorkersExplanation": "Define operations to run in a separate, dedicated thread. Use the built-in background workers or integrate your own. <a href=\"{0}\">Hangfire</a> and <a href=\"{1}\">Quartz</a> integrations are already available.",
"ConcurrencyCheck": "Concurrency Check",
"ConcurrencyCheckExplanation": "ABP provides an optimistic concurrency check mechanism to ensure data consistency in your application and prevents users access or change the same data in a database at the same time."
"ConcurrencyCheckExplanation": "ABP provides an optimistic concurrency check mechanism to ensure data consistency in your application and prevents users access or change the same data in a database at the same time.",
"NewsletterEmailFooterCreateTemplateMessage": "<div style=\"line-height: 24px; text-align: justify;\"><span style=\"color:#000000;\">Thank you for subscribing! We're thrilled to have you on board.<br>As a subscriber, you'll receive the latest updates on:<ul><li><strong>Promotional Offers:</strong>Benefit from exclusive discounts, seasonal campaigns, and special offers.</li><li><strong>Events:</strong>Stay informed about our Community Talks, Webinars, and the ABP DOTNET Conferences.</li><li><strong>Release Notes:</strong>Get the latest on ABP Platform releases and new products.</li><li><strong>Newsletter:</strong>Enjoy our blog posts, community news, and more.</li></ul><br>We look forward to keeping you informed and engaged.</span></div>",
"NewsletterDeleteSubscriptionDescription": "<div style=\"line-height: 24px; text-align: justify;\"><span style=\"color:#000000;\">This is a confirmation that you have unsubscribed from the following email categories:<ul><li><strong>Promotional Offers:</strong>Discounts, seasonal campaigns, etc.</li><li><strong>Events:</strong>Community Talks, Webinars, ABP DOTNET Conference, etc.</li><li><strong>Release Notes:</strong>ABP Platform releases, new products, etc.</li><li><strong>Newsletter:</strong>Blog posts, community news, etc.</li></ul><br>Please note that you will still receive important transactional emails related to your account.</span></div>",
"NewsletterEmailFooterTemplateDeleteSubscription": "<a style=\"color: #007bff;\" href=\"{0}\" data-root=\"{1}\">If you change your mind, you're always welcome to resubscribe!</a>"
}
}

64
docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/POST.md

@ -0,0 +1,64 @@
![book](images/book.jpg)
Ahead-of-Time (AOT) compilation and Just-in-Time (JIT) compilation are two different methods for compiling Angular applications. Here's a breakdown of the differences between them:
### **Ahead-of-Time (AOT) Compilation**
**What is AOT?**
- AOT compilation refers to the process of compiling your Angular application during the build phase, before the application is served to the browser.
- The Angular compiler converts your TypeScript and HTML templates into efficient JavaScript code ahead of time.
**Advantages:**
1. **Faster Rendering:** Since the compilation is done beforehand, the browser receives precompiled code, leading to faster rendering and better performance when the app loads.
2. **Smaller Bundle Size:** AOT eliminates the need for the Angular compiler in the client-side bundle, which reduces the overall bundle size.
3. **Improved Security:** AOT compilation checks your templates and bindings during the build process, catching errors early and reducing the risk of injection attacks.
4. **Early Error Detection:** Errors related to templates and bindings are caught during the build time rather than at runtime, leading to more robust and error-free applications.
**When to Use:**
- AOT is typically used in production builds because it provides better performance, smaller bundles, and more secure applications.
**How to Use:**
- AOT is the default when you run `ng build --prod` in an Angular project.
### **Just-in-Time (JIT) Compilation**
**What is JIT?**
- JIT compilation occurs in the browser at runtime. The Angular compiler translates the TypeScript and HTML templates into JavaScript code just before the application runs in the browser.
- The application is compiled on the fly as the user interacts with it.
**Advantages:**
1. **Faster Build Time:** Since there’s no pre-compilation step, the build process is faster during development.
2. **More Flexible Development:** JIT allows for rapid iteration during development, as changes can be quickly reflected without needing to rebuild the entire application.
3. **Dynamic Components:** JIT allows for more flexibility in scenarios where components need to be dynamically created or compiled at runtime.
**When to Use:**
- JIT is typically used in development environments because it allows for quicker build times and easier debugging.
**How to Use:**
- JIT is the default compilation method when you run `ng serve` for development builds in Angular.
### **Comparison Summary:**
| Feature | AOT (Ahead-of-Time) | JIT (Just-in-Time) |
| ---------------------- | ----------------------------- | ---------------------------------- |
| **Compilation Timing** | At build time | At runtime |
| **Performance** | Faster application startup | Slower application startup |
| **Bundle Size** | Smaller (no Angular compiler) | Larger (includes Angular compiler) |
| **Error Detection** | Catches template errors early | Errors caught at runtime |
| **Use Case** | Production | Development |
| **Dynamic Components** | Less flexible | More flexible |
### **Best Practices:**
- **Use AOT** for production builds to ensure faster load times, smaller bundle sizes, and more secure applications.
- **Use JIT** during development to take advantage of quicker builds and easier debugging.

BIN
docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/images/book.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
docs/en/Community-Articles/2024-08-28-Understanding-AOT-vs-JIT/images/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

85
docs/en/Community-Articles/2024-08-29-What-is-Angular-Schematics/Post.md

@ -0,0 +1,85 @@
# What is Angular Schematics?
![Cover Image](cover.png)
**Angular Schematics** is a powerful tool which is part of the Angular CLI that allows developers to automate various development tasks by **generating and modifying code**. Schematics provides a way to create **templates and boilerplate code** for Angular applications or libraries, enabling consistency and reducing the amount of repetitive work.
### Key Concepts of Angular Schematics:
1. **Code Generation:**
- Schematics can generate boilerplate code for various Angular artifacts, such as components, services, modules, pipes... For example, when you run a command like `ng generate component my-component`, Angular uses a schematic to create the component files and update the necessary modules.
2. **Code Modification:**
- Schematics can also modify existing code in your project. This includes tasks like updating configuration files, adding new routes, or modifying Angular modules. They can be very useful when upgrading projects to a new version of Angular or adding new features that require changes to the existing codebase.
3. **Custom Schematics:**
- Developers can create their own custom schematics to automate repetitive tasks specific to their projects. For example, if your team frequently needs to set up a certain type of service or configure specific libraries, you can create a schematic that automates these steps. In [ABP Suite](https://abp.io/suite), we use the custom schematics templates to generate CRUD pages for Angular UI.
4. **Collection of Schematics:**
- Schematics are often grouped into collections. The Angular CLI itself is a collection of schematics. You can create your own collection or use third-party schematic collections created by the Angular community.
5. **Integration with Angular CLI:**
- Schematics is integrated with the Angular CLI. The `ng generate` and `ng add` commands are examples of how schematics are used in everyday Angular development. When you use these commands, the Angular CLI runs the corresponding schematic to perform the desired operation.
6. **Upgrade Tasks:**
- Schematics can be used to automate the process of upgrading Angular applications. For example, the Angular Update command (`ng update`) uses schematics to automatically apply necessary changes to your project when upgrading to a new version of Angular.
### Common Use Cases:
- **Generating Components, Services, Modules.:** Easily create Angular building blocks with commands like `ng generate component`, `ng generate service`, or `ng generate module`.
- **Adding Libraries:** Automatically set up and configure third-party libraries with `ng add`. For example, `ng add @angular/material` uses a schematic to install and configure Angular Material in your project.
- **Automating Project Upgrades:** Simplify the process of upgrading Angular versions by running `ng update`, which uses schematics to make necessary code changes.
- **Custom Project Scaffolding:** Create custom schematics to enforce your team's development standards and best practices by automating the creation of specific project structures.
### How to Create a Custom Schematic:
Creating a custom schematic involves several steps:
1. **Install the Schematics CLI:**
```bash
npm install -g @angular-devkit/schematics-cli
```
2. **Create a New Schematic Project:**
```bash
schematics blank --name=my-schematic
cd my-schematic
```
3. **Define Your Schematic:** Modify the files in the schematic project to define what your schematic will generate or modify.
4. **Test Your Schematic:** You can run your schematic locally using the `schematics` command.
5. **Publish Your Schematic (Optional):** Once your schematic is ready, you can publish it to npm or include it in your Angular projects.
#### Example:
If you want to create a custom component with specific settings or styles, you can create a schematic to automate this. Every time a developer on your team needs to create this type of component, they can run the schematic, ensuring consistency across the project.
### Helpful Links
Here are the direct links for the Angular Schematics resources:
- [Angular Official Documentation: Schematics Overview — angular.io](https://angular.io/guide/schematics)
- [Creating Custom Schematics — angular.io](https://angular.io/guide/schematics-for-libraries)
- [CLI Schematic Command — angular.io](https://angular.io/cli/schematic)
- [Devkit Schematics— github.com](https://github.com/angular/angular-cli/tree/main/packages/angular_devkit/schematics)
- [Schematics Examples — github.com](https://github.com/angular/angular-cli/tree/main/packages/schematics/angular)
- [Debugging Angular Schematics — dev.to](https://dev.to/nikolasleblanc/debugging-angular-schematics-1ne0)
- [Using Schematics with Nx — nx.dev](https://nx.dev/guides/using-angular-schematics)
- [Schematics API — angular.io](https://angular.io/api/schematics)
### Conclusion:
Angular Schematics is a powerful tool for automating repetitive tasks, generating consistent code, and managing project upgrades. By leveraging schematics, Angular developers can save time, reduce errors, and enforce best practices across their projects.

BIN
docs/en/Community-Articles/2024-08-29-What-is-Angular-Schematics/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

123
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/Post.md

@ -0,0 +1,123 @@
# Do You Really Need Multi-tenancy?
This article discusses whether you need a multi-tenancy architecture for your next project. Answer my critical questions to decide if multi-tenancy suits your application or not!
![Cover image](cover.png)
## What’s Multi-tenancy?
It’s an architectural approach to building SaaS solutions. In this model, the hardware and software resources are shared between tenants, and application data is virtually or physically isolated between tenants. Here, **the main goal is minimizing costs and maximizing customer count**.
**An ideal multi-tenant application should be;**
- A multi-tenancy system should be designed to **work seamlessly** and make your application code **multi-tenancy aware** as much as possible.
- When a customer wants to separate their database, it **should also be deployable to on-premise**.
![Tenancy Schema](tenancy-schema.png)
---
## Multi-tenant Development is Hard - Reconsider!
**Developing a multi-tenant application is harder** compared to non-multi-tenant applications. You add `TenandId` to all your shared entities. And each time you make a query, you need to filter by `TenantId`. There is an increased risk of security breaches if one tenant's data is compromised. Multi-tenancy can limit the extent of customization available to each tenant since they all operate on the same core infrastructure. Also, in a microservice environment, things get two times more complicated. So you should carefully consider if you need multi-tenancy or not. Sometimes, I got questions like;
![Questions](questions.png)
**No! These are not multi-tenant applications.** It just needs a simple filtering by your different branches/faculties/departments/holding sub-companies/ groups or whatever hierarchy is…
**You are confusing "grouping" with "resource sharing".**
---
## Do I Really Need Multi-tenancy?
Ask yourself the following questions if you cannot decide whether your app needs multi-tenancy or not;
1. Can a user be shared among other tenants?
2. Any tenant needs to see other tenant's data?
3. Does your application break when you physically move one of the tenants?
4. Do your customers need higher security and better GDPR enforcement?
5. Do you need cumulative queries over your tenants?
Let's answer these questions;
##### **1. Can a user be shared among other tenants?**
If you need to *share a user among other tenants, or in other words, users can be members of different tenants,* then **your application is definitely not multi-tenant**! Multi-tenancy means a tenant’s data is always isolated, even if it’s logically separated. **You cannot share a user among your tenants.** The reason is simple: In the future, if you move a tenant to on-premise, then your application will break!
![user-multiple-membership](user-multiple-membership.png)
##### **2. Does any tenant need to see other tenants' data?**
If your answer is **YES**, **then** **your application is not multi-tenant**. In multi-tenant apps, the tenant's data cannot be shared in any circumstances among the other tenants. Business decision-makers sometimes want to share some entities with other tenants. If there's this requirement, you shouldn't start a multi-tenant architecture. You can simply group these tenants manually. Again, reply to this question; **In the future, if I move a tenant physically to another environment, will my app still work properly?** In this case, it will not!
![Shared entity](shared-entity.png)
Let's say your app is *Amazon.com* and you have a product entity *iPhone* that you want to share with other sellers. This requirement violates the multi-tenant rule. While your *Amazon.com* is still SaaS, it shouldn't be multi-tenant.
On the other hand, if you serve several online shopping websites dedicated to different brands. Let's say Nike and Adidas want to have their own e-commerce websites. And your ***Amazon.com* provides these companies with their own subdomains: *nike.amazon.com* and *adidas.amazon.com***. In this architecture, these companies will have their own user, roles, settings. Also these companies will have their own branding like custom login screen, custom logo, different theme layouts, menu items, language options, payment gateways etc... Hence, **this is %100 multi-tenant.**
##### **3. Does your application break when you physically move one of the tenants?**
If your answer is **YES**, you should **stop making it multi-tenant**. It is **not a multi-tenant app**! This means your tenants are tightly coupled with the application's infrastructure or database, and this requirement prevents you from making it multi-tenant because it disrupts the entire system when you take out a tenant.
![Coupled Tenants](coupled-tenants.png)
##### **4. Do your customers need higher security and better GDPR enforcement?**
If your answer is **YES**, you **should not make it multi-tenancy.** When a **hacker** gets into your server, he can **steal all your client data**. Also, if you have a security hole, **a tenant can gain access** to other tenants' data. Especially your tenants' data is being shared in the same database... On the other hand, some customers, for example, government agencies or banks, may be required to locate the database in their own geo-location and make it unreachable from the main application. In this case, you should go with a single-tenant architecture. Another difficulty is that some tenants may have **different data retention policies**, so you must implement different strategies for each tenant. In this case, you should also consider making it a single-tenant.
![Security GDPR Data Retention](security-gdpr-db-retention.png)
##### **5. Do you need cumulative queries over your tenants?**
This question is not a clear decision parameter for multi-tenancy. But it can be a supportive parameter for your decision. Actually, this is a common feature in multi-tenant systems where aggregated reporting or analytics across tenants is required. In a virtually isolated multi-tenant environment, you can easily do this by just disabling the multi-tenancy filter. However, when some of your tenants have separate databases or application instances, it becomes harder to get aggregate reports.
Do you need cumulative queries over your tenants? If your answer is YES, then you should keep all your tenants' data in a shared database to easily query them. But if you still need to physically move some of the tenants, then you have the following strategies:
* First, all your databases need to be on the same network so that you can gather data from different databases.
* Second, in some cases, according to the GDPR requirements or government agency regulations, you must locate the database in their geo-location. And you cannot connect to these databases. In this case, you can create a Web API in your application that gives you a report for this specific tenant. Later, you'll gather the reports from all your tenants like this and merge them.
* Third; When the tenant databases are in different geo-location (inaccessible), then each tenant can send their report to your central server. So you can generate cumulative reports.
## Conclusion
- It's important to decide on the first day whether your application needs to be multi-tenant. To decide this, consider these topics;
- **Do my tenants really have a relationship with each other?** No, they have nothing to do in common; **OK, go with multi-tenancy**.
- **My tenants don't have a relationship** with each other, and the only thing they have in common is sharing my application. **OK, go with multi-tenancy**.
- **When a tenant leaves the system (by removing their data), the other tenants also stop working** This means that the tenants are coupled. **Do not do multi-tenancy!**
---
![Logo](https://abp.io/assets/platform/img/logos/logo-abp-dark.svg)
We’ve been working for a long time on multi-tenancy, microservices, modular development topics, and developing tools and frameworks for repetitive development tasks. Check out the amazing open-source [ABP Framework](https://github.com/abpframework/abp), which provides all the alternative solutions to implement a multi-tenant architecture. The multi-tenancy logic is seamlessly done at the core level, and you can simply focus on your business code. Keep it simple, nice and neat with ABP.
```bash
ABP.IO: The Modern Way of Developing Web Apps for .NET Developers!
```
Alper Ebicoglu / [x.com/alperebicoglu](https://x.com/alperebicoglu)
— ABP Team

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/coupled-tenants.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/questions.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/security-gdpr-db-retention.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/shared-entity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/tenancy-schema.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
docs/en/Community-Articles/2024-09-01-Do-You-Need-MultiTenancy/user-multiple-membership.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

20
docs/en/cli/index.md

@ -140,10 +140,10 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md
* `--tiered`: Creates a tiered solution where Web and Http API layers are physically separated. If not specified, it creates a layered solution which is less complex and suitable for most scenarios. (*Available for* ***Team*** *or higher licenses*)
* `angular`: Angular UI. There are some additional options for this template:
* `--tiered`: The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. (*Available for* ***Team*** *or higher licenses*)
* `--pwa`: Specifies the project as Progressive Web Application.
* `--progressive-web-app` or `-pwa`: Specifies the project as Progressive Web Application.
* `blazor`: Blazor UI. There are some additional options for this template:
* `--tiered`The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. (*Available for* ***Team*** *or higher licenses*)
* `--pwa`: Specifies the project as Progressive Web Application.
* `--progressive-web-app` or `-pwa`: Specifies the project as Progressive Web Application.
* `blazor-server`: Blazor Server UI. There are some additional options for this template:
* `--tiered`: The Auth Server and the API Host project comes as separate projects and run at different endpoints. It has 3 startup projects: *HttpApi.Host*, *AuthServer* and *Blazor* and and each runs on different endpoints. If not specified, you will have a single endpoint for your web project. (*Available for* ***Team*** *or higher licenses*)
* `maui-blazor`: Blazor Maui UI (*Available for* ***Team*** *or higher licenses*). There are some additional options for this template:
@ -158,8 +158,12 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md
* `ef`: Entity Framework Core.
* `mongodb`: MongoDB.
* `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](../framework/data/entity-framework-core/other-dbms.md) (after creating the solution).
* `--skip-migrations` or `-sm`: Skips the creating initial database migration step.
* `--skip-migrator` or `-smr`: Skips the run database migrator step.
* `--public-website`: Public Website is a front-facing website for describing your project, listing your products and doing SEO for marketing purposes. Users can login and register on your website with this website. This option is only included in PRO templates.
* `--without-cms-kit`: When you add a public website to your solution, it automatically includes the [CmsKit](./../modules/cms-kit-pro/index.md) module. If you don't want to include *CmsKit*, you can use this parameter.
* `--separate-tenant-schema`: Creates a different DbContext for tenant schema. If not specified, the tenant schema is shared with the host schema. This option is only included in PRO templates.
* `--sample-crud-page` or `-scp`: It adds the [BookStore](./../tutorials/book-store/index.md) sample to your solution.
* `--theme` or `-th`: Specifes the theme. Default theme is `leptonx`. Available themes:
* `leptonx`: LeptonX Theme. (*Available for* ***Team*** *or higher licenses*)
* `leptonx-lite`: LeptonX-Lite Theme.
@ -176,6 +180,9 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md
* `ef`: Entity Framework Core.
* `mongodb`: MongoDB.
* `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](../framework/data/entity-framework-core/other-dbms.md) (after creating the solution).
* `--skip-migrations` or `-sm`: Skips the creating initial database migration step.
* `--skip-migrator` or `-smr`: Skips the run database migrator step.
* `--sample-crud-page` or `-scp`: It adds the [BookStore](./../tutorials/book-store/index.md) sample to your solution.
* `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes:
* `leptonx`: LeptonX Theme. (*Available for* ***Team*** *or higher licenses*)
* `leptonx-lite`: LeptonX-Lite Theme.
@ -213,6 +220,7 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md
* `--dont-run-install-libs`: Skip installing client side packages.
* `--dont-run-bundling`: Skip bundling for Blazor packages.
* `--no-kubernetes-configuration` or `-nkc`: Skips the Kubernetes configuration files.
* `--no-social-logins` or `-nsl`: Skipts the social login configuration.
* *Module Options*: You can skip some modules if you don't want to add them to your solution (*Available for* ***Team*** *or higher licenses*). Available commands:
* `-no-saas`: Skips the Saas module.
* `-no-gdpr`: Skips the GDPR module.
@ -796,12 +804,19 @@ Examples:
````bash
abp upgrade -t app
abp upgrade -t app --language-management --gdpr --audit-logging-ui --text-template-management --openiddict-pro
abp upgrade -t app-nolayers --audit-logging-ui
abp upgrade -t app-nolayers -p D:\MyProjects\MyProject
````
#### Options
* `--path` or `-p`: Specifies the module path. The module should be in that directory. If not specified, the default is the current directory.
* `--gdpr`: Installs GDPR module too.
* `--language-management`: Installs Language Management module too.
* `--audit-logging-ui`: Installs Audit Logging Pro (UI) module too.
* `--text-template-management`: Installs Text Template Management module too.
* `--openiddict-pro`: Installs OpenIddict Pro (UI) module too.
### translate
@ -909,6 +924,7 @@ abp bundle [options]
* ```--project-type``` or ```-t```: Specifies the project type. Default type is `webassembly`. Available types:
* `webassembly`
* `maui-blazor`
* `--version` or `-v`: Specifies the ABP Framework version that the project is using. This is helpful for those who use central package management.
`bundle` command reads the `appsettings.json` file inside the Blazor and MAUI Blazor project for bundling options. For more details about managing style and script references in Blazor or MAUI Blazor apps, see [Managing Global Scripts & Styles](../framework/ui/blazor/global-scripts-styles.md)

18
docs/en/docs-nav.json

@ -184,6 +184,14 @@
{
"text": "Concepts",
"path": "studio/concepts.md"
},
{
"text": "Version Compatibility",
"path": "studio/version-compatibility.md"
},
{
"text": "Release Notes",
"path": "studio/release-notes.md"
}
]
},
@ -438,6 +446,10 @@
"text": "AWS Provider",
"path": "framework/infrastructure/blob-storing/aws.md"
},
{
"text": "Google Cloud Storage Provider",
"path": "framework/infrastructure/blob-storing/google.md"
},
{
"text": "Create a Custom Provider",
"path": "framework/infrastructure/blob-storing/custom-provider.md"
@ -840,7 +852,7 @@
"items": [
{
"text": "Overview",
"path": "framework/ui/mvc-razor-pages"
"path": "framework/ui/mvc-razor-pages/overall"
},
{
"text": "Navigation / Menus",
@ -1810,7 +1822,7 @@
"text": "Samples",
"items": [
{
"text": "All Samples",
"text": "Overview",
"path": "samples"
},
{
@ -1923,4 +1935,4 @@
]
}
]
}
}

4
docs/en/framework/api-development/index.md

@ -2,10 +2,10 @@
The following documents explain the concepts, infrastructure and integrations to build HTTP APIs with ABP:
* [ABP Endpoints](./standard-apis/overview.md)
* [ABP Endpoints](./standard-apis)
* [API Versioning](./versioning.md)
* [Auto API Controllers](./auto-controllers.md)
* [Dynamic C# API Clients](./dynamic-csharp-clients.md)
* [Integration Services](./integration-services.md)
* [Static C# API Clients](./static-csharp-clients.md)
* [Swagger Integration](./swagger.md)
* [Swagger Integration](./swagger.md)

69
docs/en/framework/infrastructure/background-jobs/hangfire.md

@ -154,3 +154,72 @@ app.UseAbpHangfireDashboard("/hangfire", options =>
**Important**: `UseAbpHangfireDashboard` should be called after the authentication and authorization middlewares in your `Startup` class (probably at the last line). Otherwise,
authorization will always fail!
#### Dashboard Authorization In API Projects
If you use the hangfire dashboard in an API project that uses non-cookie authentication (like JWT Bearers), The `/hangfire` page can't authenticate the user.
In this case, you can add a cookies authorization scheme to authenticate the user. The best way to do this is to use the `Cookie` and `OpenIdConnect` authentication schemes. This requires creating a new OAuth2 client and adding the `ClientId`, and `ClientSecret` properties to the `AuthServer` section in the `appsettings.json` file.
The final code should look like below:
```csharp
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddAbpJwtBearer(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
options.Audience = "MyProjectName";
});
context.Services.AddAuthentication()
.AddCookie("Cookies")
.AddOpenIdConnect("oidc", options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.ClientId = configuration["AuthServer:ClientId"];
options.ClientSecret = configuration["AuthServer:ClientSecret"];
options.UsePkce = true;
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("roles");
options.Scope.Add("email");
options.Scope.Add("phone");
options.Scope.Add("MyProjectName");
});
}
```
```csharp
app.Use(async (httpContext, next) =>
{
if (httpContext.Request.Path.StartsWithSegments("/hangfire"))
{
var result = await httpContext.AuthenticateAsync("Cookies");
if (result.Succeeded)
{
httpContext.User = result.Principal;
await next(httpContext);
return;
}
await httpContext.ChallengeAsync("oidc");
}
else
{
await next(httpContext);
}
});
app.UseAbpHangfireDashboard("/hangfire", options =>
{
options.AsyncAuthorization = new[] {new AbpHangfireAuthorizationFilter()};
});
```

70
docs/en/framework/infrastructure/blob-storing/google.md

@ -0,0 +1,70 @@
# BLOB Storing Google Provider
BLOB Storing Google Provider can store BLOBs in [Google Cloud Storage](https://cloud.google.com/storage).
> Read the [BLOB Storing document](../blob-storing) to understand how to use the BLOB storing system. This document only covers how to configure containers to use a Google Cloud Storage as the storage provider.
## Installation
Use the ABP CLI to add [Volo.Abp.BlobStoring.Google](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Google) NuGet package to your project:
* Install the [ABP CLI](../../../cli) if you haven't installed before.
* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.BlobStoring.Google` package.
* Run `abp add-package Volo.Abp.BlobStoring.Google` command.
If you want to do it manually, install the [Volo.Abp.BlobStoring.Google](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Google) NuGet package to your project and add `[DependsOn(typeof(AbpBlobStoringGoogleModule))]` to the [ABP module](../../architecture/modularity/basics.md) class inside your project.
## Configuration
Configuration is done in the `ConfigureServices` method of your [module](../../architecture/modularity/basics.md) class, as explained in the [BLOB Storing document](../blob-storing).
**Example: Configure to use the Google storage provider by default**
````csharp
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.UseGoogle(google =>
{
google.ClientEmail = "your coogle client email";
google.ProjectId = "your coogle project id";
google.PrivateKey = "your coogle private key";
google.Scopes = "your coogle scopes";
google.ContainerName = "your coogle container name";
google.CreateContainerIfNotExists = true;
//google.UseApplicationDefaultCredentials = true; // If you want to use application default credentials
});
});
});
````
> See the [BLOB Storing document](../blob-storing) to learn how to configure this provider for a specific container.
### Options
* **ClientEmail** (string): The client email of the Google service account. You can create a service account and get the client email. Please refer to Google documentation: https://cloud.google.com/iam/docs/service-account-overview
* **ProjectId** (string): The project ID of the Google service account.
* **PrivateKey** (string): The private key of the Google service account. You can create a service account and get the private key. Please refer to Google documentation: https://cloud.google.com/iam/docs/keys-create-delete
* **Scopes** (string): The scopes of the Google service account.
* **UseApplicationDefaultCredentials** (bool): If `true`, it uses the application default credentials(ADC). Default value is `false`. Please refer to Google documentation: https://cloud.google.com/docs/authentication/provide-credentials-adc
* **ContainerName** (string): You can specify the container name in Google. If this is not specified, it uses the name of the BLOB container defined with the `BlobContainerName` attribute (see the [BLOB storing document](../blob-storing)). Please note that Google has some **rules for naming containers**. A container name must be a valid DNS name, conforming to the [following naming rules](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#container-names):
* Container names must start or end with a letter or number, and can contain only letters, numbers, and the dash (-) character.
* Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names.
* All letters in a container name must be **lowercase**.
* Container names must be from **3** through **63** characters long.
* **CreateContainerIfNotExists** (bool): Default value is `false`, If a container does not exist in Google, `GoogleBlobProvider` will try to create it.
## Google Blob Name Calculator
Google Blob Provider organizes BLOB name and implements some conventions. The full name of a BLOB is determined by the following rules by default:
* Appends `host` string if [current tenant](../../architecture/multi-tenancy) is `null` (or multi-tenancy is disabled for the container - see the [BLOB Storing document](../blob-storing) to learn how to disable multi-tenancy for a container).
* Appends `tenants/<tenant-id>` string if current tenant is not `null`.
* Appends the BLOB name.
## Other Services
* `GoogleBlobProvider` is the main service that implements the Google BLOB storage provider, if you want to override/replace it via [dependency injection](../../fundamentals/dependency-injection.md) (don't replace `IBlobProvider` interface, but replace `GoogleBlobProvider` class).
* `IGoogleBlobNameCalculator` is used to calculate the full BLOB name (that is explained above). It is implemented by the `DefaultGoogleBlobNameCalculator` by default.

1
docs/en/framework/infrastructure/blob-storing/index.md

@ -22,6 +22,7 @@ The ABP has already the following storage provider implementations:
* [Aliyun](./aliyun.md): Stores BLOBs on the [Aliyun Storage Service](https://help.aliyun.com/product/31815.html).
* [Minio](./minio.md): Stores BLOBs on the [MinIO Object storage](https://min.io/).
* [Aws](./aws.md): Stores BLOBs on the [Amazon Simple Storage Service](https://aws.amazon.com/s3/).
* [Google](./google.md): Stores BLOBs on the [Google Cloud Storage](https://cloud.google.com/storage).
More providers will be implemented by the time. You can [request](https://github.com/abpframework/abp/issues/new) it for your favorite provider or [create it yourself](./custom-provider.md) and [contribute](../../../contribution) to the ABP.

75
docs/en/framework/infrastructure/data-filtering.md

@ -320,6 +320,81 @@ public override string GetCompiledQueryCacheKey()
}
````
##### Make User-defined function mapping compatible with [DevExtreme.AspNet.Data's](https://github.com/DevExpress/DevExtreme.AspNet.Data) `IAsyncAdapter`
If you are using [DevExtreme.AspNet.Data](https://github.com/DevExpress/DevExtreme.AspNet.Data) and `User-defined function mapping`, You need to create a custom adapter to compatible with `IAsyncAdapter`.
````csharp
var adapter = new AbpDevExtremeAsyncAdapter();
CustomAsyncAdapters.RegisterAdapter(typeof(AbpEntityQueryProvider), adapter);
````
````csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using DevExtreme.AspNet.Data.Async;
namespace Abp.EntityFrameworkCore;
public class AbpDevExtremeAsyncAdapter : IAsyncAdapter
{
private readonly MethodInfo _countAsyncMethod;
private readonly MethodInfo _toListAsyncMethod;
public AbpDevExtremeAsyncAdapter()
{
var extensionsType = Type.GetType("Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions, Microsoft.EntityFrameworkCore");
_countAsyncMethod = FindQueryExtensionMethod(extensionsType, "CountAsync");
_toListAsyncMethod = FindQueryExtensionMethod(extensionsType, "ToListAsync");
}
public Task<int> CountAsync(IQueryProvider provider, Expression expr, CancellationToken cancellationToken)
{
return InvokeCountAsync(_countAsyncMethod, provider, expr, cancellationToken);
}
public Task<IEnumerable<T>> ToEnumerableAsync<T>(IQueryProvider provider, Expression expr, CancellationToken cancellationToken)
{
return InvokeToListAsync<T>(_toListAsyncMethod, provider, expr, cancellationToken);
}
static MethodInfo FindQueryExtensionMethod(Type extensionsType, string name)
{
return extensionsType.GetMethods().First(m =>
{
if (!m.IsGenericMethod || m.Name != name)
{
return false;
}
var parameters = m.GetParameters();
return parameters.Length == 2 && parameters[1].ParameterType == typeof(CancellationToken);
});
}
static Task<int> InvokeCountAsync(MethodInfo method, IQueryProvider provider, Expression expr, CancellationToken cancellationToken)
{
var countArgument = ((MethodCallExpression)expr).Arguments[0];
var query = provider.CreateQuery(countArgument);
return (Task<int>)InvokeQueryExtensionMethod(method, query.ElementType, query, cancellationToken);
}
static async Task<IEnumerable<T>> InvokeToListAsync<T>(MethodInfo method, IQueryProvider provider, Expression expr, CancellationToken cancellationToken)
{
return await (Task<List<T>>)InvokeQueryExtensionMethod(method, typeof(T), provider.CreateQuery(expr), cancellationToken);
}
static object InvokeQueryExtensionMethod(MethodInfo method, Type elementType, IQueryable query, CancellationToken cancellationToken)
{
return method.MakeGenericMethod(elementType).Invoke(null, new object[] { query, cancellationToken });
}
}
````
### MongoDB
ABP abstracts the `IMongoDbRepositoryFilterer` interface to implement data filtering for the [MongoDB Integration](../data/mongodb), it works only if you use the repositories properly. Otherwise, you should manually filter the data.

2
docs/en/framework/ui/angular/theming.md

@ -20,7 +20,7 @@ Currently, three themes are **officially provided**:
* The [Basic Theme](basic-theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**.
* The [Lepton Theme](https://abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP](https://abp.io/) license.
* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](https://docs.abp.io/en/commercial/latest/themes/lepton-x/angular) and [lite](../../../ui-themes/lepton-x-lite/angular.md) choices.
* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](../../../ui-themes/lepton-x/angular.md) and [lite](../../../ui-themes/lepton-x-lite/angular.md) choices.
## Overall

2
docs/en/framework/ui/mvc-razor-pages/overall.md

@ -36,7 +36,7 @@ Currently, three themes are **officially provided**:
* The [Basic Theme](Basic-Theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**.
* The [Lepton Theme](https://abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP](https://abp.io/) license.
* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](https://docs.abp.io/en/commercial/latest/themes/lepton-x/mvc) and [lite](../../../ui-themes/lepton-x-lite/asp-net-core.md) choices.
* The [LeptonX Theme](https://x.leptontheme.com/) is a theme that has both [commercial](../../../ui-themes/lepton-x/mvc.md) and [lite](../../../ui-themes/lepton-x-lite/asp-net-core.md) choices.
There are also some community-driven themes for the ABP (you can search on the web).

2
docs/en/framework/ui/mvc-razor-pages/security-headers.md

@ -38,7 +38,7 @@ Security Headers middleware is an ASP.NET Core request pipeline [middleware](htt
app.UseAbpSecurityHeaders();
```
> You can add this middleware after `app.UseRouting()` in your module class's `OnApplicationInitialization` method to register it to the request pipeline. This middleware is already configured in the [ABP Commercial Startup Templates](https://docs.abp.io/en/commercial/latest/startup-templates/index), so you don't need to manually add it if you are using one of these startup templates.
> You can add this middleware after `app.UseRouting()` in your module class's `OnApplicationInitialization` method to register it to the request pipeline. This middleware is already configured in the [ABP Commercial Startup Templates](../../../solution-templates/index.md), so you don't need to manually add it if you are using one of these startup templates.
After that, you have registered the `UseAbpSecurityHeaders` middleware into the request pipeline, the defined security headers will be shown in the response headers as in the figure below:

2
docs/en/framework/ui/mvc-razor-pages/theming.md

@ -21,7 +21,7 @@ Currently, four themes are **officially provided**:
* The [Basic Theme](basic-theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**.
* The [LeptonX Lite Theme](../../../ui-themes/lepton-x-lite/asp-net-core.md) is modern and stylish Bootstrap UI theme. It is ideal if you want to have a production ready UI theme. It is also **open source and free**.
* The [Lepton Theme](https://abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP](https://abp.io/) license.
* The [LeptonX Theme](https://docs.abp.io/en/commercial/latest/themes/lepton-x/index) is also a **commercial** theme developed by the core ABP theme and is a part of the [ABP](https://abp.io/) license. This is the default theme after ABP v6.0.0.
* The [LeptonX Theme](../../../ui-themes/lepton-x/index.md) is also a **commercial** theme developed by the core ABP theme and is a part of the [ABP](https://abp.io/) license. This is the default theme after ABP v6.0.0.
There are also some community-driven themes for the ABP (you can search on the web).

4
docs/en/get-started/layered-web-application.md

@ -26,9 +26,9 @@ The following tools should be installed on your development machine:
* [Yarn v1.22+ (not v2)](https://classic.yarnpkg.com/en/docs/install) <sup id="a-yarn">[2](#f-yarn)</sup> or npm v10+ (already installed with Node)
{{ end }}
{{ if Tiered == "Yes" }}
* [Redis](https://redis.io/) (as the [distributed cache](Caching.md)).
* [Redis](https://redis.io/) (as the [distributed cache](../framework/fundamentals/caching.md)).
{{ else }}
* [Redis](https://redis.io/) (as the [distributed cache](Caching.md)) is required if you select the Public website option.
* [Redis](https://redis.io/) (as the [distributed cache](../framework/fundamentals/caching.md)) is required if you select the Public website option.
{{ end }}
<sup id="f-editor"><b>1</b></sup> _You can use another editor instead of Visual Studio as long as it supports .NET Core and ASP.NET Core._ <sup>[↩](#a-editor)</sup>

2
docs/en/get-started/microservice.md

@ -125,6 +125,8 @@ In the *Solution Runner* section (on the left side) you can see all the runnable
> All the leaf items in the *Solution Runner* is called as an *Application* as they are executable applications.
> For a faster start process, first start the *Docker-Dependencies*, then you can start all applications.
As shown in the figure above, the executable applications are grouped into folders like `apps`, `gateways`, `infrastructure`, and `services`. You can start/stop them all, a group (folder) of them, or one by one.
Before running the applications, it is good to be sure that all applications are built. To do that, right-click the root item in the *Solution Runner* and select *Build* -> *Build All* action.

4
docs/en/get-started/single-layer-web-application.md

@ -25,9 +25,9 @@ The following tools should be installed on your development machine:
* [Yarn v1.22+ (not v2)](https://classic.yarnpkg.com/en/docs/install) <sup id="a-yarn">[2](#f-yarn)</sup> or npm v10+ (already installed with Node)
{{ end }}
{{ if Tiered == "Yes" }}
* [Redis](https://redis.io/) (as the [distributed cache](Caching.md)).
* [Redis](https://redis.io/) (as the [distributed cache](../framework/fundamentals/caching.md)).
{{ else }}
* [Redis](https://redis.io/) (as the [distributed cache](Caching.md)) is required if you select the Public website option.
* [Redis](https://redis.io/) (as the [distributed cache](../framework/fundamentals/caching.md)) is required if you select the Public website option.
{{ end }}
<sup id="f-editor"><b>1</b></sup> _You can use another editor instead of Visual Studio as long as it supports .NET Core and ASP.NET Core._ <sup>[↩](#a-editor)</sup>

19
docs/en/guides/migrating-from-open-source.md

@ -9,12 +9,14 @@ ABP Studio provides a way for users, who already started the development before
* Alternatively, you can use the following ABP Studio CLI command to achieve the same functionality:
```bash
abp upgrade [-t <template-name>]
abp upgrade [-t <template-name>] [options]
Examples:
abp upgrade -t app
abp upgrade -t app-nolayers
abp upgrade -t app --language-management --gdpr --audit-logging-ui --text-template-management --openiddict-pro
abp upgrade -t app-nolayers --audit-logging-ui
abp upgrade -t app-nolayers -p D:\MyProjects\MyProject
```
## Changes in the solution
@ -31,15 +33,14 @@ This command will remove the following modules from your solution:
And install the following modules to your solution:
- Volo.Abp.Account.Pro
- Volo.Abp.AuditLogging.Pro
- Volo.Abp.Identity.Pro
- Volo.Abp.OpenIddict.Pro
- Volo.Saas
- Volo.Abp.LanguageManagement
- Volo.Abp.TextTemplateManagement
- Volo.FileManagement
- Volo.Abp.Gdpr
- Volo.Abp.LeptonXTheme
- Volo.Saas
- Volo.Abp.OpenIddict.Pro (*Optional*)
- Volo.Abp.AuditLogging.Pro (*Optional*)
- Volo.Abp.LanguageManagement (*Optional*)
- Volo.Abp.TextTemplateManagement (*Optional*)
- Volo.Abp.Gdpr (*Optional*)
### Other changes

BIN
docs/en/images/payment-module-subscription-flow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 21 KiB

4
docs/en/modules/audit-logging-pro.md

@ -115,7 +115,7 @@ To see `AbpAuditingOptions` properties, please see its [documentation](../framew
### ExpiredAuditLogDeleterOptions
`ExpiredAuditLogDeleterOptions` can be configured in the UI layer, within the `ConfigureServices` method of your [module](https://docs.abp.io/en/abp/latest/Module-Development-Basics). Example:
`ExpiredAuditLogDeleterOptions` can be configured in the UI layer, within the `ConfigureServices` method of your [module](../framework/architecture/modularity/basics.md). Example:
```csharp
Configure<ExpiredAuditLogDeleterOptions>(options =>
@ -241,7 +241,7 @@ You can modify the look and behavior of the module pages by passing the followin
#### Services / Models
Audit Logging module services and models are generated via `generate-proxy` command of the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI). If you need the module's proxies, you can run the following command in the Angular project directory:
Audit Logging module services and models are generated via `generate-proxy` command of the [ABP CLI](../cli/index.md). If you need the module's proxies, you can run the following command in the Angular project directory:
```bash
abp generate-proxy --module auditLogging

1
docs/en/modules/cms-kit-pro/index.md

@ -17,6 +17,7 @@ The following features are provided by the open-source CMS Kit module:
- [**Menu**](../cms-kit/menus.md) system to manage public menus dynamically.
- [**Global resources**](../cms-kit/global-resources.md) system to add global styles and scripts dynamically.
- [**Dynamic widget**](../cms-kit/dynamic-widget.md) system to create dynamic widgets for page and blog posts.
- [**Marked Item**](../cms-kit/marked-items.md) system to flag favorites or important items with icons or emojis.
The following features are provided by the CMS Kit Pro version:

2
docs/en/modules/database-tables.md

@ -248,7 +248,7 @@ This table stores the values of the features for different providers. You can us
### FmDirectoryDescriptors
This table is utilized by the [File Management system](file-management.md) to manage directories by using the [BlobStoring](https://docs.abp.io/en/abp/latest/Blob-Storing) module.
This table is utilized by the [File Management system](file-management.md) to manage directories by using the [BlobStoring](../framework/infrastructure/blob-storing/index.md) module.
#### Foreign Keys

2
docs/en/modules/identity.md

@ -252,7 +252,7 @@ Following custom repositories are defined for this module:
##### Claim type manager
`IdenityClaimTypeManager` is used to perform some operations for the `IdentityClaimType` aggregate root.
`IdentityClaimTypeManager` is used to perform some operations for the `IdentityClaimType` aggregate root.
##### Organization unit manager

2
docs/en/modules/payment.md

@ -15,7 +15,7 @@ Payment module is not installed in [the startup templates](../solution-templates
### Using ABP CLI
ABP CLI allows adding a module to a solution using ```add-module``` command. You can check its [documentation](https://docs.abp.io/en/abp/latest/CLI#add-module) for more information. So, payment module can be added using the command below;
ABP CLI allows adding a module to a solution using ```add-module``` command. You can check its [documentation](../cli#add-module) for more information. So, payment module can be added using the command below;
```bash
abp add-module Volo.Payment

2
docs/en/modules/text-template-management.md

@ -2,7 +2,7 @@
> You must have an ABP Team or a higher license to use this module.
This module is used to store and edit template contents for [the text templating system](https://docs.abp.io/en/abp/latest/Text-Templating) of the ABP. So, you may need to understand it to better understand the purpose of this module.
This module is used to store and edit template contents for [the text templating system](../framework/infrastructure/text-templating/index.md) of the ABP. So, you may need to understand it to better understand the purpose of this module.
There are different use cases of the text templating system. For example, [the Account Module](account.md) is using it to define templates for sending emails when it needs to send emails to users (like sending "password reset link" email). This module provides UI to easily edit these email templates.

7
docs/en/release-info/migration-guides/abp-8-2.md

@ -51,8 +51,13 @@ If the flag icon has been specified while defining the localization languages, t
In this version, ABP Framework provides a new UI option called **Blazor Full-Stack WebApp**. We have already created an introduction/migration guide for you to check it: [Migrating to Blazor Web App](abp-8-2-blazor-web-app.md)
> Please read the documentation carefully if you are considering migrating your existing **Blazor** project to **Blazor WebApp**.
## Angular UI
In this version, the Angular UI has been updated to use the Angular version 17.3.0 and Nx version to 19.0.0. See the PR for more information: [#19915](https://github.com/abpframework/abp/pull/19915/)
## Session Management Infrastructure
The **Session Management** feature allows you to prevent concurrent login and manage user sessions.
In this version, a new entity called `IdentitySession` has been added to the framework and you should create a new migration and apply it to your database.
In this version, a new entity called `IdentitySession` has been added to the framework and you should create a new migration and apply it to your database.

6
docs/en/release-info/migration-guides/openiddict-step-by-step.md

@ -9,8 +9,8 @@ On the other hand, Identity Server ends support for the open-source Identity Ser
## Commercial Template
If you are using a commercial template, please check [Migrating from IdentityServer to OpenIddict for the Commercial Templates](https://docs.abp.io/en/commercial/6.0/migration-guides/openIddict-step-by-step) guide.
If you are using the microservice template, please check [Migrating the Microservice Template from IdentityServer to OpenIddict](https://docs.abp.io/en/commercial/6.0/migration-guides/openIddict-microservice) guide.
If you are using a commercial template, please check [Migrating from IdentityServer to OpenIddict for the Commercial Templates](https://abp.io/docs/commercial/6.0/migration-guides/openIddict-step-by-step) guide.
If you are using the microservice template, please check [Migrating the Microservice Template from IdentityServer to OpenIddict](https://abp.io/docs/commercial/6.0/migration-guides/openIddict-microservice) guide.
## OpenIddict Migration Steps
@ -258,7 +258,7 @@ for creating the host builder.
## Source code of samples and module
* [Open source tiered & separate auth server application migrate Identity Server to OpenIddict](https://github.com/abpframework/abp-samples/tree/master/Ids2OpenId)
* [OpenIddict module document](https://docs.abp.io/en/abp/6.0/Modules/OpenIddict)
* [OpenIddict module document](../../modules/openiddict.md)
* [OpenIddict module source code](https://github.com/abpframework/abp/tree/rel-6.0/modules/openiddict)
## See Also

2
docs/en/release-info/release-notes.md

@ -304,7 +304,7 @@ See the detailed **[blog post / announcement](https://abp.io/blog/ABP-Framework-
* Performance improvements (pre-compiling razor pages).
* New **Organization Unit** Management UI for the [Identity Module](https://abp.io/modules/Volo.Identity.Pro) to create hierarchical organization units and manage their members and roles.
* Created **Angular UI** for the [Chat Module](https://abp.io/modules/Volo.Chat).
* Implemented **Angular UI** for the [Easy CRM](https://docs.abp.io/en/commercial/latest/samples/easy-crm) application.
* Implemented **Angular UI** for the [Easy CRM](../samples/easy-crm.md) application.
* [ABP Suite](https://abp.io/tools/suite) code generation support for **module development**.
* New [leptontheme.com](http://leptontheme.com/) web site to show the **[Lepton Theme](https://abp.io/themes) components**.

129
docs/en/release-info/road-map.md

@ -8,52 +8,115 @@ This document provides a road map, release schedule, and planned features for th
The next version will be 9.0 and planned to release the stable 9.0 version in November 2024. We will be mostly working on the following topics:
* Upgrading to .NET 9
* Introducing `Extension Property Policy` feature
* Handling localization resources in a microservice scenario
* ABP Suite: Show default template for customized templates for better sync.
* Microservice development tutorials
* Improvements on the existing features and provide more guides.
See the [9.0 milestone](https://github.com/abpframework/abp/milestone/104) for all the issues we've planned to work on.
* Framework
* Upgrading to .NET 9.0
* Google Cloud Storage BLOB Provider
* Better handling localization resources in a microservice scenario
* SSR support for the Angular UI
* Upgrading 3rd-party dependencies
* ABP Suite
* Multiple navigation properties to the same target entity
* Define navigation properties without target string property dependency
* Improvements one-to-many scenarios
* Access to default code generation templates for customized templates
* ABP Studio
* Blazor WebApp UI option for the new startup templates
* Execution order (dependency management) for Solution Runner
* Automate more details on new service creation for a microservice solution
* Support multiple concurrent Kubernetes deployment/integration scenarios
* Show the README file when you create a new solution or open an existing solution
* Improve ABP Suite code-generation possibilities for microservice solutions
* Improve the module installation experience
* Auto-install 3rd-party dependencies
* Better handle long log files
* Allow to directly create new solutions with ABP's RC (Release Candidate) versions
* Support Intel processors for Mac computers, support ARM chipset for Windows and support Linux OS
* Improve client proxy generation experience
* Application modules
* Account module: Support mixed social/local login scenarios
* UI/UX improvements on existing application modules
* New tutorials
* Modular monolith development
* Microservice development
## Backlog Items
The *Next Versions* section above shows the main focus of the planned versions. However, in each release, we add new features to the core framework and the [application modules](../modules).
Here is a list of major items in the backlog we are considering working on in the next versions.
The *Next Versions* section above shows the main focus of the planned versions. However, in each release, we add new features to the ABP platform.
### Framework
* [#86](https://github.com/abpframework/abp/issues/86) / GrapQL Integration
The ABP framework is [open source](https://github.com/abpframework/abp) and free for everyone. You can see its [public backlog](https://github.com/abpframework/abp/milestone/2). Here, are some of the important features you can expect from next versions:
* [#236](https://github.com/abpframework/abp/issues/236) / Resource based authorization system
* [#2882](https://github.com/abpframework/abp/issues/2882) / Providing a gRPC integration infrastructure (while it is [already possible](https://github.com/abpframework/abp-samples/tree/master/GrpcDemo) to create or consume gRPC endpoints for your application, we plan to create endpoints for the [standard application modules](../modules))
* [#2882](https://github.com/abpframework/abp/issues/2882) / Providing a gRPC integration infrastructure (while it is [already possible](https://github.com/abpframework/abp-samples/tree/master/GrpcDemo) to create or consume gRPC endpoints for your application, we plan to create endpoints for the [standard application modules](../modules/index.md))
* [#57](https://github.com/abpframework/abp/issues/57) / Built-in CQRS infrastructure
* [#58](https://github.com/abpframework/abp/issues/58) / Content localization system (multilingual entities)
* [#4223](https://github.com/abpframework/abp/issues/4223) / WebHook system
* [#162](https://github.com/abpframework/abp/issues/162) / Azure ElasticDB Integration for multitenancy
* [#2296](https://github.com/abpframework/abp/issues/2296) / Feature toggling infrastructure
* [#16342](https://github.com/abpframework/abp/issues/16342) / CMS Kit: Meta information for SEO
* [#16260](https://github.com/abpframework/abp/issues/16260) / GCP Blob Storage Provider
* [#15932](https://github.com/abpframework/abp/issues/15932) / Introduce ABP Diagnostics Module
* [#16756](https://github.com/abpframework/abp/issues/16756) / Blob Storing - Provider configuration UI
* [#16744](https://github.com/abpframework/abp/issues/16744) / State Management API
### Modules / Themes
* New styles, components and features for the LeptonX theme.
* Payment module: Invoice system.
* Dynamic dashboard system.
* User guiding module.
* gRPC integration and implementation for all the pre-built modules.
### Tooling
* ABP Suite: Extra Properties on CRUD Page generation
* ABP Suite: Allow to create PAGE instead of MODAL for CRUD page generation
* ABP Suite: Export child/detail entity records
* CMS Kit features, including spam protection, social media feeds, multi-language support, and so on.
You can always check the milestone planning and the prioritized backlog issues on [the GitHub repository](https://github.com/abpframework/abp/milestones) for a detailed road map. The backlog items are subject to change. We are adding new items and changing priorities based on the community feedbacks and goals of the project.
* [#17815](https://github.com/abpframework/abp/issues/17815) / Operation Rate Limiting
### Application Modules / UI Themes
ABP Platform provides many (free and commercial) [pre-built application modules](../modules/index.md) and modern [UI themes](../ui-themes/index.md). In every release, many enhancements and bugfixes are already done on the existing modules. In addition, here some of the planned features for next versions:
* LeptonX theme: New layouts, styles and components
* CMS Kit module: Meta information for SEO, media gallery, RSS feed, content versioning, social media streams
* Identity module: Idle session warning
* Payment module: Invoice system
* New module: User notification
* New module: Dynamic dashboard
* New module: User guiding
* New module: Keycloak integration
### ABP Studio
[ABP Studio](../studio/index.md) is a cross-platform desktop application for ABP and .NET developers to simplify and automate daily tasks of developers. It has a community (free) edition as well as commercial editions. It is released and versioned independently from the ABP platform and frequently released.
Here, are some of the important planned features for next ABP Studio versions:
* Theme builder for the LeptonX theme
* Analyze user solutions to explore entities, domain services, application services, pages and other fundamental objects.
* Add status bar to the built-in browser to easily see errors
* Swagger authentication support for the built-in browser
* Show related requests/events (traces) together in the solution runner panel
* Integrate common tool dashboards into ABP Studio (such a Garana, Redis, RabbitMQ, Kibana, etc)
* Built-in command terminal
* Automate all steps of new service creation for microservice solutions
* Container application type support for Solution Runner (to individually control docker dependencies)
* More options while creating new solutions
* Downloading samples in ABP studio
* Built-in ABP documentation experience
* Auto-execute terminal commands in markdown files
* Compare changed on the startup templates when a new ABP version is published
* Remove unused projects while downloading source code of an existing module
* Testing/hosting applications for module templates
* Easily explore all module and package dependencies of a large solution
* Built-in deployment options
* Rapid application development features
* ABP support integration
### ABP Suite
[ABP Suite](../suite/index.md) is a GUI application that is mainly used to generate CRUD style pages in your application. You define your entity and it can generate all the code from the database layer to the UI layer. The generated code is clean and a perfect starting point to implement your custom requirements on top of it.
Here, are some of the important planned features for next ABP Suite versions:
* Handle image properties for entities
* Allow to define extra properties for DTOs those are not a part of the entity
* Allow to create pages instead of modals for CRUD page generation
* View-only (detail view) modal/page for an entity
* Export child/detail entity records as a part of export operation for a main (master) entity
* Allow to accept attachments (files) for an entity
* Allow to add custom entity actions for an entity
* Allow to inherit from an existing entity class
* Custom form layouts on CRUD page generation
## Feature Requests

12
docs/en/samples/index.md

@ -27,13 +27,13 @@ A simple CRUD application to show basic principles of developing an application
The following samples uses only the open source (free) modules.
* **Book Store: Razor Pages UI & Entity Framework Core**
* [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC&DB=EF)
* [Tutorial](../tutorials/book-store/part-01.md?UI=MVC&DB=EF)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore)
* **Book Store: Blazor UI & Entity Framework Core**
* [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=Blazor&DB=EF)
* [Tutorial](../tutorials/book-store/part-01.md?UI=Blazor&DB=EF)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Blazor-EfCore)
* **Book Store: Angular UI & MongoDB**
* [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=NG&DB=Mongo)
* [Tutorial](../tutorials/book-store/part-01.md?UI=NG&DB=Mongo)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Angular-MongoDb)
* **Book Store: Modular application (Razor Pages UI & EF Core)**
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Modular)
@ -43,13 +43,13 @@ The following samples uses only the open source (free) modules.
The following samples uses the pro modules.
- **Book Store: Razor Pages (MVC) UI & Entity Framework Core**
- [Tutorial](https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-1?UI=MVC&DB=EF)
- [Tutorial](../tutorials/book-store/part-01.md?UI=MVC&DB=EF)
- [Download the source code](https://abp.io/Account/Login?returnUrl=/api/download/samples/bookstore-mvc-ef)
- **Book Store: Blazor UI & Entity Framework Core**
- [Tutorial](https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-1?UI=Blazor&DB=EF)
- [Tutorial](../tutorials/book-store/part-01.md?UI=Blazor&DB=EF)
- [Download the source code](https://abp.io/Account/Login?returnUrl=/api/download/samples/bookstore-blazor-efcore)
- **Book Store: Angular UI & MongoDB**
- [Tutorial](https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-1?UI=NG&DB=Mongo)
- [Tutorial](../tutorials/book-store/part-01.md?UI=NG&DB=Mongo)
- [Download the source code](https://abp.io/Account/Login?returnUrl=/api/download/samples/bookstore-angular-mongodb)
## Other Samples

6
docs/en/solution-templates/microservice/adding-new-api-gateways.md

@ -155,12 +155,6 @@ We should configure the AuthServer for **CORS** and **RedirectAllowedUrls**.
}
```
### Add the New Gateway to the Solution Runner
We should add the new gateway to the solution runner [profile](../../studio/running-applications.md#profile) for running applications in the ABP Studio. You can follow the steps explained in the [Solution Runner](../../studio/running-applications.md#c-application) document to add the new gateway to the solution runner profile. Afterwards, you can start the new gateway by selecting it in the solution runner.
![public-gateway-solution-runner](images/public-gateway-solution-runner.png)
## Creating Helm Chart for the New Gateway
If you want to deploy the new gateway to Kubernetes, you should create a Helm chart for the new application.

6
docs/en/solution-templates/microservice/adding-new-applications.md

@ -120,12 +120,6 @@ Add the new application URL to the `appsettings.json` file in the `Identity` ser
}
```
### Add the New Application to the Solution Runner
We should add the new application to the solution runner [profile](../../studio/running-applications.md#profile) for running applications in the ABP Studio. You can follow the steps explained in the [Solution Runner](../../studio/running-applications.md#c-application) document to add the new application to the solution runner profile. Afterwards, you can start the new application by selecting it in the solution runner.
![web-public-solution-runner](images/web-public-solution-runner.png)
## Docker Configuration for Prometheus
If you want to monitor the new application with Prometheus when you debug the solution, you should add the new application to the `prometheus.yml` file in the `etc/docker/prometheus` folder. You can copy the configurations from the existing applications and modify them according to the new application. Below is an example of the `prometheus.yml` file for the `WebPublic` application.

365
docs/en/solution-templates/microservice/adding-new-microservices.md

@ -16,6 +16,8 @@ This document explains how to add new microservices to the microservice solution
Additionally, there is a folder named `_templates` in the root directory. This folder contains templates you can use to create new microservices, API gateways, and applications. These templates can be customized according to your needs.
![folder-structure](images/folder-structure.png)
## Adding a New Microservice
To add a new microservice to the solution, you can use the `service_nolayers` template. This template creates a new ASP.NET Core application with the necessary configurations and dependencies. Follow the steps below to add a new microservice:
@ -39,14 +41,12 @@ The new microservice is created and added to the solution. You can see the new m
### Configuring the appsettings.json
The new microservice is created with the necessary configurations and dependencies. We should configure several sections by modifying the `appsettings.json` file:
* Set the `Administration` & `AbpBlobStoring` connection strings.
* Set the correct `StringEncryption` key.
* Set the `CorsOrigins` to allow the web gateway to access the microservice.
* Set the `AuthServer` configurations to enable the microservice to authenticate and authorize users.
You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `appsettings.json` file for the `ProductService` microservice.
```json
```diff
{
"ConnectionStrings": {
"Administration": "Server=localhost,1434; User Id=sa; Password=myPassw@rd; Database=Bookstore_Administration; TrustServerCertificate=true",
@ -54,15 +54,18 @@ You can copy the configurations from the existing microservices and modify them
"ProductService": "Server=localhost,1434; User Id=sa; Password=myPassw@rd; Database=Bookstore_ProductService; TrustServerCertificate=true"
},
"App": {
"CorsOrigins": "http://localhost:44333",
- "CorsOrigins": "http://localhost:webgateway_port",
+ "CorsOrigins": "http://localhost:44333",
"EnablePII": false
},
"Swagger": {
"IsEnabled": true
},
"AuthServer": {
"Authority": "http://localhost:44387",
"MetaAddress": "http://localhost:44387",
- "Authority": "http://localhost:authserver_port",
- "MetaAddress": "http://localhost:authserver_port",
+ "Authority": "http://localhost:44387",
+ "MetaAddress": "http://localhost:44387",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "SwaggerTestUI",
"Audience": "ProductService"
@ -93,24 +96,24 @@ You can copy the configurations from the existing microservices and modify them
"Url": "http://localhost:9200"
},
"StringEncryption": {
"DefaultPassPhrase": "PDAWjbshpwlOwNB6"
"DefaultPassPhrase": "PDAWjbshpwlOwNB6"
}
}
```
### Configuring the OpenId Options
We should configure the OpenId options by modifying the `OpenIddictDataSeeder` in the `Identity` service. Below is an example of the `OpenIddictDataSeeder` options for the `ProductService` microservice.
We should configure the OpenId options by modifying the `OpenIddictDataSeeder` in the `Identity` service. Below is an example of the `OpenIddictDataSeeder` options for the `Product` microservice.
Create API scopes and add the required API scope for Swagger clients in the `CreateApiScopesAsync` and `CreateSwaggerClientsAsync` methods in the `OpenIddictDataSeeder` class.
```csharp
```diff
private async Task CreateApiScopesAsync()
{
await CreateScopesAsync("AuthServer");
await CreateScopesAsync("IdentityService");
await CreateScopesAsync("AdministrationService");
await CreateScopesAsync("ProductService"); // new service
+ await CreateScopesAsync("ProductService");
}
private async Task CreateSwaggerClientsAsync()
@ -120,21 +123,21 @@ private async Task CreateSwaggerClientsAsync()
"AuthServer",
"IdentityService",
"AdministrationService",
"ProductService" // new service
+ "ProductService"
});
}
```
Add the redirect URL for the new service in the `CreateSwaggerClientAsync` method.
```csharp
```diff
private async Task CreateSwaggerClientAsync(string clientId, string[] scopes)
{
...
...
...
var administrationServiceRootUrl = _configuration["OpenIddict:Resources:AdministrationService:RootUrl"]!.TrimEnd('/');
var productServiceServiceRootUrl = _configuration["OpenIddict:Resources:ProductService:RootUrl"]!.TrimEnd('/'); // new service
+ var productServiceRootUrl = _configuration["OpenIddict:Resources:ProductService:RootUrl"]!.TrimEnd('/');
await CreateOrUpdateApplicationAsync(
name: clientId,
@ -152,15 +155,15 @@ private async Task CreateSwaggerClientAsync(string clientId, string[] scopes)
$"{authServerRootUrl}/swagger/oauth2-redirect.html",
$"{identityServiceRootUrl}/swagger/oauth2-redirect.html",
$"{administrationServiceRootUrl}/swagger/oauth2-redirect.html",
$"{productServiceServiceRootUrl}/swagger/oauth2-redirect.html", // new service
+ $"{productServiceRootUrl}/swagger/oauth2-redirect.html"
}
);
}
```
Add the allowed scope for the web (front-end) application(s) in the `CreateClientsAsync` method. You might have different clients for different UI applications such as web, Angular, React, etc. Ensure you add the new service to the allowed scopes of these clients.
Add the allowed scope for the web (front-end) application(s) in the `CreateClientsAsync` method. You might have different clients for different UI applications such as web, Angular, React, etc. Ensure you add the new microservice to the allowed scopes of these clients.
```csharp
```diff
private async Task CreateClientsAsync()
{
var commonScopes = new List<string>
@ -192,7 +195,7 @@ private async Task CreateClientsAsync()
"SaasService",
"AuditLoggingService",
"AdministrationService",
"ProductService" // new service
+ "ProductService"
}).ToList(),
redirectUris: new List<string> { $"{webClientRootUrl}signin-oidc" },
postLogoutRedirectUris: new List<string>() { $"{webClientRootUrl}signout-callback-oidc" },
@ -202,110 +205,130 @@ private async Task CreateClientsAsync()
}
```
Add the new service URL to the `appsettings.json` file in the `Identity` service.
Add the new service URL to the `appsettings.json` file in the `Identity` microservice. In this example we're gonna edit the *Acme.Bookstore.IdentityService* project `appsettings.json` file.
```json
```diff
"OpenIddict": {
"Applications": {
...
},
"Resources": {
...
"ProductService": {
"RootUrl": "http://localhost:44350"
}
+ "ProductService": {
+ "RootUrl": "http://localhost:44350"
+ }
}
}
```
### Configuring the AuthServer
We should configure the AuthServer for **CORS** and **RedirectAllowedUrls**.
We should configure the *AuthServer* application `appsettings.json` file for the **CorsOrigins** and **RedirectAllowedUrls** sections.
```json
```diff
...
"App": {
"SelfUrl": "http://localhost:***",
"CorsOrigins": "...... ,http://localhost:44350",
- "CorsOrigins": "http://localhost:44358,..",
+ "CorsOrigins": "http://localhost:44358,..,http://localhost:44350",
"EnablePII": false,
"RedirectAllowedUrls": "...... ,http://localhost:44350"
}
- "RedirectAllowedUrls": "http://localhost:44358,..",
+ "RedirectAllowedUrls": "http://localhost:44358,..,http://localhost:44350"
},
...
```
### Configuring the API Gateway
We should configure the API Gateway to allow the web gateway to access the new microservice. First, we should add the **ProductService** sections to the `appsettings.json` file in the `WebGateway` project.
We should configure the API Gateway to access the new microservice. First, add the **Product** sections to the `appsettings.json` file in the `WebGateway` project. In this example we're gonna edit the *Acme.Bookstore.WebGateway* project `appsettings.json` file.
```json
```diff
"ReverseProxy": {
"Routes": {
...
"ProductService": {
"ClusterId": "ProductService",
"Match": {
"Path": "/api/productservice/{**catch-all}"
}
},
"ProductServiceSwagger": {
"ClusterId": "ProductService",
"Match": {
"Path": "/swagger-json/ProductService/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/ProductService" }
]
}
+ "Product": {
+ "ClusterId": "Product",
+ "Match": {
+ "Path": "/api/product/{**catch-all}"
+ }
+ },
+ "ProductSwagger": {
+ "ClusterId": "Product",
+ "Match": {
+ "Path": "/swagger-json/Product/swagger/v1/swagger.json"
+ },
+ "Transforms": [
+ { "PathRemovePrefix": "/swagger-json/Product" }
+ ]
+ }
},
"Clusters": {
...
"ProductService": {
"Destinations": {
"ProductService": {
"Address": "http://localhost:44350/"
}
}
}
+ "Product": {
+ "Destinations": {
+ "Product": {
+ "Address": "http://localhost:44350/"
+ }
+ }
+ }
}
}
```
Afterwards, open the `ProjectNameWebGatewayModule` class in the `WebGateway` and add the `ProductService` to the `ConfigureSwaggerUI` method.
Afterwards, open the `ProjectNameWebGatewayModule` class in the `WebGateway` project and add the `ProductService` to the `ConfigureSwaggerUI` method. In this example we're gonna edit the `BookstoreWebGatewayModule` file.
```csharp
options.OAuthScopes(
"AdministrationService",
"AuthServer",
"IdentityService",
"ProductService" // new service
);
```diff
private static void ConfigureSwaggerUI(
IProxyConfig proxyConfig,
SwaggerUIOptions options,
IConfiguration configuration)
{
foreach (var cluster in proxyConfig.Clusters)
{
options.SwaggerEndpoint($"/swagger-json/{cluster.ClusterId}/swagger/v1/swagger.json", $"{cluster.ClusterId} API");
}
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthScopes(
"AdministrationService",
"AuthServer",
...,
+ "ProductService"
);
}
```
### Configuring the UI Services
We should configure the UI application(s) to allow the new microservice to access through the web gateway. To do this, we should add the new service scope to the `ConfigureAuthentication` method in the `ProjectName...Module` class in the `Web` or `Blazor` application.
We should configure the UI application(s) to allow the new microservice to access through the web gateway. To do this, we should add the new microservice scope to the `ConfigureAuthentication` method in the `ProjectName...Module` class in the `Web` or `Blazor` application. In this example we're gonna edit the `BookstoreWebModule` file.
```csharp
context.Services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options =>
```diff
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
options.ExpireTimeSpan = TimeSpan.FromDays(365);
})
.AddAbpOpenIdConnect("oidc", options =>
{
...
options.Scope.Add("AuthServer");
options.Scope.Add("IdentityService");
options.Scope.Add("AdministrationService");
options.Scope.Add("ProductService"); // new servie
});
context.Services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
})
.AddCookie("Cookies", options =>
{
options.ExpireTimeSpan = TimeSpan.FromDays(365);
})
.AddAbpOpenIdConnect("oidc", options =>
{
...
options.Scope.Add("AuthServer");
options.Scope.Add("IdentityService");
options.Scope.Add("AdministrationService");
+ options.Scope.Add("ProductService");
});
...
}
```
Similarly, if you have an Angular application, you should add the new service scope to the `oAuthConfig` in `environment.ts`:
```typescript
```diff
const baseUrl = 'http://localhost:4200';
const oAuthConfig = {
@ -313,69 +336,83 @@ const oAuthConfig = {
redirectUri: baseUrl,
clientId: 'Angular',
responseType: 'code',
scope: 'openid profile email roles AuthServer IdentityService AdministrationService ProductService', // new service
- scope: 'openid profile email roles AuthServer IdentityService AdministrationService',
+ scope: 'openid profile email roles AuthServer IdentityService AdministrationService ProductService',
requireHttps: false
};
```
### Add the New Microservice to the Solution Runner
We should add the new microservice to the solution runner [profile](../../studio/running-applications.md#profile) for running applications in the ABP Studio. You can follow the steps explained in the [Solution Runner](../../studio/running-applications.md#c-application) document to add the new microservice to the solution runner profile. Afterwards, you can start the new microservice by selecting it in the solution runner.
![product-service-solution-runner](images/product-service-solution-runner.png)
## Docker Configuration for Prometheus
If you want to monitor the new microservice with Prometheus when you debug the solution, you should add the new microservice to the `prometheus.yml` file in the `etc/docker/prometheus` folder. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `prometheus.yml` file for the `ProductService` microservice.
If you want to monitor the new microservice with Prometheus when you debug the solution, you should add the new microservice to the `prometheus.yml` file in the `etc/docker/prometheus` folder. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `prometheus.yml` file for the `Product` microservice.
```yml
- job_name: 'product'
```diff
- job_name: 'authserver'
scheme: http
metrics_path: 'metrics'
static_configs:
- targets: ['host.docker.internal:44350']
- targets: ['host.docker.internal:44398']
...
+ - job_name: 'product'
+ scheme: http
+ metrics_path: 'metrics'
+ static_configs:
+ - targets: ['host.docker.internal:44350']
```
## Creating Helm Chart for the New Microservice
If you want to deploy the new microservice to Kubernetes, you should create a Helm chart for the new microservice.
First, we need to add the new microservice to the `build-all-images.ps1` script in the `etc/helm` folder. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `build-all-images.ps1` script for the `ProductService` microservice.
First, we need to add the new microservice to the `build-all-images.ps1` script in the `etc/helm` folder. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `build-all-images.ps1` script for the `Product` microservice.
```powershell
./build-image.ps1 -ProjectPath "../../services/product/Acme.Bookstore.ProductService/Acme.Bookstore.ProductService.csproj" -ImageName bookstore/productservice
```diff
...
./build-image.ps1 -ProjectPath "../../apps/auth-server/Acme.Bookstore.AuthServer/Acme.Bookstore.AuthServer.csproj" -ImageName bookstore/authserver
+ ./build-image.ps1 -ProjectPath "../../services/product/Acme.Bookstore.ProductService/Acme.Bookstore.ProductService.csproj" -ImageName bookstore/product
```
Then, we need to add the connection string to the `values.projectname-local.yaml` file in the `etc/helm/projectname` folder. Below is an example of the `values.bookstore-local.yaml` file for the `ProductService` microservice.
Then, we need to add the connection string to the `values.projectname-local.yaml` file in the `etc/helm/projectname` folder. Below is an example of the `values.bookstore-local.yaml` file for the `Product` microservice.
```yaml
```diff
global:
...
connectionStrings:
...
productService: "Server=[RELEASE_NAME]-sqlserver,1433; Database=Bookstore_ProductService; User Id=sa; Password=myPassw@rd; TrustServerCertificate=True"
+ product: "Server=[RELEASE_NAME]-sqlserver,1433; Database=Bookstore_ProductService; User Id=sa; Password=myPassw@rd; TrustServerCertificate=True"
```
Afterwards, we need to create a new Helm chart for the new microservice. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `productservice` Helm chart for the `ProductService` microservice.
Afterwards, we need to create a new Helm chart for the new microservice. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `product` Helm chart for the `Product` microservice.
Product microservice `values.yaml` file.
{%{
```yaml
# values.yaml
image:
repository: "bookstore/productservice"
repository: "bookstore/product"
tag: "latest"
pullPolicy: IfNotPresent
swagger:
isEnabled: "true"
```
}%}
Product microservice `Chart.yaml` file.
# Chart.yaml
{%{
```yaml
apiVersion: v2
name: productservice
name: product
version: 1.0.0
appVersion: "1.0"
description: Bookstore Product Service
```
}%}
# product.yaml
Product microservice `product.yaml` file.
{%{
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
@ -404,10 +441,15 @@ spec:
- name: "ConnectionStrings__AbpBlobStoring"
value: "{{ .Values.global.connectionStrings.blobStoring | replace "[RELEASE_NAME]" .Release.Name }}"
- name: "ConnectionStrings__ProductService"
value: "{{ .Values.global.connectionStrings.productService | replace "[RELEASE_NAME]" .Release.Name }}"
value: "{{ .Values.global.connectionStrings.product | replace "[RELEASE_NAME]" .Release.Name }}"
...
```
}%}
Product microservice `product-service.yaml` file.
# product-service.yaml
{%{
```yaml
apiVersion: v1
kind: Service
metadata:
@ -427,32 +469,113 @@ After creating the Helm chart, you can *Refresh Sub Charts* in the ABP Studio.
![kubernetes-refresh-sub-charts](images/kubernetes-refresh-sub-charts.png)
Then, update *Metadata* information right-click the *microservicename* [sub-chart](../../studio/kubernetes.md#subchart), select *Properties* it open *Chart Properties* window. You can edit in the *Metadata* tab.
Then, update *Metadata* information right-click the *microservicename* [sub-chart](../../studio/kubernetes.md#subchart), select *Properties* it open *Chart Properties* window. You should add the following keys in the *Metadata* tab.
![microservice-chart-properties](images/microservice-chart-properties-metadata.png)
- `projectPath`: The path to the microservice host application project. In the bookstore example, this value is `../../services/product/Acme.Bookstore.ProductService/Acme.Bookstore.ProductService.csproj`.
- `imageName`: When we build the Docker image, it uses this value as the Docker image name. We're going to use it in the Helm chart values.
- `projectType`: You can add a Helm chart for Angular and .NET projects, which is why we should explicitly specify the project type.
Add the *Kubernetes Services* in the *Chart Properties* -> *Kubernetes Services* tab.
![microservice-chart-properties-kubernetes-services](images/microservice-chart-properties-kubernetes-services.png)
> This value should be the same as the [solution runner application](./../../studio/running-applications.md#properties) *Kubernetes service* value. It's necessary for browsing because when we connect to the Kubernetes cluster, we should browse the Kubernetes services instead of using the Launch URL.
Last but not least, we need to configure the helm chart environments for identity, auth-server, and gateway applications.
Below is an example of the *Identity* microservice `identity.yaml` file.
{%{
```yaml
# identity.yaml
# Add this line to the "env:" section
- name: "OpenIddict__Resources__ProductService__RootUrl"
value: "http://{{ .Release.Name }}-productservice"
# authserver.yaml
# Concat the following lines for "App__CorsOrigins" section
- name: "App__CorsOrigins"
value: "...,http://{{ .Release.Name }}-administration,http://{{ .Release.Name }}-productservice"
# webapigateway.yaml
# Add this line to the "env:" section
- name: "ReverseProxy__Clusters__ProductService__Destinations__ProductService__Address"
value: "http://{{ .Release.Name }}-productservice"
```diff
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
ports:
- name: "http"
containerPort: 80
env:
...
+ - name: "OpenIddict__Resources__ProductService__RootUrl"
+ value: "http://{{ .Release.Name }}-product"
```
}%}
Below is an example of the *AuthServer* application `authserver.yaml` file.
{%{
```diff
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
ports:
- name: "http"
containerPort: 80
env:
...
- name: "App__CorsOrigins"
- value: "...,http://{{ .Release.Name }}-administration"
+ value: "...,http://{{ .Release.Name }}-administration,http://{{ .Release.Name }}-product"
```
}%}
Below is an example of the *WebApiGateway* application `webapigateway.yaml` file.
{%{
```diff
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
ports:
- name: "http"
containerPort: 80
env:
...
+ - name: "ReverseProxy__Clusters__Product__Destinations__Product__Address"
+ value: "http://{{ .Release.Name }}-product"
```
}%}
@ -465,11 +588,11 @@ You can customize the microservice template if needed. Add new configurations, d
After adding the new microservice to the solution, you can develop the UI for the new microservice. For .NET applications, you can add the microservice *Contracts* package to the UI application(s) to access the services provided by the new microservice. Afterwards, you can use the [generate-proxy](../../cli/index.md#generate-proxy) command to generate the proxy classes for the new microservice.
```bash
abp generate-proxy -t csharp -url http://localhost:44333/ -m productService --without-contracts
abp generate-proxy -t csharp -url http://localhost:44333/ -m product --without-contracts
```
Next, start creating *Pages* and *Components* for the new microservice in the UI application(s). Similarly, if you have an Angular application, you can use the [generate-proxy](../../cli/index.md#generate-proxy) command to generate the proxy classes for the new microservice and start developing the UI.
```bash
abp generate-proxy -t ng -url http://localhost:44333/ -m productService
abp generate-proxy -t ng -url http://localhost:44333/ -m product
```

BIN
docs/en/solution-templates/microservice/images/folder-structure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

4
docs/en/studio/concepts.md

@ -5,7 +5,7 @@
{
"Next": {
"Name": "Overview",
"Path": "studio/overview.md"
"Path": "studio/overview"
}
}
````
@ -46,4 +46,4 @@ Some ABP Studio terms may seem conflict with .NET and Visual Studio. To make the
| Module | Solution |
| Package | Project |
In essence, ABP Studio uses the solution term to cover all the .NET solutions and other components of your product. ABP Studio is used to build and manage the relations of these multiple .NET solutions and provides a high-level view of the whole system.
In essence, ABP Studio uses the solution term to cover all the .NET solutions and other components of your product. ABP Studio is used to build and manage the relations of these multiple .NET solutions and provides a high-level view of the whole system.

BIN
docs/en/studio/images/abp-studio-switch-to-preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

2
docs/en/studio/monitoring-applications.md

@ -5,7 +5,7 @@
{
"Next": {
"Name": "Working with Kubernetes",
"Path": "studio/kubernetes.md"
"Path": "studio/kubernetes"
}
}
````

8
docs/en/studio/overview.md

@ -35,13 +35,14 @@ The top menu is the main menu bar in ABP Studio. It offers access to various fun
### ABP Suite
[ABP Suite](https://abp.io/tools/suite) is a complementary tool to the ABP Platform, designed to enable the rapid construction of web pages in just a few minutes. With the ABP Suite button in the Top Menu, you can access the Suite from the browser embedded in ABP Studio.
[ABP Suite](https://abp.io/suite) is a complementary tool to the ABP Platform, designed to enable the rapid construction of web pages in just a few minutes. With the ABP Suite button in the Top Menu, you can access the Suite from the browser embedded in ABP Studio.
### Tools Menu
- **Options**
- **Theme:** Allows to change UI theme.
- **Extensions:** Opens the extension management window.
- **Theme:** Allows to change UI theme.
- **Global secrets**: Allows to add global secrets.
- **Global metadata**: Allows to add global metadata.
### Help Menu
@ -50,6 +51,7 @@ The top menu is the main menu bar in ABP Studio. It offers access to various fun
- **Community:** Opens the official [ABP Community](https://abp.io/community) website in your browser.
- **Support:** Opens the official [Support](https://abp.io/support/questions) website in your browser.
- **My Support Questions:** Opens the page on the official Support website in your browser showing the tickets you have opened.
- **Check for updates:** Checks for new version of ABP Studio.
- **About:** Opens the about window of ABP Studio where you can get more information about it.
## Welcome Screen

91
docs/en/studio/release-notes.md

@ -0,0 +1,91 @@
# ABP Studio Release Notes
This document contains **brief release notes** for each ABP Studio release. Release notes only include **major features** and **visible enhancements**. Therefore, they don't include all the development done in the related version.
## 0.7.9 (2024-08-29)
* Opened Readme.md file after module creation or opening a solution
* Refactor & made enhancements to microservice template
* Fixed some bugs that occur while creating a new module
* Synchronized new templates with the old templates
* Angular: Fixed logo problem in templates
## 0.7.8 (2024-08-23)
* Revised the new solution creation wizard and improved for UX
* Fixed bugs on the Blazor WebApp template
* Reduced logs count per application
## 0.7.7 (2024-08-14)
* Updated LeptonX logos in new templates
* ABP Suite: Opened modules with .sln path instead of directory (fixes some problems in Suite integration)
* Enhancements on Solution Runner
## 0.7.6 (2024-08-12)
* Removed redundant helm repo installation
* Made enhancements to the Welcome Page area
* Microservice Template: Enabled `DynamicPermissionStore` in AuthServer
* Added Blazor WebApp option for Application template
* Added **Solution Creation Info** action for identifying the solution
## 0.7.5 (2024-08-06)
* Fixed ABP Suite integration for macOS
* Fixed build errors after upgrading to ABP 8.2.1
* ABP Suite: Detected version inconsistencies and notified users to fix them automatically
## 0.7.4 (2024-07-31)
* Allowed creating open-source templates for active license owners
* Fixed basic theme problems in angular templates
* Handled docker related errors in solution runner
* Fixed versions of Chat Module packages
## 0.7.3 (2024-07-27)
* Added administrator mode indicator on the application title
* Made enhancements for aligning application title on macOS
## 0.7.2 (2024-07-26)
* Added `Blazor.Client` packages for alignment with new hosting logic
* Updated Microsoft packages to v8.0.4
* Revised application upgrade process
* Fixed profile photo problem in tiered projects
* Removed **LinkedAccounts** and **AuthorityDelegation** menu from templates
## 0.7.1 (2024-07-24)
* Fixed restart problem after installing extensions on macOS
* Provided a model for sharing the same Kubernetes cluster between developers
* Fixed the **Text Template Management** Module build problem in the app template
* Fixed login problem for the community edition
* Fixed all reported bugs & made enhancements
## 0.7.0 (2024-07-17)
* Added an option for building & starting C# applications directly
* Disabled redis on migrator when the solution is tiered
* Allowed Generating Static Proxies on ABP Studio UI
## 0.6.9 (2024-06-27)
* Allowed to open ABP Studio by clicking on a `*.abpsln` file
* Fixed solution runner multiple instance problem
* Allowed to install an NPM package to a package
## 0.6.8 (2024-06-13)
* Added free to pro upgrade option
* Fixed microservice template helm chart bugs
* Made enhancements to the new CLI
## 0.6.7 (2024-05-31)
* Added free option to app templates
* Made social login optional for the app template
* Added open-source (free) templates
* Started showing angular projects on the browser tab
* Introduced the Community Edition

2
docs/en/studio/solution-explorer.md

@ -157,7 +157,7 @@ ABP modules have their own file extension `.abpmdl`, and they are located in the
### Difference Between ABP Module Template and ABP Studio Module Approach
In ABP, creating a module solution using the [CLI](https://docs.abp.io/en/commercial/latest/startup-templates/module/creating-a-new-solution) results in a solution with numerous projects, some of which may not be necessary for a specific use case. The ABP Studio module approach differs from the ABP module template, offering greater flexibility. With ABP Studio, we can create a module containing only the required projects; for example, an empty module with only the `Domain` and `Application` projects. In this approach, the term [Package](./concepts.md#package) is used for module projects.
In ABP, creating a module solution using the [CLI](../cli/index.md) results in a solution with numerous projects, some of which may not be necessary for a specific use case. The ABP Studio module approach differs from the ABP module template, offering greater flexibility. With ABP Studio, we can create a module containing only the required projects; for example, an empty module with only the `Domain` and `Application` projects. In this approach, the term [Package](./concepts.md#package) is used for module projects.
Furthermore, it's important to mention that we can create not just DDD-principled modules. The [Modularity](../framework/architecture/modularity/basics.md) document clarifies the difference between *Framework* and *Application* modules. Basically, every C# project refers to the `Volo.Abp.Core` package and defines the *Module* class as an ABP Class Library. We have the option to develop an infrastructure module using only the *ABP Class Library* packages and provide a module reference to other modules.

15
docs/en/studio/version-compatibility.md

@ -0,0 +1,15 @@
# ABP Studio and ABP Solution Templates Version Compatibility
This document provides an overview of the compatibility between various versions of ABP Studio and [ABP Solution Templates](../solution-templates/index.md). Use this reference to ensure that you are using the correct versions of ABP Studio and ABP for your projects.
| **ABP Studio Version** | **ABP Version** |
|------------------------|---------------------------|
| 0.7.8 | 8.2.2 |
| 0.7.4 to 0.7.7 | 8.2.1 |
| 0.7.0 to 0.7.3 | 8.2.0 |
| 0.6.8 - 0.6.9 | 8.1.3 |
| 0.6.7 | 8.1.1 |
By default, ABP Studio uses stable versions to create solutions. Therefore, if you want to create a solution with a preview version, first you need to create a solution and then switch your solution to the preview version from the ABP Studio UI:
![](images/abp-studio-switch-to-preview.png)

2
docs/en/suite/generating-crud-page.md

@ -93,7 +93,7 @@ To create a new entity, make sure the *-New entity-* is selected in the **Entity
* **Customizable code**: Specifies hook-points to allow adding custom code blocks. Then, the code blocks that were written by you will not be overridden in the next entity generation and will be respected.
* **Multi-tenant**: For your multi-tenant application, you can set an entity as multi-tenant which means the data will be isolated between the tenants. To make an entity multi-tenant, ABP Suite adds the `IMultiTenant` interface to the entity. Further information see [Multi-Tenancy](https://docs.abp.io/{{Document_Language_Code}}/abp/{{Document_Version}}/Multi-Tenancy)
* **Multi-tenant**: For your multi-tenant application, you can set an entity as multi-tenant which means the data will be isolated between the tenants. To make an entity multi-tenant, ABP Suite adds the `IMultiTenant` interface to the entity. Further information see [Multi-Tenancy](../framework/architecture/multi-tenancy/index.md)
* If you created your application with *Separated tenant schema* support, then when you enable the multi-tenancy for the entity, database configurations (DbSet definitions and model configurations) will be defined in both `MyProjectNameDbContext` and `MyProjectNameTenantDbContext` (can be used for tenant-specific configurations) classes. Otherwise, the database configurations will only be defined in the `MyProjectNameDbContext` class for the host.

16
docs/en/tutorials/todo/layered/index.md

@ -3,7 +3,7 @@
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"UI": ["MVC", "Blazor", "BlazorServer", "BlazorWebApp" ,"NG"],
"DB": ["EF", "Mongo"]
}
````
@ -148,6 +148,10 @@ Ensure the `TodoApp.HttpApi.Host` project is the startup project, then run the a
You can explore and test your HTTP API with this UI. Now, we can set the `TodoApp.Blazor` as the startup project and run it to open the actual Blazor application UI:
{{else if UI=="BlazorWebApp" }}
It is good to run the application before starting the development. Ensure the `TodoApp.Blazor` project is the startup project, then run the application (Ctrl+F5 in Visual Studio) to see the initial UI:
{{else if UI=="NG"}}
It is good to run the application before starting the development. The solution has two main applications:
@ -252,7 +256,7 @@ You can apply changes to the database using the following command, in the same c
dotnet ef database update
```
> If you are using Visual Studio, you may want to use the `Add-Migration Added_TodoItem` and `Update-Database` commands in the *Package Manager Console (PMC)*. In this case, ensure that {{if UI=="MVC"}}`TodoApp.Web`{{else if UI=="BlazorServer"}}`TodoApp.Blazor`{{else if UI=="Blazor" || UI=="NG"}}`TodoApp.HttpApi.Host`{{end}} is the startup project and `TodoApp.EntityFrameworkCore` is the *Default Project* in PMC.
> If you are using Visual Studio, you may want to use the `Add-Migration Added_TodoItem` and `Update-Database` commands in the *Package Manager Console (PMC)*. In this case, ensure that {{if UI=="MVC"}}`TodoApp.Web`{{else if UI=="BlazorServer" || UI=="Blazor" || UI=="BlazorWebApp"}}`TodoApp.Blazor`{{else if UI=="Blazor" || UI=="NG"}}`TodoApp.HttpApi.Host`{{end}} is the startup project and `TodoApp.EntityFrameworkCore` is the *Default Project* in PMC.
{{else if DB=="Mongo"}}
@ -581,11 +585,11 @@ If you open the [Swagger UI](https://swagger.io/tools/swagger-ui/) by entering t
![todo-api](../images/todo-api.png)
{{else if UI=="Blazor" || UI=="BlazorServer"}}
{{else if UI=="Blazor" || UI=="BlazorServer" || UI=="BlazorWebApp"}}
### Index.razor.cs
Open the `Index.razor.cs` file in the `Pages` folder of the *TodoApp.Blazor* project and replace the content with the following code block:
Open the `Index.razor.cs` file in the `Pages` folder of the {{if UI=="BlazorWebApp"}} *TodoApp.Blazor.Client* {{else}}*TodoApp.Blazor*{{end}} project and replace the content with the following code block:
```csharp
using Microsoft.AspNetCore.Components;
@ -634,7 +638,7 @@ See the *Dynamic C# Proxies & Auto API Controllers* section below to learn how w
### Index.razor
Open the `Index.razor` file in the `Pages` folder of the *TodoApp.Blazor* project and replace the content with the following code block:
Open the `Index.razor` file in the `Pages` folder of the {{if UI=="BlazorWebApp"}} *TodoApp.Blazor.Client* {{else}} *TodoApp.Blazor* {{end}} project and replace the content with the following code block:
```xml
@page "/"
@ -676,7 +680,7 @@ Open the `Index.razor` file in the `Pages` folder of the *TodoApp.Blazor* projec
### Index.razor.css
As the final touch, open the `Index.razor.css` file in the `Pages` folder of the *TodoApp.Blazor* project and replace it with the following content:
As the final touch, open the `Index.razor.css` file in the `Pages` folder of the {{if UI=="BlazorWebApp"}}*TodoApp.Blazor.Client*{{else}}*TodoApp.Blazor*{{end}} project and replace it with the following content:
```css
#TodoList{

4
docs/en/ui-themes/lepton-x/mvc.md

@ -152,7 +152,7 @@ Commonly used components in all layouts.
![Breadcrumb](images/leptonx-breadcrumb.png)
Breadcrumbs can be customized by using the `IPageLayout` service. See [PageLayout - Breadcrumb](https://docs.abp.io/en/abp/7.2/UI%2FAspNetCore%2FPage-Header#breadcrumb) for more information.
Breadcrumbs can be customized by using the `IPageLayout` service. See [PageLayout - Breadcrumb](../../framework/ui/mvc-razor-pages/page-header.md#breadcrumb) for more information.
If you need to replace the component, you can follow the steps below.
@ -166,7 +166,7 @@ If you need to replace the component, you can follow the steps below.
![Content title](images/leptonx-content-title.png)
Page Titles can be customized by using the `IPageLayout` service. See [PageLayout - Page Title](https://docs.abp.io/en/abp/7.2/UI%2FAspNetCore%2FPage-Header#page-title) for more information.
Page Titles can be customized by using the `IPageLayout` service. See [PageLayout - Page Title](../../framework/ui/mvc-razor-pages/page-header.md#page-title) for more information.
If you need to replace the component, you can follow the steps below.

14
framework/Volo.Abp.sln

@ -467,6 +467,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.RemoteServices.Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Abstractions", "src\Volo.Abp.AspNetCore.Abstractions\Volo.Abp.AspNetCore.Abstractions.csproj", "{E1051CD0-9262-4869-832D-B951723F4DDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google", "src\Volo.Abp.BlobStoring.Google\Volo.Abp.BlobStoring.Google.csproj", "{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BlobStoring.Google.Tests", "test\Volo.Abp.BlobStoring.Google.Tests\Volo.Abp.BlobStoring.Google.Tests.csproj", "{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1393,6 +1397,14 @@ Global
{E1051CD0-9262-4869-832D-B951723F4DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1051CD0-9262-4869-832D-B951723F4DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1051CD0-9262-4869-832D-B951723F4DDE}.Release|Any CPU.Build.0 = Release|Any CPU
{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEEB5200-BBF9-464D-9B7E-8FC035A27E94}.Release|Any CPU.Build.0 = Release|Any CPU
{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1628,6 +1640,8 @@ Global
{DFAF8763-D1D6-4EB4-B459-20E31007FE2F} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{DACD4485-61BE-4DE5-ACAE-4FFABC122500} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{E1051CD0-9262-4869-832D-B951723F4DDE} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{DEEB5200-BBF9-464D-9B7E-8FC035A27E94} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{40FB8907-9CF7-44D0-8B5F-538AC6DAF8B9} = {447C8A77-E5F0-4538-8687-7383196D04EA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

29
framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs

@ -3,11 +3,15 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.RequestLocalization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.Localization;
using Volo.Abp.Security.Claims;
namespace Microsoft.Extensions.DependencyInjection;
@ -52,6 +56,7 @@ public static class AbpOpenIdConnectExtensions
options.Events.OnTokenValidated = async (context) =>
{
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<AbpAspNetCoreAuthenticationOpenIdConnectModule>>();
var client = context.HttpContext.RequestServices.GetRequiredService<IOpenIdLocalUserCreationClient>();
try
{
@ -59,8 +64,28 @@ public static class AbpOpenIdConnectExtensions
}
catch (Exception ex)
{
var logger = context.HttpContext.RequestServices.GetService<ILogger<AbpAspNetCoreAuthenticationOpenIdConnectModule>>();
logger?.LogException(ex);
logger.LogException(ex);
}
var culture = context.ProtocolMessage.GetParameter("culture");
var uiCulture = context.ProtocolMessage.GetParameter("ui-culture");
if (CultureHelper.IsValidCultureCode(culture) && CultureHelper.IsValidCultureCode(uiCulture))
{
context.Response.OnStarting(() =>
{
logger.LogInformation($"Setting culture and ui-culture to the response. culture: {culture}, ui-culture: {uiCulture}");
AbpRequestCultureCookieHelper.SetCultureCookie(
context.HttpContext,
new RequestCulture(culture, uiCulture)
);
return Task.CompletedTask;
});
}
else
{
logger.LogWarning($"Invalid culture or ui-culture parameter in the OpenIdConnect response. culture: {culture}, ui-culture: {uiCulture}");
}
};

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs

@ -1,4 +1,6 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.Libs;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.Data;
using Volo.Abp.Minify;
using Volo.Abp.Modularity;
@ -11,5 +13,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;
)]
public class AbpAspNetCoreMvcUiBundlingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
if (!context.Services.IsDataMigrationEnvironment())
{
Configure<AbpMvcLibsOptions>(options =>
{
options.CheckLibs = true;
});
}
}
}

7
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -32,6 +32,7 @@ using Volo.Abp.AspNetCore.Mvc.DataAnnotations;
using Volo.Abp.AspNetCore.Mvc.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Infrastructure;
using Volo.Abp.AspNetCore.Mvc.Json;
using Volo.Abp.AspNetCore.Mvc.Libs;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.DependencyInjection;
@ -231,6 +232,7 @@ public class AbpAspNetCoreMvcModule : AbpModule
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
AddApplicationParts(context);
CheckLibs(context);
}
private static void AddApplicationParts(ApplicationInitializationContext context)
@ -277,4 +279,9 @@ public class AbpAspNetCoreMvcModule : AbpModule
partManager.ApplicationParts.AddIfNotContains(moduleAssembly);
}
}
private static void CheckLibs(ApplicationInitializationContext context)
{
context.ServiceProvider.GetRequiredService<IAbpMvcLibsService>().CheckLibs(context);
}
}

16
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs

@ -75,10 +75,18 @@ public class AbpExceptionFilter : IAsyncExceptionFilter, IAbpFilter, ITransientD
}
else
{
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception);
if (!context.HttpContext.Response.HasStarted)
{
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception);
}
else
{
var logger = context.GetService<ILogger<AbpExceptionFilter>>(NullLogger<AbpExceptionFilter>.Instance)!;
logger.LogWarning("HTTP response has already started, cannot set headers and status code!");
}
context.Result = new ObjectResult(new RemoteServiceErrorResponse(remoteServiceErrorInfo));
}

15
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs

@ -103,10 +103,17 @@ public class AbpExceptionPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDe
}
else
{
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception!);
if (!context.HttpContext.Response.HasStarted)
{
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception!);
}
else
{
logger.LogWarning("HTTP response has already started, cannot set headers and status code!");
}
context.Result = new ObjectResult(new RemoteServiceErrorResponse(remoteServiceErrorInfo));
}

6
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsOptions.cs

@ -0,0 +1,6 @@
namespace Volo.Abp.AspNetCore.Mvc.Libs;
public class AbpMvcLibsOptions
{
public bool CheckLibs { get; set; }
}

93
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/AbpMvcLibsService.cs

@ -0,0 +1,93 @@
using System;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.FileProviders;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.Libs;
public class AbpMvcLibsService : IAbpMvcLibsService, ITransientDependency
{
private Task<bool>? _checkLibsTask;
public virtual void CheckLibs(ApplicationInitializationContext context)
{
var options = context.ServiceProvider.GetRequiredService<IOptions<AbpMvcLibsOptions>>().Value;
if (options.CheckLibs)
{
var app = context.GetApplicationBuilderOrNull();
if (app == null)
{
var logger = context.ServiceProvider.GetRequiredService<ILogger<AbpMvcLibsService>>();
logger.LogWarning($"The {nameof(IApplicationBuilder)} is not available. The 'CheckLibs' feature is disabled!");
return;
}
app.Use(async (httpContext, next) =>
{
if (!await CheckLibsAsyncOnceAsync(httpContext))
{
httpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
httpContext.Response.ContentType = "text/html";
await httpContext.Response.WriteAsync(
"<html>" +
" <head>" +
" <title>Error - The Libs folder is missing!</title>" +
" </head>" +
" <body>" +
" <h1> &#9888;&#65039; The Libs folder under the <code style='background-color: #e7e7e7;'>wwwroot/libs</code> directory is empty!</h1>" +
" <p>The Libs folder contains mandatory NPM Packages for running the project.</p>" +
" <p>Make sure you run the <code style='background-color: #e7e7e7;'>abp install-libs</code> CLI tool command.</p>" +
" <p>For more information, check out the <a href='https://abp.io/docs/latest/CLI#install-libs'>ABP CLI documentation</a></p>" +
" </body>" +
"</html>",
Encoding.UTF8
);
return;
}
await next(httpContext);
});
}
}
protected virtual Task<bool> CheckLibsAsyncOnceAsync(HttpContext httpContext)
{
if (_checkLibsTask == null)
{
_checkLibsTask = CheckLibsAsync(httpContext);
}
return _checkLibsTask;
}
protected virtual Task<bool> CheckLibsAsync(HttpContext httpContext)
{
var logger = httpContext.RequestServices.GetRequiredService<ILogger<AbpMvcLibsService>>();
try
{
var fileProvider = new PhysicalFileProvider(httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootPath);
var libsFolder = fileProvider.GetDirectoryContents("/libs");
if (!libsFolder.Exists || !libsFolder.Any())
{
logger.LogError("The 'wwwroot/libs' folder does not exist or empty!");
return Task.FromResult(false);
}
}
catch (Exception e)
{
// In case of any exception, log it and return true to prevent crashing the application.
logger.LogError(e, "An error occurred while checking the libs folder!");
}
return Task.FromResult(true);
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Libs/IAbpMvcLibsService.cs

@ -0,0 +1,6 @@
namespace Volo.Abp.AspNetCore.Mvc.Libs;
public interface IAbpMvcLibsService
{
void CheckLibs(ApplicationInitializationContext context);
}

9
framework/src/Volo.Abp.AspNetCore/Volo/Abp/ApplicationInitializationContextExtensions.cs

@ -12,7 +12,14 @@ public static class ApplicationInitializationContextExtensions
{
public static IApplicationBuilder GetApplicationBuilder(this ApplicationInitializationContext context)
{
return context.ServiceProvider.GetRequiredService<IObjectAccessor<IApplicationBuilder>>().Value!;
var applicationBuilder = context.ServiceProvider.GetRequiredService<IObjectAccessor<IApplicationBuilder>>().Value;
Check.NotNull(applicationBuilder, nameof(applicationBuilder));
return applicationBuilder;
}
public static IApplicationBuilder? GetApplicationBuilderOrNull(this ApplicationInitializationContext context)
{
return context.ServiceProvider.GetRequiredService<IObjectAccessor<IApplicationBuilder>>().Value;
}
public static IWebHostEnvironment GetEnvironment(this ApplicationInitializationContext context)

19
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Middleware;
@ -18,9 +19,21 @@ public class AbpDynamicClaimsMiddleware : AbpMiddlewareBase, ITransientDependenc
{
if (context.RequestServices.GetRequiredService<IOptions<AbpClaimsPrincipalFactoryOptions>>().Value.IsDynamicClaimsEnabled)
{
var authenticationType = context.User.Identity.AuthenticationType;
var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService<IAbpClaimsPrincipalFactory>();
context.User = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User);
var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>();
var authenticationType = authenticateResultFeature?.AuthenticateResult?.Ticket?.AuthenticationScheme ?? context.User.Identity.AuthenticationType;
if (authenticateResultFeature != null && !authenticationType.IsNullOrWhiteSpace())
{
var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService<IAbpClaimsPrincipalFactory>();
var user = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User);
authenticateResultFeature.AuthenticateResult = AuthenticateResult.Success(new AuthenticationTicket(user, authenticationType));
var httpAuthenticationFeature = context.Features.Get<IHttpAuthenticationFeature>();
if (httpAuthenticationFeature != null)
{
httpAuthenticationFeature.User = authenticateResultFeature.AuthenticateResult.Principal;
}
}
if (context.User.Identity?.IsAuthenticated == false)
{

24
framework/src/Volo.Abp.BlobStoring.Google/Volo.Abp.BlobStoring.Google.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.BlobStoring.Google</AssemblyName>
<PackageId>Volo.Abp.BlobStoring.Google</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.BlobStoring\Volo.Abp.BlobStoring.csproj" />
<PackageReference Include="Google.Cloud.Storage.V1" />
</ItemGroup>
</Project>

9
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleModule.cs

@ -0,0 +1,9 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.BlobStoring.Google;
[DependsOn(typeof(AbpBlobStoringModule))]
public class AbpBlobStoringGoogleModule : AbpModule
{
}

21
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/DefaultGoogleBlobNameCalculator.cs

@ -0,0 +1,21 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.BlobStoring.Google;
public class DefaultGoogleBlobNameCalculator : IGoogleBlobNameCalculator, ITransientDependency
{
protected ICurrentTenant CurrentTenant { get; }
public DefaultGoogleBlobNameCalculator(ICurrentTenant currentTenant)
{
CurrentTenant = currentTenant;
}
public virtual string Calculate(BlobProviderArgs args)
{
return CurrentTenant.Id == null
? $"host/{args.BlobName}"
: $"tenants/{CurrentTenant.Id.Value.ToString("D")}/{args.BlobName}";
}
}

24
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobContainerConfigurationExtensions.cs

@ -0,0 +1,24 @@
using System;
namespace Volo.Abp.BlobStoring.Google;
public static class GoogleBlobContainerConfigurationExtensions
{
public static GoogleBlobProviderConfiguration GetGoogleConfiguration(
this BlobContainerConfiguration containerConfiguration)
{
return new GoogleBlobProviderConfiguration(containerConfiguration);
}
public static BlobContainerConfiguration UseGoogle(
this BlobContainerConfiguration containerConfiguration,
Action<GoogleBlobProviderConfiguration> googleConfigureAction)
{
containerConfiguration.ProviderType = typeof(GoogleBlobProvider);
containerConfiguration.NamingNormalizers.TryAdd<GoogleBlobNamingNormalizer>();
googleConfigureAction(new GoogleBlobProviderConfiguration(containerConfiguration));
return containerConfiguration;
}
}

120
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobNamingNormalizer.cs

@ -0,0 +1,120 @@
using System.Globalization;
using System.Text.RegularExpressions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Localization;
namespace Volo.Abp.BlobStoring.Google;
public class GoogleBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency
{
/// <summary>
/// https://cloud.google.com/storage/docs/buckets#naming
/// </summary>
public string NormalizeContainerName(string containerName)
{
using (CultureHelper.Use(CultureInfo.InvariantCulture))
{
// All letters in a Bucket name must be lowercase.
containerName = containerName.ToLower();
// Bucket names must contain 3-63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
if(containerName.Contains("."))
{
if (containerName.Length > 222)
{
containerName = containerName.Substring(0, 222);
}
var parts = containerName.Split('.');
for (var i = 0; i < parts.Length; i++)
{
if (parts[i].Length > 63)
{
parts[i] = parts[i].Substring(0, 63);
}
}
containerName = string.Join(".", parts);
}
else if (containerName.Length > 63)
{
containerName = containerName.Substring(0, 63);
}
//Bucket names can only contain lowercase letters, numeric characters, dashes (-), underscores (_), and dots (.). Spaces are not allowed. Names containing dots require verification.
containerName = Regex.Replace(containerName, "[^a-z0-9-_.]", string.Empty);
//Be a syntactically valid DNS name (for example, bucket..example.com is not valid because it contains two dots in a row).
containerName = Regex.Replace(containerName, "[.]{2,}", ".");
//Bucket names cannot be represented as an IP address in dotted-decimal notation (for example, 192.168.5.4).
containerName = Regex.Replace(containerName, "^(?:(?:^|\\.)(?:2(?:5[0-5]|[0-4]\\d)|1?\\d?\\d)){4}$", string.Empty);
//Bucket names cannot begin with the "goog" prefix.
containerName = Regex.Replace(containerName, "^goog", string.Empty);
//Bucket names cannot contain "google" or close misspellings, such as "g00gle".
containerName = Regex.Replace(containerName, "google", string.Empty);
//Bucket names must start and end with a number or letter.
containerName = RemoveInvalidStartEndCharacters(containerName);
// Bucket names must be from 3 through 63 characters long. Names containing dots can contain up to 222 characters.
if (containerName.Length < 3)
{
var length = containerName.Length;
for (var i = 0; i < 3 - length; i++)
{
containerName += "0";
}
}
return containerName;
}
}
protected virtual string RemoveInvalidStartEndCharacters(string containerName)
{
if (string.IsNullOrWhiteSpace(containerName))
{
return containerName;
}
if (!char.IsLetterOrDigit(containerName[0]))
{
containerName = containerName.Substring(1);
return RemoveInvalidStartEndCharacters(containerName);
}
if (!char.IsLetterOrDigit(containerName[containerName.Length - 1]))
{
containerName = containerName.Substring(0, containerName.Length - 1);
return RemoveInvalidStartEndCharacters(containerName);
}
return containerName;
}
/// <summary>
/// https://cloud.google.com/storage/docs/objects#naming
/// </summary>
public string NormalizeBlobName(string blobName)
{
//Object names can contain any sequence of valid Unicode characters, of length 1-1024 bytes when UTF-8 encoded
if (blobName.Length > 1024)
{
blobName = blobName.Substring(0, 1024);
}
//Object names cannot contain Carriage Return or Line Feed characters.
blobName = Regex.Replace(blobName, "[\r\n]", string.Empty);
//Object names cannot start with .well-known/acme-challenge/.
blobName = Regex.Replace(blobName, "^\\.well-known/acme-challenge/", string.Empty);
//Objects cannot be named . or ...
blobName = Regex.Replace(blobName, "^\\.\\.?$", string.Empty);
return blobName;
}
}

161
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProvider.cs

@ -0,0 +1,161 @@
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using Google;
using Google.Apis.Auth.OAuth2;
using Google.Cloud.Storage.V1;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.BlobStoring.Google;
public class GoogleBlobProvider : BlobProviderBase, ITransientDependency
{
protected IGoogleBlobNameCalculator GoogleBlobNameCalculator { get; }
protected IBlobNormalizeNamingService BlobNormalizeNamingService { get; }
public GoogleBlobProvider(IGoogleBlobNameCalculator googleBlobNameCalculator, IBlobNormalizeNamingService blobNormalizeNamingService)
{
GoogleBlobNameCalculator = googleBlobNameCalculator;
BlobNormalizeNamingService = blobNormalizeNamingService;
}
public async override Task SaveAsync(BlobProviderSaveArgs args)
{
var configuration = args.Configuration.GetGoogleConfiguration();
var storageClient = await GetStorageClientClientAsync(args);
var blobName = GoogleBlobNameCalculator.Calculate(args);
var containerName = GetContainerName(args);
if (await BlobExistsAsync(args, blobName) && !args.OverrideExisting)
{
throw new BlobAlreadyExistsException($"Saving BLOB '{args.BlobName}' does already exists in the container '{GetContainerName(args)}'! Set {nameof(args.OverrideExisting)} if it should be overwritten.");
}
if (configuration.CreateContainerIfNotExists)
{
await CreateContainerIfNotExists(args);
}
await storageClient.UploadObjectAsync(containerName, blobName, contentType: "application/octet-stream", args.BlobStream);
}
public async override Task<bool> DeleteAsync(BlobProviderDeleteArgs args)
{
var storageClient = await GetStorageClientClientAsync(args);
var blobName = GoogleBlobNameCalculator.Calculate(args);
var containerName = GetContainerName(args);
try
{
await storageClient.DeleteObjectAsync(containerName, blobName);
}
catch (GoogleApiException e) when (e.HttpStatusCode == HttpStatusCode.NotFound)
{
return true;
}
return true;
}
public async override Task<bool> ExistsAsync(BlobProviderExistsArgs args)
{
var blobName = GoogleBlobNameCalculator.Calculate(args);
return await BlobExistsAsync(args, blobName);
}
public async override Task<Stream?> GetOrNullAsync(BlobProviderGetArgs args)
{
var storageClient = await GetStorageClientClientAsync(args);
var blobName = GoogleBlobNameCalculator.Calculate(args);
var containerName = GetContainerName(args);
if(!await BlobExistsAsync(args, blobName))
{
return null;
}
var stream = new MemoryStream();
await storageClient.DownloadObjectAsync(containerName, blobName, stream);
stream.Seek(0, SeekOrigin.Begin);
return stream;
}
protected virtual string GetContainerName(BlobProviderArgs args)
{
var configuration = args.Configuration.GetGoogleConfiguration();
return configuration.ContainerName.IsNullOrWhiteSpace()
? args.ContainerName
: BlobNormalizeNamingService.NormalizeContainerName(args.Configuration, configuration.ContainerName!);
}
protected virtual async Task<bool> BlobExistsAsync(BlobProviderArgs args, string blobName)
{
var storageClient = await GetStorageClientClientAsync(args);
if(!await ContainerExistsAsync(args, storageClient))
{
return false;
}
try
{
await storageClient.GetObjectAsync(GetContainerName(args), blobName);
}
catch (GoogleApiException e) when (e.HttpStatusCode == HttpStatusCode.NotFound)
{
return false;
}
return true;
}
protected virtual async Task CreateContainerIfNotExists(BlobProviderArgs args)
{
var storageClient = await GetStorageClientClientAsync(args);
var configuration = args.Configuration.GetGoogleConfiguration();
if(await ContainerExistsAsync(args, storageClient))
{
return;
}
await storageClient.CreateBucketAsync(configuration.ProjectId, GetContainerName(args));
}
protected virtual async Task<bool> ContainerExistsAsync(BlobProviderArgs args, StorageClient client)
{
try
{
await client.GetBucketAsync(GetContainerName(args));
}
catch (GoogleApiException e) when (e.HttpStatusCode == HttpStatusCode.NotFound)
{
return false;
}
return true;
}
protected virtual async Task<StorageClient> GetStorageClientClientAsync(BlobProviderArgs args)
{
var configuration = args.Configuration.GetGoogleConfiguration();
if (configuration.UseApplicationDefaultCredentials)
{
return await StorageClient.CreateAsync();
}
var googleCredential = GoogleCredential.FromServiceAccountCredential(
new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(configuration.ClientEmail)
{
ProjectId = configuration.ProjectId,
Scopes = configuration.Scopes
}
.FromPrivateKey(configuration.PrivateKey)
));
return await StorageClient.CreateAsync(googleCredential);
}
}

79
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProviderConfiguration.cs

@ -0,0 +1,79 @@
using System.Collections.Generic;
namespace Volo.Abp.BlobStoring.Google;
public class GoogleBlobProviderConfiguration
{
private readonly BlobContainerConfiguration _containerConfiguration;
public GoogleBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration)
{
_containerConfiguration = containerConfiguration;
}
/// <summary>
/// Unique identifier for your project.
/// For more info see: https://cloud.google.com/resource-manager/docs/creating-managing-projects
/// </summary>
public string? ProjectId {
get => _containerConfiguration.GetConfigurationOrDefault<string>(GoogleBlobProviderConfigurationNames.ProjectId);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.ProjectId, value);
}
/// <summary>
/// Email address that generated by the Google Cloud.
/// </summary>
public string? ClientEmail {
get => _containerConfiguration.GetConfigurationOrDefault<string>(GoogleBlobProviderConfigurationNames.ClientEmail);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.ClientEmail, value);
}
/// <summary>
/// Private key that generated by Google Cloud.
/// Starts with '-----BEGIN PRIVATE KEY-----'
/// and ends with '-----END PRIVATE KEY-----'
/// </summary>
public string? PrivateKey {
get => _containerConfiguration.GetConfigurationOrDefault<string>(GoogleBlobProviderConfigurationNames.PrivateKey);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.PrivateKey, value);
}
/// <summary>
/// Available OAuth 2.0 scopes.
/// </summary>
public List<string>? Scopes {
get => _containerConfiguration.GetConfigurationOrDefault(GoogleBlobProviderConfigurationNames.Scopes, new List<string>());
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.Scopes, value);
}
/// <summary>
/// Use the application default credentials. https://cloud.google.com/docs/authentication/provide-credentials-adc
/// Default value: false.
/// </summary>
public bool UseApplicationDefaultCredentials {
get => _containerConfiguration.GetConfigurationOrDefault(GoogleBlobProviderConfigurationNames.UseApplicationDefaultCredentials, false);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.UseApplicationDefaultCredentials, value);
}
/// <summary>
/// The name can only contain lowercase letters, numeric characters, dashes (-), underscores (_), and dots (.). Spaces are not allowed. Names containing dots require verification.
/// Must start and end with a number or letter.
/// Must contain 3-63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
/// Cannot be represented as an IP address in dotted-decimal notation (for example, 192.168.5.4).
/// Cannot begin with the "goog" prefix.
/// Cannot contain "google" or close misspellings, such as "g00gle".
/// If this parameter is not specified, the ContainerName of the <see cref="BlobProviderArgs"/> will be used.
/// </summary>
public string? ContainerName {
get => _containerConfiguration.GetConfigurationOrDefault<string>(GoogleBlobProviderConfigurationNames.ContainerName);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.ContainerName, value);
}
/// <summary>
/// Default value: false.
/// </summary>
public bool CreateContainerIfNotExists {
get => _containerConfiguration.GetConfigurationOrDefault(GoogleBlobProviderConfigurationNames.CreateContainerIfNotExists, false);
set => _containerConfiguration.SetConfiguration(GoogleBlobProviderConfigurationNames.CreateContainerIfNotExists, value);
}
}

12
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/GoogleBlobProviderConfigurationNames.cs

@ -0,0 +1,12 @@
namespace Volo.Abp.BlobStoring.Google;
public static class GoogleBlobProviderConfigurationNames
{
public const string ProjectId = "Google.ProjectId";
public const string ClientEmail = "Google.ClientEmail";
public const string PrivateKey = "Google.PrivateKey";
public const string Scopes = "Google.Scopes";
public const string UseApplicationDefaultCredentials = "Google.ApplicationDefaultCredentials";
public const string ContainerName = "Google.ContainerName";
public const string CreateContainerIfNotExists = "Google.CreateContainerIfNotExists";
}

6
framework/src/Volo.Abp.BlobStoring.Google/Volo/Abp/BlobStoring/Google/IGoogleBlobNameCalculator.cs

@ -0,0 +1,6 @@
namespace Volo.Abp.BlobStoring.Google;
public interface IGoogleBlobNameCalculator
{
string Calculate(BlobProviderArgs args);
}

28
framework/src/Volo.Abp.Core/Volo/Abp/Http/UrlHelpers.cs

@ -0,0 +1,28 @@
using System;
namespace Volo.Abp.Http;
public static class UrlHelpers
{
private const string WildcardSubdomain = "*.";
public static bool IsSubdomainOf(string subdomain, string domain)
{
if (Uri.TryCreate(subdomain, UriKind.Absolute, out var subdomainUri) &&
Uri.TryCreate(domain.Replace(WildcardSubdomain, string.Empty), UriKind.Absolute, out var domainUri))
{
return domainUri == subdomainUri || IsSubdomainOf(subdomainUri, domainUri);
}
return false;
}
public static bool IsSubdomainOf(Uri subdomain, Uri domain)
{
return subdomain.IsAbsoluteUri
&& domain.IsAbsoluteUri
&& subdomain.Scheme == domain.Scheme
&& subdomain.Port == domain.Port
&& subdomain.Host.EndsWith($".{domain.Host}", StringComparison.Ordinal);
}
}

12
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs

@ -614,7 +614,19 @@ public abstract class AbpDbContext<TDbContext> : DbContext, IAbpEfCoreDbContext,
return;
}
ExtraPropertyDictionary? originalExtraProperties = null;
if (entry.Entity is IHasExtraProperties)
{
originalExtraProperties = entry.OriginalValues.GetValue<ExtraPropertyDictionary>(nameof(IHasExtraProperties.ExtraProperties));
}
entry.Reload();
if (entry.Entity is IHasExtraProperties)
{
ObjectHelper.TrySetProperty(entry.Entity.As<IHasExtraProperties>(), x => x.ExtraProperties, () => originalExtraProperties);
}
ObjectHelper.TrySetProperty(entry.Entity.As<ISoftDelete>(), x => x.IsDeleted, () => true);
SetDeletionAuditProperties(entry);
}

9
framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs

@ -13,16 +13,23 @@ public class LocalizedTemplateContentReaderFactory : ILocalizedTemplateContentRe
protected IVirtualFileProvider VirtualFileProvider { get; }
protected ConcurrentDictionary<string, ILocalizedTemplateContentReader> ReaderCache { get; }
protected SemaphoreSlim SyncObj;
protected IAbpHostEnvironment AbpHostEnvironment { get; }
public LocalizedTemplateContentReaderFactory(IVirtualFileProvider virtualFileProvider)
public LocalizedTemplateContentReaderFactory(IVirtualFileProvider virtualFileProvider, IAbpHostEnvironment abpHostEnvironment)
{
VirtualFileProvider = virtualFileProvider;
AbpHostEnvironment = abpHostEnvironment;
ReaderCache = new ConcurrentDictionary<string, ILocalizedTemplateContentReader>();
SyncObj = new SemaphoreSlim(1, 1);
}
public virtual async Task<ILocalizedTemplateContentReader> CreateAsync(TemplateDefinition templateDefinition)
{
if (AbpHostEnvironment.IsDevelopment())
{
return await CreateInternalAsync(templateDefinition);
}
if (ReaderCache.TryGetValue(templateDefinition.Name, out var reader))
{
return reader;

4
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Urls/AppUrlProvider.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.UI.Navigation.Urls;
@ -43,7 +44,8 @@ public class AppUrlProvider : IAppUrlProvider, ITransientDependency
{
redirectAllowedUrls.Add((await NormalizeUrlAsync(redirectAllowedUrl))!);
}
var allow = redirectAllowedUrls.Any(x => url.StartsWith(x, StringComparison.CurrentCultureIgnoreCase));
var allow = redirectAllowedUrls.Any(x => url.StartsWith(x, StringComparison.CurrentCultureIgnoreCase) ||
UrlHelpers.IsSubdomainOf(url, x));
if (!allow)
{
Logger.LogError($"Invalid RedirectUrl: {url}, Use {nameof(AppUrlProvider)} to configure it!");

16
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json

@ -8,7 +8,7 @@
"The {0} field only accepts files with the following extensions: {1}": "El campo {0} sólo acepta ficheros con la siguientes extensiones: {1}",
"The field {0} must be a string or array type with a maximum length of '{1}'.": "El campo {0} debe ser de tipo cadena o lista con una longitud máxima de '{1}'.",
"The field {0} must be a string or array type with a minimum length of '{1}'.": "El campo {0} debe ser de tipo cadena o lista con una longitud máxima de '{1}'.",
"The {0} field is not a valid phone number.": "El campo no tiene un número de teléfono valido.",
"The {0} field is not a valid phone number.": "El campo {0} no tiene un número de teléfono valido.",
"The field {0} must be between {1} and {2}.": "El campo {0} debe estar entre {1} y {2}.",
"The field {0} must match the regular expression '{1}'.": "El campo {0} no coincide con el formato solicitado.",
"The {0} field is required.": "El campo {0} es requerido.",
@ -23,17 +23,17 @@
"ThisFieldIsNotValid.": "Este campo no es valido.",
"ThisFieldIsNotAValidEmailAddress.": "Este campo no es una dirección de e-mail valida.",
"ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "Este campo sólo acepta ficheros con las siguientes extensiones: {0}",
"ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "Este campo debe ser una cadena o lista con una longitud máxima de {1}.",
"ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo debe ser una cadena o lista con una longitud mínima de {1}.",
"ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "Este campo debe ser una cadena o lista con una longitud máxima de {0}.",
"ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo debe ser una cadena o lista con una longitud mínima de {0}.",
"ThisFieldIsNotAValidPhoneNumber.": "Este campo no es un número de teléfono valido.",
"ThisFieldMustBeBetween{0}And{1}": "Este campo debe estar entre {0} y {1}.",
"ThisFieldMustBeGreaterThanOrEqual{0}": "Este campo debe ser mayor o igual a {0}.",
"ThisFieldMustBeLessOrEqual{0}": "Este campo debe ser menor o igual a {0}.",
"ThisFieldMustMatchTheRegularExpression{0}": "Este campo debe coincidir con la expresión regular '{0}'.",
"ThisFieldIsRequired.": "Este campo es requerido",
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Este campo debe ser una cadena con una longitud máxima de {1}.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Este campo debe ser una cadena con una longitud mínima de {2} y máxima de {1}.",
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "El campo {0} no es una URL (http, https o ftp) valida.",
"ThisFieldIsInvalid.": "Este en un campo no valido."
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Este campo debe ser una cadena con una longitud máxima de {0}.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Este campo debe ser una cadena con una longitud mínima de {1} y máxima de {0}.",
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "El campo no es una URL (http, https o ftp) valida.",
"ThisFieldIsInvalid.": "Este campo no es válido."
}
}
}

6
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.GlobalFeatures;
using Volo.Abp.AspNetCore.Mvc.Libs;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.Localization.Resource;
using Volo.Abp.AspNetCore.Security.Claims;
@ -140,6 +141,11 @@ public class AbpAspNetCoreMvcTestModule : AbpModule
});
context.Services.TransformAbpClaims();
Configure<AbpMvcLibsOptions>(options =>
{
options.CheckLibs = false;
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

19
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo.Abp.BlobStoring.Google.Tests.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.test.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace />
<UserSecretsId>9f0d2c00-80c1-435b-bfab-2c39c8249091</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.BlobStoring.Google\Volo.Abp.BlobStoring.Google.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<ProjectReference Include="..\Volo.Abp.BlobStoring.Tests\Volo.Abp.BlobStoring.Tests.csproj" />
</ItemGroup>
</Project>

19
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleTestBase.cs

@ -0,0 +1,19 @@
using Volo.Abp.Testing;
namespace Volo.Abp.BlobStoring.Google;
public class AbpBlobStoringGoogleTestCommonBase : AbpIntegratedTest<AbpBlobStoringGoogleTestCommonModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}
public class AbpBlobStoringGoogleTestBase : AbpIntegratedTest<AbpBlobStoringGoogleTestModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}

90
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/AbpBlobStoringGoogleTestModule.cs

@ -0,0 +1,90 @@
using System;
using System.Threading.Tasks;
using Google.Apis.Auth.OAuth2;
using Google.Cloud.Storage.V1;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace Volo.Abp.BlobStoring.Google;
/// <summary>
/// This module will not try to connect to Google Cloud Storage.
/// </summary>
[DependsOn(
typeof(AbpBlobStoringGoogleModule),
typeof(AbpBlobStoringTestModule)
)]
public class AbpBlobStoringGoogleTestCommonModule : AbpModule
{
}
[DependsOn(
typeof(AbpBlobStoringGoogleTestCommonModule)
)]
public class AbpBlobStoringGoogleTestModule : AbpModule
{
private const string UserSecretsId = "9f0d2c00-80c1-435b-bfab-2c39c8249091";
private string _clientEmail;
private string _projectId;
private string _privateKey;
private readonly string _randomContainerName = "abp-test-container-" + Guid.NewGuid().ToString("N");
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.ReplaceConfiguration(ConfigurationHelper.BuildConfiguration(builderAction: builder =>
{
builder.AddUserSecrets(UserSecretsId);
}));
var configuration = context.Services.GetConfiguration();
_clientEmail = configuration["Google:ClientEmail"];
_projectId = configuration["Google:ProjectId"];
_privateKey = configuration["Google:PrivateKey"];
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureAll((containerName, containerConfiguration) =>
{
containerConfiguration.UseGoogle(google =>
{
google.ClientEmail = _clientEmail;
google.ProjectId = _projectId;
google.PrivateKey = _privateKey;
google.ContainerName = _randomContainerName;
google.CreateContainerIfNotExists = true;
});
});
});
}
public override void OnApplicationShutdown(ApplicationShutdownContext context)
{
var googleCredential = GoogleCredential.FromServiceAccountCredential(
new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(_clientEmail)
{
ProjectId = _projectId
}
.FromPrivateKey(_privateKey)
));
var client = StorageClient.Create(googleCredential);
try
{
client.DeleteBucket(_randomContainerName, new DeleteBucketOptions
{
DeleteObjects = true
});
}
catch (Exception e)
{
// ignored
}
}
}

94
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/DefaultGoogleBlobNamingNormalizerProvider_Tests.cs

@ -0,0 +1,94 @@
using Shouldly;
using Xunit;
namespace Volo.Abp.BlobStoring.Google;
public class DefaultGoogleBlobNamingNormalizerProvider_Tests: AbpBlobStoringGoogleTestCommonBase
{
private readonly IBlobNamingNormalizer _blobNamingNormalizer;
public DefaultGoogleBlobNamingNormalizerProvider_Tests()
{
_blobNamingNormalizer = GetRequiredService<IBlobNamingNormalizer>();
}
[Fact]
public void NormalizeContainerName_Lowercase()
{
var filename = "ThisIsMyContainerName";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("thisismycontainername");
}
[Fact]
public void NormalizeContainerName_Only_Letters_Numbers_Dash_Dots_Underscores()
{
var filename = ",./this-i,/s-my-c,/ont,/ai+*/=!@#$n^&*er.name+/";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("this-is-my-container.name");
}
[Fact]
public void NormalizeContainerName_Only_Start_With_Letters_Or_Numbers()
{
var filename = "-this.--is-.-.-my--_container---name-";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("this.--is-.-.-my--_container---name");
filename = ".this.--is-.-.-my--container---name0._";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("this.--is-.-.-my--container---name0");
}
[Fact]
public void NormalizeContainerName_Min_Length()
{
var filename = "a";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.Length.ShouldBeGreaterThanOrEqualTo(3);
}
[Fact]
public void NormalizeContainerName_Max_Length()
{
var filename = "abpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabpabp";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.Length.ShouldBeLessThanOrEqualTo(63);
}
[Fact]
public void NormalizeContainerName_Must_Not_Be_Ip_Address()
{
var filename = "192.168.5.4";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("000");
filename = "a.192.168.5.4";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("a.192.168.5.4");
}
[Fact]
public void NormalizeContainerName_Dots()
{
var filename = ".this..is.my.container....name.";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("this.is.my.container.name");
}
[Fact]
public void NormalizeContainerName_DNS()
{
var filename = "bucket...example..com";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("bucket.example.com");
}
[Fact]
public void NormalizeContainerName_Max_Length_Dash()
{
var filename = "-this-is-my-container-name-abpabpabpabpabpabpabpabp-a-b-p-a--b-p-";
filename = _blobNamingNormalizer.NormalizeContainerName(filename);
filename.ShouldBe("this-is-my-container-name-abpabpabpabpabpabpabpabp-a-b-p-a--b");
}
}

13
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/GoogleBlobContainer_Tests.cs

@ -0,0 +1,13 @@
using Xunit;
namespace Volo.Abp.BlobStoring.Google;
/*
//Please set the correct connection string in secrets.json and continue the test.
public class GoogleBlobContainer_Tests : BlobContainer_Tests<AbpBlobStoringGoogleTestModule>
{
public GoogleBlobContainer_Tests()
{
}
}
*/

56
framework/test/Volo.Abp.BlobStoring.Google.Tests/Volo/Abp/BlobStoring/Google/GoogleBlobNameCalculator_Tests.cs

@ -0,0 +1,56 @@
using System;
using Shouldly;
using Volo.Abp.MultiTenancy;
using Xunit;
namespace Volo.Abp.BlobStoring.Google;
public class GoogleBlobNameCalculator_Tests : AbpBlobStoringGoogleTestCommonBase
{
private readonly IGoogleBlobNameCalculator _calculator;
private readonly ICurrentTenant _currentTenant;
private const string GoogleContainerName = "/";
private const string GoogleSeparator = "/";
public GoogleBlobNameCalculator_Tests()
{
_calculator = GetRequiredService<IGoogleBlobNameCalculator>();
_currentTenant = GetRequiredService<ICurrentTenant>();
}
[Fact]
public void Default_Settings()
{
_calculator.Calculate(
GetArgs("my-container", "my-blob")
).ShouldBe($"host{GoogleSeparator}my-blob");
}
[Fact]
public void Default_Settings_With_TenantId()
{
var tenantId = Guid.NewGuid();
using (_currentTenant.Change(tenantId))
{
_calculator.Calculate(
GetArgs("my-container", "my-blob")
).ShouldBe($"tenants{GoogleSeparator}{tenantId:D}{GoogleSeparator}my-blob");
}
}
private static BlobProviderArgs GetArgs(
string containerName,
string blobName)
{
return new BlobProviderGetArgs(
containerName,
new BlobContainerConfiguration().UseGoogle(x =>
{
x.ContainerName = containerName;
}),
blobName
);
}
}

43
framework/test/Volo.Abp.Core.Tests/Volo/Abp/Http/UrlHelpers_Tests.cs

@ -0,0 +1,43 @@
using Shouldly;
using Xunit;
namespace Volo.Abp.Http;
public class UrlHelpers_Tests
{
[Theory]
[InlineData(null)]
[InlineData("null")]
[InlineData("http://")]
[InlineData("http://*")]
[InlineData("http://.domain")]
[InlineData("http://.domain/hello")]
public void IsSubdomainOf_ReturnsFalseIfDomainIsMalformedUri(string domain)
{
var actual = UrlHelpers.IsSubdomainOf("http://*.domain", domain);
actual.ShouldBeFalse();
}
[Theory]
[InlineData("http://sub.domain", "http://domain")]
[InlineData("http://sub.domain", "http://*.domain")]
[InlineData("http://sub.sub.domain", "http://*.domain")]
[InlineData("http://sub.sub.domain", "http://*.sub.domain")]
[InlineData("http://sub.domain:4567", "http://*.domain:4567")]
public void IsSubdomainOf_ReturnsTrue_WhenASubdomain(string subdomain, string domain)
{
var actual = UrlHelpers.IsSubdomainOf(subdomain, domain);
actual.ShouldBeTrue();
}
[Theory]
[InlineData("http://sub.domain:1234", "http://*.domain:5678")]
[InlineData("http://sub.domain", "http://domain.*")]
[InlineData("http://sub.domain.hacker", "http://*.domain")]
[InlineData("https://sub.domain", "http://*.domain")]
public void IsSubdomainOf_ReturnsFalse_WhenNotASubdomain(string subdomain, string domain)
{
var actual = UrlHelpers.IsSubdomainOf(subdomain, domain);
actual.ShouldBeFalse();
}
}

22
framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/Domain/ExtraProperties_Tests.cs

@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Volo.Abp.Data;
using Volo.Abp.Domain.Repositories;
@ -59,6 +60,27 @@ public class ExtraProperties_Tests : ExtraProperties_Tests<AbpEntityFrameworkCor
});
}
[Fact]
public async Task Should_Get_An_Extra_Property_After_Soft_Deletion()
{
var london = await CityRepository.FindByNameAsync("London");
london.HasProperty("PhoneCode").ShouldBeTrue();
london.GetProperty<string>("PhoneCode").ShouldBe("42");
await CityRepository.DeleteAsync(london);
london = await CityRepository.FindByNameAsync("London");
london.ShouldBeNull();
using (var uow = ServiceProvider.GetRequiredService<IDataFilter>().Disable<ISoftDelete>())
{
london = await CityRepository.FindByNameAsync("London");
london.IsDeleted.ShouldBeTrue();
london.HasProperty("PhoneCode").ShouldBeTrue();
london.GetProperty<string>("PhoneCode").ShouldBe("42");
}
}
public enum Color
{
Red = 0,

4
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/City.cs

@ -5,12 +5,14 @@ using Volo.Abp.Domain.Entities;
namespace Volo.Abp.TestApp.Domain;
public class City : AggregateRoot<Guid>
public class City : AggregateRoot<Guid>, ISoftDelete
{
public string Name { get; set; }
public ICollection<District> Districts { get; set; }
public bool IsDeleted { get; set; }
private City()
{

3
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/ConcurrencyStamp_Tests.cs

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Modularity;
using Volo.Abp.TestApp.Domain;
using Xunit;
@ -49,7 +50,7 @@ public abstract class ConcurrencyStamp_Tests<TStartupModule> : TestAppTestBase<T
//And deleting my old entity throws exception!
await Assert.ThrowsAsync<AbpDbConcurrencyException>(async () =>
{
await CityRepository.DeleteAsync(london1);
await CityRepository.HardDeleteAsync(london1);
});
}
}

3
framework/test/Volo.Abp.TextTemplating.Razor.Tests/Volo/Abp/TextTemplating/Razor/RazorLocalizedTemplateContentReaderFactory_Tests.cs

@ -12,7 +12,8 @@ public class RazorLocalizedTemplateContentReaderFactory_Tests : LocalizedTemplat
LocalizedTemplateContentReaderFactory = new LocalizedTemplateContentReaderFactory(
new PhysicalFileVirtualFileProvider(
new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(),
"Volo", "Abp", "TextTemplating", "Razor"))));
"Volo", "Abp", "TextTemplating", "Razor"))),
GetRequiredService<IAbpHostEnvironment>());
WelcomeEmailEnglishContent = "@inherits Volo.Abp.TextTemplating.Razor.RazorTemplatePageBase<Volo.Abp.TextTemplating.Razor.RazorTemplateRendererProvider_Tests.WelcomeEmailModel>" +
Environment.NewLine +

3
framework/test/Volo.Abp.TextTemplating.Scriban.Tests/Volo/Abp/TextTemplating/Scriban/ScribanLocalizedTemplateContentReaderFactory_Tests.cs

@ -11,7 +11,8 @@ public class ScribanLocalizedTemplateContentReaderFactory_Tests : LocalizedTempl
LocalizedTemplateContentReaderFactory = new LocalizedTemplateContentReaderFactory(
new PhysicalFileVirtualFileProvider(
new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(),
"Volo", "Abp", "TextTemplating", "Scriban"))));
"Volo", "Abp", "TextTemplating", "Scriban"))),
GetRequiredService<IAbpHostEnvironment>());
WelcomeEmailEnglishContent = "Welcome {{model.name}} to the abp.io!";
WelcomeEmailTurkishContent = "Merhaba {{model.name}}, abp.io'ya hoşgeldiniz!";

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

Loading…
Cancel
Save