feat(export): per-column anonymization in the export dialog - #606
Closed
iamthenuggetman wants to merge 2 commits into
Closed
feat(export): per-column anonymization in the export dialog#606iamthenuggetman wants to merge 2 commits into
iamthenuggetman wants to merge 2 commits into
Conversation
added 2 commits
August 1, 2026 12:04
Adds an optional anonymization step to the file export, as a transform layer between the row stream and the CSV/JSON/Markdown sinks — so it works for every driver (built-in and plugin) with no driver changes. Export menu → "Anonymized export…" opens a dialog where each column can be assigned a rule: - NULL / fixed value — replace with a real NULL or a literal (***) - Partial mask — keep first/last N chars; emails keep their shape (john@example.com → j***@***.com) - HMAC pseudonym — deterministic per export key, so joins on pseudonymized columns still work across tables exported with the same key; the key is shown and can be reused or regenerated NULLs always pass through untouched. Presented as anonymization/ pseudonymization, not as a GDPR-compliance guarantee. Closes TabularisDB#483
| <input | ||
| type="number" | ||
| min={0} | ||
| max={9} |
Contributor
There was a problem hiding this comment.
WARNING: max={9} on the number input is not enforced by the onChange handler. A user can type "99" and it will be accepted, bypassing the UI constraint. Add a cap in the onChange handler (e.g. Math.min(9, Math.max(0, parseInt(e.target.value) || 0))) to match the declared maximum.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (17 files)
Fix these issues in Kilo Cloud Reviewed by ling-3.0-flash-free · Input: 180.8K · Output: 32.4K · Cached: 1.4M |
Contributor
Author
|
Closing for now — holding this one back for a later round. Branch stays intact; will reopen when ready. |
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.
Closes #483
What
Adds the optional anonymization step to the file export proposed in the issue, as a transform layer between the row stream and the CSV/JSON/Markdown sinks — so it works for every driver (built-in and plugin) with no driver changes.
Export menu → Anonymized export… opens a dialog where each column of the result set can be assigned a rule:
NULLor a literal (***)john@example.com→j***@***.comuser_id) still work across tables exported with the same key. The key is shown in the dialog — reuse it across exports for stable pseudonyms, or regenerate it for a fresh set.NULLvalues always pass through untouched — anonymizing them would invent data the source never had.Per the issue's wording note, the feature is presented as column anonymization / pseudonymization, with an explicit hint in the dialog that it is not a "GDPR compliance" guarantee.
Implementation
src-tauri/src/export/anonymize/— rule types,RowAnonymizer(transform applied to streamed rows before the sinks), unit testsexport.rs—export_query_to_fileaccepts an optionalanonymizespec;stream_to_sinkapplies it.hmacadded as a direct dep (already in the tree transitively)ExportAnonymizeModal.tsx— the rule-assignment dialog (follows the modal styling rules; Escape handling, per-export key field with regenerate)Editor.tsx— new "Anonymized export…" item in the export dropdown; the spec flows throughhandleExportCommonTests
tsc -b/ eslint / clippy cleanuser_id; re-export with the same key produces identical pseudonyms, regenerating the key produces fresh onesOut of scope (possible follow-ups from the issue)
Synthetic data (seeded faker), generalization (birth date → year, zip → region), and name-based heuristics to pre-suggest rules — the rule engine and dialog are structured so these slot in as additional rule types later.