Initial WebhookServer implementation
Add the .NET 8 solution scaffolded against PLAN.md. Three projects share WebhookServer.Core (models, auth, execution, storage, IPC, callbacks) and WebhookServer.Service hosts an embedded Kestrel listener plus the named-pipe admin server. WebhookServer.Gui is a thin MVVM client over the pipe. Includes 25 unit tests covering HMAC verification, bearer auth, IP allowlist parsing, arg-template rendering, DPAPI round-trip, and the encrypt-on-save config store. Install/uninstall PowerShell scripts default to LocalSystem and accept a domain user or gMSA via -ServiceAccount. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
namespace WebhookServer.Core.Models;
|
||||
|
||||
public sealed class EndpointConfig
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Slug { get; set; } = "";
|
||||
public string? Description { get; set; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
public List<string> AllowedClients { get; set; } = new();
|
||||
|
||||
public AuthMode AuthMode { get; set; } = AuthMode.None;
|
||||
public BearerOptions? Bearer { get; set; }
|
||||
public HmacOptions? Hmac { get; set; }
|
||||
|
||||
public ExecutorType ExecutorType { get; set; } = ExecutorType.WindowsPowerShell;
|
||||
|
||||
/// <summary>Path to a script file (.ps1, .bat, .cmd) when applicable.</summary>
|
||||
public string? ScriptPath { get; set; }
|
||||
|
||||
/// <summary>Inline command body when no script file is used (PowerShell -Command, cmd /c).</summary>
|
||||
public string? InlineCommand { get; set; }
|
||||
|
||||
/// <summary>Path to the executable when ExecutorType = Executable.</summary>
|
||||
public string? ExecutablePath { get; set; }
|
||||
|
||||
/// <summary>Static argv prefix for Executable mode; the rendered ArgTemplate appends after.</summary>
|
||||
public List<string> ExecutableArgs { get; set; } = new();
|
||||
|
||||
public string? WorkingDirectory { get; set; }
|
||||
|
||||
public DataPassingOptions DataPassing { get; set; } = new();
|
||||
|
||||
public ResponseMode ResponseMode { get; set; } = ResponseMode.Sync;
|
||||
|
||||
public int TimeoutSeconds { get; set; } = 60;
|
||||
|
||||
/// <summary>If true, a non-zero process exit produces 502 in sync mode (default true).</summary>
|
||||
public bool FailOnNonZeroExit { get; set; } = true;
|
||||
|
||||
/// <summary>If true, requests are processed one at a time per endpoint.</summary>
|
||||
public bool Serialize { get; set; }
|
||||
|
||||
public CallbackConfig? Callback { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user