Skip to content

IDataSubjectStore

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The data plane that counts, exports, and erases one data subject’s content across the schema.

public interface IDataSubjectStore

The default (in-memory) setup registers NullDataSubjectStore, which always returns an empty result: export and erasure are meaningful only when a SQL provider is enabled — the same precedent as IRetentionStore and its NullRetentionStore.

EraseAsync(string, DataSubjectScope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>, CancellationToken)

Section titled “ EraseAsync(string, DataSubjectScope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>, CancellationToken)”

Deletes a scope’s content.

ValueTask<IReadOnlyDictionary<string, int>> EraseAsync(string tenantId, DataSubjectScope scope, Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask> beforeCommitAsync, CancellationToken cancellationToken = default)

tenantId string

The tenant id.

scope DataSubjectScope

The subject’s scope.

beforeCommitAsync Func<IReadOnlyDictionary<string, int>, CancellationToken, ValueTask>

Runs after every delete has executed but BEFORE the change is committed. When it throws, every delete is rolled back and the exception propagates — That rule applied here: an erasure that cannot be written to the audit trail is not applied. The caller uses this to write the audit entry (which needs the row counts this method computes) while the erasure itself can still be undone if that write fails.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyDictionary<string, int>>

The row count actually deleted per target.

ExportAsync(string, DataSubjectScope, CancellationToken)

Section titled “ ExportAsync(string, DataSubjectScope, CancellationToken)”

Reads every column of a scope’s content, target by target, as one export document.

ValueTask<DataSubjectExport> ExportAsync(string tenantId, DataSubjectScope scope, CancellationToken cancellationToken = default)

tenantId string

The tenant id.

scope DataSubjectScope

The subject’s scope.

cancellationToken CancellationToken

The cancellation token.

ValueTask<DataSubjectExport>

The export document.

PreviewAsync(string, DataSubjectScope, CancellationToken)

Section titled “ PreviewAsync(string, DataSubjectScope, CancellationToken)”

Counts the rows that would be deleted for a scope, by target, without deleting anything.

ValueTask<IReadOnlyDictionary<string, int>> PreviewAsync(string tenantId, DataSubjectScope scope, CancellationToken cancellationToken = default)

tenantId string

The tenant id.

scope DataSubjectScope

The subject’s scope.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyDictionary<string, int>>

The row count per target; a target with nothing to delete is present with the value 0.