Beschikbaarheidspoort laat publieke site-endpoints door en 429 geeft Retry-After met ProblemDetails

Nieuwe marker [PublicSiteEndpoint] (deny-by-default): alleen GET /offerings blijft bereikbaar als het CMS uit staat of in onderhoud is; alle andere acties, adminroutes inbegrepen, blijven 503. OnRejected zet Retry-After en schrijft application/problem+json met alleen type, title en status. Op master zijn de limiet-policies nog globale buckets: de contactroutes mogen pas live na de per-client-partitionering van de ASF-branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 13:07:18 +01:00
co-authored by Claude Sonnet 5.5
parent c3c8bcfd5e
commit a58374abeb
12 changed files with 510 additions and 10 deletions
@@ -0,0 +1,32 @@
using System.Reflection;
using FluentAssertions;
using Microsoft.AspNetCore.Authorization;
using SlpModularCms.Core.Availability;
using SlpModularCms.Modules.Offerings.Controllers;
namespace SlpModularCms.Modules.Offerings.Tests.Controllers;
public class OfferingsPublicMarkerTests
{
private static IEnumerable<MethodInfo> Actions() =>
new[] { typeof(OfferingsController), typeof(OfferingCategoriesController) }
.SelectMany(t => t.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly));
[Fact]
public void GetOfferings_IsMarkedAsPublicSiteEndpoint_AndAnonymous()
{
var action = typeof(OfferingsController).GetMethod(nameof(OfferingsController.GetOfferings))!;
action.GetCustomAttribute<PublicSiteEndpointAttribute>().Should().NotBeNull();
action.GetCustomAttribute<AllowAnonymousAttribute>().Should().NotBeNull();
}
[Fact]
public void NoOtherOfferingsAction_CarriesTheMarker()
{
Actions()
.Where(m => m.Name != nameof(OfferingsController.GetOfferings))
.Where(m => m.GetCustomAttribute<PublicSiteEndpointAttribute>() is not null)
.Should().BeEmpty("writes and the category management stay behind the availability gate");
}
}