Skip to main content

ASP.NET Core UI

Valiant.Settings.AspNetCore provides a compact settings explorer and a JSON document backed by generated schema providers.

using Valiant.Settings.AspNetCore;
using Valiant.Settings.DependencyInjection;

builder.Services.AddValiantSettings(builder.Configuration);

var app = builder.Build();
app.MapValiantSettingsUi();

The default routes are:

RoutePurpose
/_valiant/settingsInteractive schema explorer
/_valiant/settings/schemasGenerated schema JSON document

Change the route

app.MapValiantSettingsUi(options =>
options.Path = "/admin/settings");

The JSON endpoint follows the prefix at /admin/settings/schemas.

Show current runtime values

app.MapValiantSettingsUi(options =>
{
options.ShowRuntimeValues = true;
});

Runtime values are resolved dynamically from IOptions<TSettings> for registered schemas only. If schema-provider registration is disabled, the UI has no generated catalog to display.

Protect secrets

[ValiantSecret] properties are masked. Valiant also masks common sensitive names such as Password, Secret, Token, ApiKey, ClientSecret, and ConnectionString.

Explicitly permit reveal only when endpoint authorization and hosting policy make it acceptable:

RouteGroupBuilder settings = app.MapValiantSettingsUi(options =>
{
options.ShowRuntimeValues = true;
options.AllowSecretReveal = true;
});

settings.RequireAuthorization("SettingsAdministrators");

Secret values remain masked until a user selects reveal. The JSON endpoint accepts ?revealSecrets=true only when AllowSecretReveal is enabled.

Treat the explorer as an administrative endpoint

The package does not decide your authorization policy. Protect the returned RouteGroupBuilder, especially when runtime values or secret reveal are enabled.

Run the default UI, custom authorization, runtime-value masking, and explicit secret-reveal variants from the Settings sample catalog.