Ledon.Webhooks 0.0.1

dotnet add package Ledon.Webhooks --version 0.0.1
                    
NuGet\Install-Package Ledon.Webhooks -Version 0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ledon.Webhooks" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ledon.Webhooks" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ledon.Webhooks" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ledon.Webhooks --version 0.0.1
                    
#r "nuget: Ledon.Webhooks, 0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ledon.Webhooks@0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ledon.Webhooks&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ledon.Webhooks&version=0.0.1
                    
Install as a Cake Tool

Ledon.Webhooks

出站 Webhook:事件订阅、HMAC 签名、指数退避重试、死信记录与重放。投递走后台队列,不阻塞业务请求。

builder.Services.AddLedonWebhooks(o =>
{
    o.MaxAttempts = 5;
    o.RequireAuthorization = true;   // 生产建议开启管理端点授权
});

发布事件:

public class OrderService(IWebhookPublisher webhooks)
{
    public Task CreatedAsync(Guid orderId, CancellationToken ct) =>
        webhooks.PublishAsync("order.created", new { orderId }, ct);
}

接收方验签:

var timestamp = request.Headers["X-Ledon-Timestamp"];
var body = await new StreamReader(request.Body).ReadToEndAsync();
var expected = HMACSHA256(secret, $"{timestamp}.{body}");
// 与 X-Ledon-Signature: sha256=... 比较
  • 事件信封:{ id, type, occurredAtUtc, data };
  • 请求头:X-Ledon-Event / X-Ledon-Delivery / X-Ledon-Timestamp / X-Ledon-Signature;
  • 订阅 EventTypes 为空匹配全部,支持 * 通配;
  • 管理端点:/webhooks/subscriptions、/webhooks/deliveries、死信查询与重放;
  • 投递记录默认内存环形缓冲,可替换 IWebhookDeliveryStore 持久化。

完整文档:https://github.com/wosledon/ledon-framework

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1 46 10/28/2026