review(Host): allow-anonymous /metrics + unconditional LDAP validator
Code review at HEAD 7286d320. Host-001 (High): /metrics was auth-gated on admin
nodes (Prometheus 401) -> AllowAnonymous. Host-002: register LdapOptionsValidator
unconditionally for fail-fast startup validation on admin-only nodes. Host-004: fix
metrics XML doc. Host-003 (docs) left Open.
This commit is contained in:
@@ -37,14 +37,16 @@ public static class ObservabilityExtensions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mounts the Prometheus scrape endpoint on the existing ASP.NET pipeline. Call after
|
||||
/// <c>app.UseAuthentication/UseAuthorization</c> if metrics access should require auth;
|
||||
/// the default leaves it unauthenticated for local Prometheus scrapes.
|
||||
/// Mounts the Prometheus <c>/metrics</c> scrape endpoint on the existing ASP.NET pipeline.
|
||||
/// The endpoint is explicitly marked <c>AllowAnonymous</c> so unauthenticated Prometheus
|
||||
/// scrapers can reach it regardless of the host's auth fallback policy (which on admin-role
|
||||
/// nodes is <c>RequireAuthenticatedUser</c>). This mirrors the behaviour of
|
||||
/// <c>MapZbHealth</c>, which also marks its endpoints anonymous.
|
||||
/// </summary>
|
||||
/// <param name="app">The endpoint route builder.</param>
|
||||
public static IEndpointRouteBuilder MapOtOpcUaMetrics(this IEndpointRouteBuilder app)
|
||||
{
|
||||
app.MapZbMetrics();
|
||||
app.MapZbMetrics().AllowAnonymous();
|
||||
return app;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user