Contactmodule: token- en inzendroute met spamafhandeling, idempotentie en retentietaak
Nieuwe module SlpModularCms.Modules.Contact met eigen DbContext en migratie InitialCreate. GET contact-messages/token en POST contact-messages zijn publiek ([PublicSiteEndpoint]), geven bij echte inzendingen, spam en herhalingen hetzelfde 202 en slaan spam apart op (30 dagen, dagplafond). Standaard staat de module uit (Contact:Enabled=false, 404 met lege body, geen databasetoegang) totdat de rate limiting per client op de basisbranch staat; de rate-limit-sleutel zit in een enkele functie zodat dat later een regel wijzigen is. Mail zit achter een seam (nog een no-op). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ using SlpModularCms.Core.Observability;
|
||||
using SlpModularCms.Modules.Availability.Controllers;
|
||||
using SlpModularCms.Modules.Availability.Middleware;
|
||||
using SlpModularCms.Modules.Availability.Services;
|
||||
using SlpModularCms.Modules.Contact.Controllers;
|
||||
using SlpModularCms.Modules.Identity.Controllers;
|
||||
using SlpModularCms.Modules.Master.Controllers;
|
||||
using SlpModularCms.Modules.Offerings.Controllers;
|
||||
@@ -158,6 +159,8 @@ public class PublicSiteEndpointGateTests
|
||||
private static readonly string[] AllowedPublicActions =
|
||||
[
|
||||
$"{nameof(OfferingsController)}.{nameof(OfferingsController.GetOfferings)}",
|
||||
$"{nameof(ContactMessagesController)}.{nameof(ContactMessagesController.GetToken)}",
|
||||
$"{nameof(ContactMessagesController)}.{nameof(ContactMessagesController.Submit)}",
|
||||
];
|
||||
|
||||
private static IReadOnlyList<MethodInfo> AllActions() =>
|
||||
@@ -167,6 +170,7 @@ public class PublicSiteEndpointGateTests
|
||||
typeof(UsersController).Assembly,
|
||||
typeof(CmsInstanceController).Assembly,
|
||||
typeof(OfferingsController).Assembly,
|
||||
typeof(ContactMessagesController).Assembly,
|
||||
typeof(SystemController).Assembly,
|
||||
}
|
||||
.Distinct()
|
||||
|
||||
+1
@@ -34,6 +34,7 @@
|
||||
<!-- Only for the route-table test (PublicSiteEndpointGateTests): it inspects the controllers of
|
||||
every module a host can load to prove which endpoints stay reachable behind the gate. -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SlpModularCms.Modules.Contact\SlpModularCms.Modules.Contact.csproj" />
|
||||
<ProjectReference Include="..\SlpModularCms.Modules.Identity\SlpModularCms.Modules.Identity.csproj" />
|
||||
<ProjectReference Include="..\SlpModularCms.Modules.Master\SlpModularCms.Modules.Master.csproj" />
|
||||
<ProjectReference Include="..\SlpModularCms.Modules.Offerings\SlpModularCms.Modules.Offerings.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user