DVPrivacy class

Erasure, export and retention over a set of declared models.

Constructors

DVPrivacy({required List<DVPrivacyModel> models, required DVDatabaseAdapter database, required List<int> signingKey, List<DVPrivacyAdapter> adapters = const <DVPrivacyAdapter>[], Duration deadline = const Duration(days: 30), DateTime now()?})

Properties

adapters → List<DVPrivacyAdapter>
final
database → DVDatabaseAdapter
final
deadline → Duration
How long an erasure has from its request, which is the regulation's clock rather than the framework's.
final
hashCode → int
The hash code for this object.
no setterinherited
jobResults → List<DVErasureResult>
Results of erasures run from the queue, most recent last.
final
models → List<DVPrivacyModel>
final
requests → DVRecordTable
Every export and erasure, through Record History, by pseudonym.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkErasureDeadlines({Duration staleAfter = const Duration(days: 1)}) → Future<DVErasureDeadlines>
Runs every open erasure requested more than staleAfter ago.
ensureSchema() → Future<void>
Creates the walk's own tables: the request log, the tombstone log and the open erasures. The generated server runs it at start.
erase({required Object subject, required String reason, DateTime? requestedAt, String? requestedBy, String? runBy}) → Future<DVErasureResult>
export({required Object subject, String? requestedBy, String? runBy}) → Future<DVExportArchive>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
planRetention({DateTime? now}) → Future<DVRetentionPlan>
What the next sweep would do, changing nothing.
pseudonym(Object subject) → String
The id every record the walk leaves behind uses instead of subject.
registerJobs(DVQueues queues) → void
Registers the erasure and retention handlers on the durable job layer, with the codecs a queue shared between processes stores them under.
replayErasures() → Future<DVErasureReplay>
Re-erases every row belonging to a subject in the tombstone log. Run it before a restored deployment serves anything: a backup cannot be edited, but no restored system has to serve what it holds.
requestErasure({required Object subject, required String reason, String? requestedBy, DVQueues queues = const DVQueues(), String queue = 'default'}) → Future<DVJobEnvelope<DVPrivacyErasureRequest>>
Queues an erasure; a worker runs it.
sweepRetention({DateTime? now, int batchSize = 500, int? maxBatches}) → Future<DVRetentionSweep>
Removes expired rows in batches of batchSize, stopping after maxBatches when given. Each batch stands on its own, so a sweep that stops part-way resumes where it left off rather than taking a database down in one transaction.
toString() → String
A string representation of this object.
inherited
verifyReceipt(DVErasureReceipt receipt) → bool

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

check(List<DVPrivacyModel> models) → List<DVPrivacyFinding>
The declarations, checked. DV-PRIVACY-001 for personal data no subject path reaches; DV-PRIVACY-002 for personal data with no retention.
registerJobsFor(DVQueues queues, DVPrivacy privacy()) → void
As registerJobs, running each job on the DVPrivacy privacy returns when it runs -- so a process whose configuration changes after start, an adapter installed late, runs its jobs on the current one.

Constants

openErasuresTable → const String
Erasures requested and not yet completed, one row per subject, keyed by pseudonym. It holds the subject's id because running the erasure needs it, which is what the queued job holds too; the row goes when an erasure of the subject completes.
tombstone → const String
The value an anonymized field holds.
tombstoneTable → const String