Skip to content

Class SendGridInvitationDeliveryAspNetCoreOptions

Namespace: Cephalon.MultiTenancy.Governance.SendGridDelivery.AspNetCore.Configuration
Assembly: Cephalon.MultiTenancy.Governance.SendGridDelivery.AspNetCore.dll

Configures ASP.NET Core SendGrid Event Webhook callback translation for tenant-invitation delivery status updates.

public sealed class SendGridInvitationDeliveryAspNetCoreOptions

objectSendGridInvitationDeliveryAspNetCoreOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

SendGridInvitationDeliveryAspNetCoreOptions()

Section titled “ SendGridInvitationDeliveryAspNetCoreOptions()”

Initializes a new instance of the class.

public SendGridInvitationDeliveryAspNetCoreOptions()

Gets or sets the actor value recorded on translated SendGrid delivery status observations.

public string Actor { get; set; }

string

Gets or sets a value indicating whether SendGrid Event Webhook event identifiers should be used to skip duplicate translated events that are already present in the delivery-status observation store.

public bool EnableEventWebhookEventIdIdempotency { get; set; }

bool

The endpoint uses the stable sg_event_id-backed observation id generated by the SendGrid mapper. This is observation-store-backed idempotency, not a durable raw callback inbox or distributed replay ledger.

Gets or sets a value indicating whether verified SendGrid signed Event Webhook requests should be protected against replay inside the current process.

public bool EnableSignedEventWebhookReplayProtection { get; set; }

bool

Replay protection is active only when is enabled and the request signature verifies successfully. The built-in guard stores bounded signature fingerprints in memory and does not claim distributed replay protection or durable provider callback inbox ownership.

Gets or sets a value indicating whether the SendGrid Event Webhook callback endpoint should be mapped.

public bool EnableStatusCallbackEndpoint { get; set; }

bool

ExcludeStatusCallbackEndpointFromDescription

Section titled “ ExcludeStatusCallbackEndpointFromDescription”

Gets or sets a value indicating whether the SendGrid callback endpoint should be excluded from OpenAPI descriptions.

public bool ExcludeStatusCallbackEndpointFromDescription { get; set; }

bool

Gets or sets a value indicating whether SendGrid engagement events such as open and click should be recorded as delivered.

public bool MapEngagementEventsAsDelivered { get; set; }

bool

The default is false so the endpoint records deliverability events only. Enable this when a host deliberately wants engagement events to update invitation delivery status.

Gets or sets the maximum number of SendGrid events accepted in one callback request.

public int MaxEventsPerRequest { get; set; }

int

Gets or sets the maximum request body size accepted by the SendGrid callback endpoint, in bytes.

public int MaxRequestBodyBytes { get; set; }

int

NormalizeProviderMessageIdFromSgMessageId

Section titled “ NormalizeProviderMessageIdFromSgMessageId”

Gets or sets a value indicating whether the prefix before the first dot in sg_message_id should be used for provider matching.

public bool NormalizeProviderMessageIdFromSgMessageId { get; set; }

bool

Twilio SendGrid recommends storing the Mail Send API X-Message-ID response header to correlate Event Webhook posts. Event Webhook payloads carry sg_message_id; the prefix commonly matches the stored X-Message-ID, so this option keeps Cephalon’s provider-message guard usable without weakening it.

Gets or sets a value indicating whether translated delivery status should be recorded on the invitation.

public bool RecordStatus { get; set; }

bool

Gets or sets a value indicating whether translated SendGrid events must match an existing provider message id.

public bool RequireProviderMessageMatch { get; set; }

bool

Gets or sets a value indicating whether SendGrid signed Event Webhook requests must verify before translation.

public bool RequireSignedEventWebhook { get; set; }

bool

When enabled, the endpoint verifies the SendGrid ECDSA-SHA256 signature over the exact raw request body plus the timestamp header before parsing JSON or reconciling any event. The public verification key must be configured.

Gets or sets a value indicating whether the SendGrid callback endpoint should require authorization.

public bool RequireStatusCallbackAuthorization { get; set; }

bool

The endpoint performs an in-handler authorization check by default. Hosts can satisfy it with ASP.NET Core authentication, a SendGrid OAuth policy, a gateway, or deliberately disable it for trusted test hosts.

Gets or sets the SendGrid public verification key used for signed Event Webhook verification.

public string? SignedEventWebhookPublicKey { get; set; }

string?

The value may be a PEM public key or a Base64-encoded SubjectPublicKeyInfo payload. Environment-variable friendly escaped newlines (\n) are normalized before import.

Gets or sets the maximum number of verified SendGrid signed Event Webhook fingerprints retained in the current process.

public int SignedEventWebhookReplayCacheLimit { get; set; }

int

When the bounded cache is full, the oldest fingerprint is evicted before recording a new accepted signed callback.

Gets or sets the process-local retention window, in seconds, for verified SendGrid signed Event Webhook fingerprints.

public int SignedEventWebhookReplayRetentionSeconds { get; set; }

int

The endpoint clamps the effective retention to at least one second. The default matches the signature timestamp tolerance.

Gets or sets the request header that carries the SendGrid Event Webhook signature.

public string SignedEventWebhookSignatureHeaderName { get; set; }

string

SignedEventWebhookSignatureToleranceSeconds

Section titled “ SignedEventWebhookSignatureToleranceSeconds”

Gets or sets the allowed clock skew, in seconds, for SendGrid signed Event Webhook timestamps.

public int SignedEventWebhookSignatureToleranceSeconds { get; set; }

int

The endpoint clamps the effective tolerance to at least one second. The default is five minutes.

Gets or sets the request header that carries the Unix timestamp included in the SendGrid Event Webhook signature.

public string SignedEventWebhookTimestampHeaderName { get; set; }

string

Gets or sets the source value recorded on translated SendGrid delivery status observations.

public string Source { get; set; }

string

Gets or sets the optional ASP.NET Core authorization policy required by the SendGrid callback endpoint.

public string? StatusCallbackAuthorizationPolicy { get; set; }

string?

Gets or sets the ASP.NET Core route pattern used for SendGrid Event Webhook callbacks.

public string StatusCallbackRoutePattern { get; set; }

string

The default route stays under /engine because this endpoint is a provider-adapter ingress surface, not an application-owned onboarding API.

FromConfiguration(IConfiguration?, string)

Section titled “ FromConfiguration(IConfiguration?, string)”

Reads SendGrid ASP.NET Core callback options from configuration.

public static SendGridInvitationDeliveryAspNetCoreOptions FromConfiguration(IConfiguration? configuration, string sectionPath = "Engine")

configuration IConfiguration?

The root configuration that contains the engine section.

sectionPath string

The engine root section path to read from.

SendGridInvitationDeliveryAspNetCoreOptions

The parsed SendGrid ASP.NET Core callback options.