Repository navigation
fix: anonymize entities nested in submission.entities[] - #3
Merged
Merged
Conversation
Nested entities carry _schema but no _id/_org, so the response walker skipped them and only the email/IBAN/phone pattern scrub ran: names, address, birthdate, salutation and payment holder leaked. Anonymize them schema-aware inside the parent submission (single pass, pseudonyms match standalone entities), add name-based defaults for address/payment and person-name keys on payment items. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfZ2jL2NvqeyYkcaYJApir
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.
Summary
contact,opportunity, …) inentities[]. They have_schemabut no_id/_org, soisEntityLikeskipped them and only the email/IBAN/phone pattern scrub ran. Names, address, birthdate, salutation, payment holder and opportunity description leaked in plaintext.anonymizeEntitynow anonymizessubmission.entities[]items schema-aware (new optionalnestedSchemaresolver, wired inanonymizeResponse). Single pass: pseudonyms equal those of a standalone contact (joinable, no double hashing); the walker no longer re-walksentities.DEFAULT_PII_FIELDS:*:address,*:payment,submission:contact_first_name/contact_last_name.fullname/first_name/last_namekeys are pseudonymized asperson(bank_namestays).Not covered
meter_number) stay as is; classify viadata_classification: 'pii'oroverrides.8f4a9a6b-47fa-45e5-aeb7-a43443b00c39, org 20000346).Test plan
vitest run(31 tests, incl. no-schema / with-schema / directanonymizeEntity/ joinability),tsc --noEmit🤖 Generated with Claude Code
https://claude.ai/code/session_01QfZ2jL2NvqeyYkcaYJApir
Generated by Claude Code