WebhookSubscription
AgentPrism.Abstractions.dllAn external system’s event subscription.
public sealed record WebhookSubscription : IEquatable<WebhookSubscription>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”IEquatable<WebhookSubscription>
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”This record has no secret field. The signing secret
does not sit in the database; only the name of the configuration key the
value is read from (WebhookSubscription.SecretConfigurationKey) sits here, and
the value is resolved at run time through IConfiguration.
Constructors
Section titled “Constructors”WebhookSubscription()
Section titled “ WebhookSubscription()”public WebhookSubscription()Properties
Section titled “Properties”ConsecutiveFailures
Section titled “ ConsecutiveFailures”The consecutive-failure count. Once the threshold is exceeded, the subscription disables itself and is written to the audit trail.
public int ConsecutiveFailures { get; init; }Property Value
Section titled “Property Value”CreatedAt
Section titled “ CreatedAt”The creation time (UTC).
public required DateTimeOffset CreatedAt { get; init; }Property Value
Section titled “Property Value”Enabled
Section titled “ Enabled”Whether the subscription is enabled.
public bool Enabled { get; init; }Property Value
Section titled “Property Value”Events
Section titled “ Events”The subscribed event names. See WebhookEvents.
public required IReadOnlyList<string> Events { get; init; }Property Value
Section titled “Property Value”Headers
Section titled “ Headers”Extra headers added to every request.
public IReadOnlyDictionary<string, string> Headers { get; init; }Property Value
Section titled “Property Value”IReadOnlyDictionary<string, string>
Remarks
Section titled “Remarks”An authentication header is not written here: the value would be stored in the database. Use WebhookSubscription.SecretConfigurationKey for signing instead.
The subscription identifier.
public required Guid Id { get; init; }Property Value
Section titled “Property Value”The name, unique within the tenant.
public required string Name { get; init; }Property Value
Section titled “Property Value”SecretConfigurationKey
Section titled “ SecretConfigurationKey”The name of the configuration key the signing secret is read from. Not the secret itself.
public string? SecretConfigurationKey { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Example: "AgentPrism:WebhookSecrets:order-service". The value
lives in dotnet user-secrets or an environment variable. If
empty, requests are not signed.
TenantId
Section titled “ TenantId”The tenant the subscription belongs to.
public required string TenantId { get; init; }Property Value
Section titled “Property Value”UpdatedAt
Section titled “ UpdatedAt”The last-updated time (UTC).
public required DateTimeOffset UpdatedAt { get; init; }Property Value
Section titled “Property Value”The address events are sent to.
public required string Url { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The address goes through an SSRF check: only https (or
http for loopback), private network ranges are rejected,
redirects are not followed.
Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(WebhookSubscription?)
Section titled “ Equals(WebhookSubscription?)”public bool Equals(WebhookSubscription? other)Parameters
Section titled “Parameters”other WebhookSubscription?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(WebhookSubscription?, WebhookSubscription?)
Section titled “ operator ==(WebhookSubscription?, WebhookSubscription?)”public static bool operator ==(WebhookSubscription? left, WebhookSubscription? right)Parameters
Section titled “Parameters”left WebhookSubscription?
right WebhookSubscription?
Returns
Section titled “Returns”operator !=(WebhookSubscription?, WebhookSubscription?)
Section titled “ operator !=(WebhookSubscription?, WebhookSubscription?)”public static bool operator !=(WebhookSubscription? left, WebhookSubscription? right)Parameters
Section titled “Parameters”left WebhookSubscription?
right WebhookSubscription?