#### [Abblix\.SecurityEvents](https://www.abblix.com/en/docs/api/abblix-securityevents 'index')
### [Abblix\.SecurityEvents\.Delivery](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Delivery 'Abblix\.SecurityEvents\.Delivery')

## ISecurityEventSink Interface

Where validated events land: the application's half of a receiver, called once per accepted
SET with the token already carrying its issuer's authority\.

```csharp
public interface ISecurityEventSink
```

### Remarks

Processing must be idempotent: RFC 8935 Section 2 lets a transmitter deliver the same SET
again regardless of earlier responses, and the replay cache in front of this sink is
probabilistic, so a repeat can reach it. It must also tolerate events about subjects the
receiver has removed from the stream - a transmitter may keep sending them, and treating
that as an error would let anyone able to remove a subject break the receiver
(SSF 1.0 Section 9.3).

The verdict is the sink's to give: null acknowledges the event, a
[DeliveryError](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Delivery.DeliveryError 'Abblix\.SecurityEvents\.Delivery\.DeliveryError') travels back in the 400 response - the one the framework itself
defines being [InvalidState](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Delivery.DeliveryErrorCodes#Abblix.SecurityEvents.Delivery.DeliveryErrorCodes.InvalidState 'Abblix\.SecurityEvents\.Delivery\.DeliveryErrorCodes\.InvalidState'), for a verification event whose
"state" does not match what this receiver sent (SSF 1.0 Section 8.1.4.1).
### Methods

## ISecurityEventSink\.ConsumeAsync\(ValidatedSecurityEventToken, CancellationToken\) Method {#Abblix.SecurityEvents.Delivery.ISecurityEventSink.ConsumeAsync(Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken,System.Threading.CancellationToken)}

Consumes one validated SET\.

```csharp
System.Threading.Tasks.Task<Abblix.SecurityEvents.Delivery.DeliveryError?> ConsumeAsync(Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken token, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `token` [ValidatedSecurityEventToken](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken 'Abblix\.SecurityEvents\.Validation\.ValidatedSecurityEventToken') {#Abblix.SecurityEvents.Delivery.ISecurityEventSink.ConsumeAsync(Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken,System.Threading.CancellationToken).token}

The validated token with its typed event payloads\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.SecurityEvents.Delivery.ISecurityEventSink.ConsumeAsync(Abblix.SecurityEvents.Validation.ValidatedSecurityEventToken,System.Threading.CancellationToken).cancellationToken}

Cancels the processing\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[DeliveryError](https://www.abblix.com/en/docs/api/abblix-securityevents/Abblix.SecurityEvents.Delivery.DeliveryError 'Abblix\.SecurityEvents\.Delivery\.DeliveryError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
Null to acknowledge the event, or the error the delivery response carries\.
