Repository navigation
feat: categories of personal data, each with its own key, basis and retention - #263
Merged
Merged
Conversation
… value when they do not fit its metadata
… count leaves out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Categories of personal data, each with its own key, legal basis and retention (GDPR articles 6, 5(1)(e) and 17(3)). A person now holds one key per category instead of one key in all.
What changes
app/personal-data.tsexportscategories,satisfies PersonalData.Categories: each with itsbasis(the six of article 6) and itsretention. The generator reads it, writes its+types, registers the names (personalCategories) and checks the file (PersonalDataDeclaration).personal(schema, { category })and.personal({ category })put a field in one; a misspelled category does not compile, inpersonal,.personalorforget. The app refuses to start on the same. A field without a category is indefault, whose retention isruntime.personalData.retention: an app without the file behaves as before.forget(person)destroys every category exceptlegal-obligationones whose retention, counted from the person's real last activity, has not run out. Those are retained: no longer in force, still readable, and destroyed by the retention when their time ends (expired).forget(person, { categories })withdraws a consent; policies and processes take the same option. Snapshots, remembered rejections, scheduled commands and dead letters go when they name the person under a key no longer in force. Error text is sealed under every key the person holds, one inside the other.PersonalDataForgottengainswhole,categories,retainedandexpired.listDue), with its own holds; the app's retention still forgets the person as a whole.forget-ledgerscope; KV metadata). Newbounda forget <person> [--category …]andbounda export <person>;bounda forgottenlines carrycategories.storageon SQLite, the Durable Object and PostgreSQL, idempotent: existing keys go todefault, last active when their person was; earlierPersonalDataForgottenbecome whole forgettings ofdefault."18mo","6y", in categories and inruntime.personalData.retention(RetentionInput;ResolvedConfig...retentionMsbecomesretention). A period ends on the same day and time; a day the month lacks ends at the very end of the month's last day, so it is never cut short, and the sweep's cutoff is its exact inverse.listRetained,expired).expectForgotten(app, id, { categories }), and every key the person still holds (in force or retained) as theirs.PersonalKeyStoreis keyed by person and category, the stores'forgettake the fingerprints to keep,checkAppendtakeskeyOf,LoadResult.fingerprintsisopened,StoredPersongainsposition,ForgetLedgerEntrygainscategories. Changesetminor.Docs: personal data guide (Categories section, forgetting, export, retention, keys, ledger, tests), CLI, conventions, configuration and limitations. The "invoices six years, profile thirty days" limit is gone.
Checks
pnpm checkwith Docker green (3517 tests; timeouts under a load average of 140 rerun green alone), butastro check, which fails locally for an environment reason unrelated to this change./code-reviewhigh: 4 findings, 3 fixed (new keys start from the person's last activity; a forgetting withoutwholecounts as whole; error text read under a key kept since goes under a disposable key), 1 left (the memory key store scans every key, as the other memory stores do).Left out, as follow-up pieces
retained_since).