8ecfe84540
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>
36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace WebhookServer.Gui.Converters;
|
|
|
|
public sealed class NullToBoolConverter : IValueConverter
|
|
{
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> value is not null;
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> throw new NotSupportedException();
|
|
}
|
|
|
|
public sealed class StringEqualsConverter : IValueConverter
|
|
{
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> string.Equals(value as string, parameter as string, StringComparison.OrdinalIgnoreCase);
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> (value is bool b && b) ? parameter : Binding.DoNothing;
|
|
}
|
|
|
|
public sealed class BoolToBrushConverter : IValueConverter
|
|
{
|
|
public Brush TrueBrush { get; set; } = Brushes.SeaGreen;
|
|
public Brush FalseBrush { get; set; } = Brushes.IndianRed;
|
|
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> (value is bool b && b) ? TrueBrush : FalseBrush;
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> throw new NotSupportedException();
|
|
}
|