Ir al contenido

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.

EricksonLopez.Webhooks — Visión General

EricksonLopez.Webhooks (1.0.0 en NuGet, L3, 432 descargas) ofrece entrega HTTP saliente protegida por filtros SSRF de EricksonLopez.Security.Network, reintentos Polly con Retry-After, verificación HMAC-SHA256 en tiempo constante y persistencia Redis anti-repetición y dead-letter.

  • Entrega saliente protegida contra SSRF: AddWebhooks() conecta SafeSocketsHttpHandlerFactory (EnableSsrfProtection = true por defecto) para impedir sondeos hacia redes internas o metadatos cloud.
  • Verificación entrante en tiempo constante y anti-repetición: AddWebhookReceiver() + UseWebhookReceiver() / RequireWebhookSignature() valida firmas HMAC-SHA256, tolerancia temporal y unicidad de entregas (InMemoryWebhookReplayDetector o RedisWebhookReplayDetector).
  • Resiliencia Retry-After (429/503) y DLQ: Respeta cabeceras Retry-After (hasta 5 minutos) y deriva payloads agotados a IWebhookDeadLetterSink (NoOpWebhookDeadLetterSink o RedisWebhookDeadLetterSink).
flowchart LR
Out["IWebhookSender"] --> Sign["WebhookSigner (HMAC-SHA256)"]
Sign --> SSRF["SafeSocketsHttpHandlerFactory + Retry-After"]
SSRF --> DLQ["IWebhookDeadLetterSink (on exhaustion)"]
InReq["Incoming POST"] --> Val["IWebhookValidator + IWebhookReplayDetector"]
Entrega Saliente Protegida contra SSRF y Verificación EntranteIWebhookSender firma payloads y entrega mediante SafeSocketsHttpHandlerFactory con Retry-After, mientras el middleware ASP.NET Core entrante valida firmas y consulta IWebhookReplayDetector.
Ver descripción textual y tabla accesible

IWebhookSender firma payloads y entrega mediante SafeSocketsHttpHandlerFactory con Retry-After, mientras el middleware ASP.NET Core entrante valida firmas y consulta IWebhookReplayDetector.

flowchart LR
Out["IWebhookSender"] --> Sign["WebhookSigner (HMAC-SHA256)"]
Sign --> SSRF["SafeSocketsHttpHandlerFactory + Retry-After"]
SSRF --> DLQ["IWebhookDeadLetterSink (on exhaustion)"]
InReq["Incoming POST"] --> Val["IWebhookValidator + IWebhookReplayDetector"]

3 de 4 paquetes están publicados en 1.0.0 en NuGet (net8.0;net9.0;net10.0; localVersion: 2.1.0 en disco), mientras EricksonLopez.Webhooks.PaymentGateways permanece sin publicar (2.1.0 solo local). Estado AOT global Full (4 / 4 IsAotCompatible=true, EnableTrimAnalyzer=true):

  • EricksonLopez.Webhooks (168 dl, 1.0.0, AOT Full): AddWebhooks, IWebhookSender, WebhookSigner, WebhookSecret, WebhookSenderOptions.
  • EricksonLopez.Webhooks.AspNetCore (133 dl, 1.0.0, AOT Full): AddWebhookReceiver, AddInMemoryReplayDetector, UseWebhookReceiver, RequireWebhookSignature.
  • EricksonLopez.Webhooks.Redis (131 dl, 1.0.0, AOT Full): AddRedisWebhookReplayDetector, AddRedisWebhookDeadLetterSink.
  • EricksonLopez.Webhooks.PaymentGateways (Sin publicar, local 2.1.0, AOT Full): AddPaymentGatewayWebhookSchemes().

Medidos desde benchmarks.json (5 / 5 filas medidas del BenchmarkDotNet.Artifacts raíz bajo BenchmarkDotNet v0.14.0, .NET 10.0.11 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI, Job=Dry / ColdStart (IterationCount=1, WarmupCount=1) — sin reportes NativeAOT):

  • WebhookSignerBenchmarks.ComputeSignature_SmallPayload: 281,300 ns (281.3 μs) / 0 B
  • WebhookSignerBenchmarks.ComputeSignature_MediumPayload: 290,100 ns (290.1 μs) / 0 B
  • WebhookSignerBenchmarks.VerifySignature_ConstantTime: 754,700 ns (754.7 μs) / 0 B
  • DeadLetterSinkBenchmarks.DeadLetterSink_EnqueueAsync: 2,862,000 ns (2.862 ms) / 0 B
  • WebhookSenderBenchmarks.WebhookSender_SendAsync_Success: 171,800,000 ns (171.8 ms) / 15,749 B (15.38 KB)

(Una ejecución DefaultJob separada en benchmarks/EricksonLopez.Webhooks.Benchmarks/ reporta 288.3 ns en ComputeSignature_SmallPayload, 1,406.8 ns en MediumPayload y 479.7 ns / 360 B en VerifySignature_ConstantTime.)