Class WebhookSubscriptionProps

Assembly: redb.Identity.Core.dll

W1 — outbound webhook subscription. One row per HTTP endpoint that
receives identity events as POST bodies, signed with HMAC-SHA256.

Delivery semantics:
* Fire-and-forget from the originating mutation's perspective:
WebhookDeliveryRouteConsumer picks events off a
WireTap of the identity-events route and dispatches them
async, so a slow webhook receiver never back-pressures the
token endpoint or admin API.
* Per-subscription exponential backoff with retry limit. Failures
after retries are logged + audited as WebhookDeliveryFailed
so operators can wire alerting without leaving the audit log.


Filtering:
* = "*" — receive every event.
* Comma-separated list of CamelCase IDs from
IdentityAuditEventIds (e.g. "UserCreated,UserDeleted").
* Prefix cat: matches by category instead — e.g.
"cat:admin,cat:authentication" delivers every admin + auth event.


Signing:
* Body is canonical JSON of the IdentityEvent envelope.
* Header X-RedbIdentity-Signature = sha256=<hex> of
HMAC-SHA256(secret, body). GitHub-style — covers raw body
bytes only, so receivers verify with the standard HMAC-SHA256
recipe without canonical-payload-recomposition pitfalls.
* Header X-RedbIdentity-Timestamp = ISO-8601 UTC.
* Header X-RedbIdentity-Delivery = per-attempt GUID
(idempotency key the receiver can dedupe on).
* Header X-RedbIdentity-EventType = canonical event id.
Receivers verify by recomputing HMAC over timestamp + "." + body
using the shared secret. Reject the signature window beyond ±5min to
dampen replay; the timestamp + delivery id make replay detection
trivial.

[RedbScheme("identity.webhook_subscription")]
public class WebhookSubscriptionProps

Inheritance

Object→WebhookSubscriptionProps

Properties

ConcurrencyToken

Optional self-rolled concurrency token surfaced on update so a

public string? ConcurrencyToken { get; set; }

Description

public string? Description { get; set; }

DisplayName

Operator-facing label rendered in the admin UI.

public string? DisplayName { get; set; }

Enabled

Master enable switch — disabled subscriptions are skipped.

public bool Enabled { get; set; }

EventTypeFilter

Filter expression — "" (everything), comma-separated event ids,

public string EventTypeFilter { get; set; }

ExtraHeaders

Extra HTTP headers attached to every delivery (e.g. an

public Dictionary<string, string>? ExtraHeaders { get; set; }

HmacSecret

HMAC-SHA256 secret. Generated server-side on create (returned

public string HmacSecret { get; set; }

MaxAttempts

Max delivery attempts (including the first). Exponential backoff

public int MaxAttempts { get; set; }

RetryBackoffMs

Backoff base in milliseconds. Default 500.

public int RetryBackoffMs { get; set; }

TimeoutMs

Per-attempt timeout in milliseconds. Default 5000.

public int TimeoutMs { get; set; }

Url

Absolute HTTP(S) URL the event is POSTed to. Validated at create

public string Url { get; set; }