Master-URL: ongeldige of placeholder-waarde wordt nooit opgeslagen of verstuurd (master slaat achtergrondchecks over, slave weigert met 400, poller meldt invalid_master_url); veilige diagnostiek bij een mislukte poll; releasenote Master__MasterUrl

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 21:08:47 +01:00
co-authored by Claude Sonnet 5.5
parent 64a467b41b
commit 195443d9a9
11 changed files with 230 additions and 4 deletions
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SlpModularCms.Core.Availability;
using SlpModularCms.Core.Observability;
using SlpModularCms.Modules.Availability.Models;
using SlpModularCms.Modules.Availability.Services;
@@ -25,7 +26,14 @@ public class MasterController : ControllerBase
var apiKey = Request.Headers["X-Master-Api-Key"].FirstOrDefault();
if (string.IsNullOrEmpty(apiKey)) return RejectKey();
var success = await _svc.RegisterAsync(request.MasterUrl, apiKey);
// The address is stored and polled later: refuse one that cannot be used, and say so without echoing it.
if (!MasterUrlRules.IsValid(request.MasterUrl))
{
_logger.LogWarning("Master registration refused: the master URL is not an absolute http(s) address (invalid_master_url).");
return BadRequest(new { code = "invalid_master_url", detail = "The master URL must be an absolute http(s) address, for example https://master.example.com." });
}
var success = await _svc.RegisterAsync(request.MasterUrl.Trim(), apiKey);
return success ? Ok() : RejectKey();
}