GET System/capabilities blijft bereikbaar als het CMS uit staat of in onderhoud is

De actie krijgt [PublicSiteEndpoint] (en [AllowAnonymous]), zodat een gast op de loginpagina geen 503 meer krijgt; de lijst van publieke acties in de route-table-test en een pipelinetest (CMS in onderhoud) zijn bijgewerkt. Besluit van Bryan: de beschikbaarheidsstatussen blokkeren alleen het CMS, nooit de publieke site.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 13:25:57 +01:00
co-authored by Claude Sonnet 5.5
parent 99066f7ed6
commit b39fc5b6ea
3 changed files with 19 additions and 0 deletions
@@ -315,4 +315,18 @@ public class ContactPipelineGateTests(EnabledContactHostFactory factory) : IClas
post.StatusCode.Should().Be(HttpStatusCode.Accepted);
(await factory.WithDb(db => db.ContactMessages.CountAsync(m => m.Name == "Pipeline Gate"))).Should().Be(1);
}
[Fact]
public async Task TheLoginPageRoutes_NeverAnswer503_WhileTheCmsIsDisabled()
{
await factory.WithDb(db => db.Database.ExecuteSqlRawAsync(
"INSERT INTO AvailabilityState (Id, Status, Message, LastUpdatedAt, UpdatedBy) VALUES (UUID(), 2, 'maintenance pipeline test', NOW(), 'pipeline test')"));
var client = factory.CreateClient();
// A guest on a disabled or maintenance CMS must still be able to read what the login page needs.
(await client.GetAsync("/api/v1/System/capabilities")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/Availability/status")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/offerings")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/contact-messages")).StatusCode.Should().Be(HttpStatusCode.ServiceUnavailable, "the management routes stay behind the gate");
}
}