Interface IErasureCompletionProcessor
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Drives erasure requests that are waiting on a key-management provider's key destruction to a terminal state, on demand.
public interface IErasureCompletionProcessor
Remarks
On key stores that cannot destroy key material immediately -- AWS KMS for a KMS-generated key, or Azure Key Vault when the vault's purge protection or the credential's permissions prevent an immediate purge -- an executed erasure enters AwaitingKeyDestruction. Nothing is left for the framework to do except find out, later, whether the provider has actually destroyed the key.
This processor is that step. Each call asks the key-management provider, through VerifyKeyDeletionAsync(string, CancellationToken), whether every key of every waiting request is gone. A request whose keys are all confirmed destroyed moves to Completed and receives its completion certificate. A request with any key still recoverable is left exactly as it was, to be asked about again on a later call. It never deletes, schedules, or re-executes anything: a key that is scheduled for destruction cannot be scheduled again, and the request's other erasure work was already done when it was executed.
The framework owns the logic; the host owns the trigger. The optional erasure scheduler background service calls this on every polling cycle. A host without a background service -- a serverless function, for example -- calls it from whatever trigger it has: a timer, a scheduled job, or an administrative endpoint. How often it is called only affects how soon a request reaches Completed after the provider destroys its key; calling it early is safe, because a key the provider still holds is never reported as destroyed.
Confirmation requires an IErasureVerificationService to be registered. Without one, waiting requests are reported in the log and left waiting; they are never completed unconfirmed.
Methods
CompletePendingErasuresAsync(CancellationToken)
Checks every erasure request awaiting key destruction and completes each one whose keys the provider confirms are destroyed.
Task<int> CompletePendingErasuresAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.