8adb09a083
The 2026-06-26 design kept the key env-only. The file is now an explicit fallback: SCADABRIDGE_API_KEY (non-blank) -> ScadaBridge:ApiKey (non-blank, trimmed) -> not configured. Env-only stays the recommended production posture; the failure message names both sources. Claude-Session: https://claude.ai/code/session_013L3XdmVii9i5sY4FChU8pB
24 lines
1.0 KiB
C#
24 lines
1.0 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.DelmiaNotifier;
|
|
|
|
/// <summary>Root of <c>appsettings.json</c>; mirrors the <c>ScadaBridge</c> section only.</summary>
|
|
internal sealed class NotifierConfig
|
|
{
|
|
/// <summary>The <c>ScadaBridge</c> configuration section (base URLs, timeout, log path).</summary>
|
|
public ScadaBridgeSection ScadaBridge { get; set; } = new();
|
|
}
|
|
|
|
internal sealed class ScadaBridgeSection
|
|
{
|
|
/// <summary>Comma-separated failover list of base URLs (the method path is appended by the app).</summary>
|
|
public string? BaseUrls { get; set; }
|
|
|
|
/// <summary>Per-attempt HTTP timeout in seconds.</summary>
|
|
public int TimeoutSeconds { get; set; } = 30;
|
|
|
|
/// <summary>Optional diagnostic log file (relative to the exe); null/omitted → stderr only.</summary>
|
|
public string? LogPath { get; set; }
|
|
|
|
/// <summary>Optional inbound API key. <c>SCADABRIDGE_API_KEY</c> in the environment takes precedence; this is the file fallback (design 2026-06-26, relaxed 2026-09-02).</summary>
|
|
public string? ApiKey { get; set; }
|
|
}
|