Read the Heimdall app secret from Heimdall__AppSecretFile; env value deprecated

The file wins, is read once when the options are built, and a set-but-missing,
unreadable or empty file stops startup in every environment without naming the
secret. Heimdall__AppSecret still works and logs a deprecation warning.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-12 13:24:59 +00:00
commit 95d2e8d262
5 changed files with 201 additions and 2 deletions

View file

@ -64,7 +64,8 @@ builder.Services
builder.Services
.AddOptions<HeimdallOptions>()
.BindConfiguration(HeimdallOptions.SectionName);
.BindConfiguration(HeimdallOptions.SectionName)
.PostConfigure<ILogger<HeimdallOptions>>(HeimdallOptions.ResolveAppSecret);
builder.Services
.AddOptions<StripeOptions>()