Skip to content

feat(integriq): build call-log-personal-data-masking - #3550

Merged
rubenvdlinde merged 8 commits into
developmentfrom
quality/build-call-log-personal-data-masking
Nov 17, 2026
Merged

rubenvdlinde merged 8 commits into
developmentfrom
quality/build-call-log-personal-data-masking

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Builds openspec/changes/call-log-personal-data-masking (matrix row integriq:obs-redact, REQ-PDM-001): personal data in a logged message body is masked before the log is written.

Tasks done

  • Task 1 — implement:
    • lib/Service/Security/PersonalDataMasker.php (new) walks arrays by key, JSON bodies (layout kept when nothing matches, {} stays {}), XML text elements (StUF; namespaces, attributes and other elements untouched) and URL query strings. A field name matches exactly after normalisation (lower case, namespace prefix and punctuation dropped), so inp.bsn, BG:inp.bsn and inpBsn are one name and zaaktypeNaam is not a name.
    • SensitiveFieldRegistry holds the default list (BSN, name, address, date of birth, e-mail address, telephone number, in StUF / Haal Centraal / common English spellings) plus the names an administrator adds in the app setting personal_data_fields.
    • Wired in the same pass as secret masking: CallService call log and trace snapshot, BodyRedactor (so CallRecorder and MessageRecorder records), the response of a later attempt.
    • Admin: GET/PUT /api/admin/personal-data-fields (#[AuthorizedAdminSetting]), a "Personal data in logs" section on the admin settings page, en + nl strings, documented in openapi.json.
  • Task 1 — test: see below.

Behaviour to review

  • Only the stored copy is masked. The message that is sent is untouched (tested by capturing what the HTTP client got).
  • replayRequest keeps the real values. A failed call keeps the request it sent as replayRequest, and a replay sends it again, so masking it would send [afgeschermd] to the partner. It is masked nowhere and stays hidden from listings, as it is today (CallLogController unsets it). The request and response an administrator reads are masked. To do this, CallService and CallRecorder now mask after the body capture policy runs. BodyRedactor gained a personalData: false mode for that copy.
  • BodyRedactor now masks personal data before its secret text patterns run, because a secret pattern can cut through JSON syntax and leave a body that can no longer be parsed.
  • Three existing tests asserted that the raw BSN is stored in a captured call log / trace (CallServiceBodyCaptureTest ×2, CallServiceWithheldBodiesTest control). The spec now asks for exactly the opposite, so they now assert that the body is captured with [afgeschermd] in place of the BSN. The replay test is unchanged and still passes: replayRequest keeps the real BSN.

Tests added

  • PersonalDataMaskerTest (12): normalisation, exact matching, JSON at depth, XML/StUF, URL queries, arrays.
  • SensitiveFieldRegistryTest (+5): the default list covers the required kinds, JSON and XML masking, an added field (kenteken) is masked, a malformed setting adds nothing.
  • CallServicePersonalDataMaskingTest (5): the StUF scenario (inp.bsn + geslachtsnaam masked in the stored request, the partner received both), a JSON response and query, an added field, replay kept, the trace snapshot.
  • CallRecorderPersonalDataTest (4) and PersonalDataSettingsControllerTest (8, including admin-only attributes and refusals).

Tasks left

None in code. Other locales do not have the four new admin strings yet (test:l10n:parity was already red before this change).

Suite

PHPUnit unit: before 8222 tests, 2 errors + 2 failures (CallServiceTest ×2, JobsControllerTest::testUnknownJobIsNotFound ×2). After 8256 tests, the same 2 errors + 2 failures. SynchronizationSynchronizeEntryGoldenTest fails now and then on plain development as well (it timed out once in three runs there), so it is inherited. phpcs and phpstan are clean on the changed lib files; eslint is clean on the changed Vue; test:l10n passes and check:l10n-js is up to date.


Generated by Claude Code

Personal data in logged bodies is masked before the write, in the same
pass as the secret masking: BSN, name, address, date of birth, e-mail
address and telephone number fields read [afgeschermd] in JSON and XML
(StUF) bodies, headers, request options and URL queries of the call
log, trace snapshots, outbound call records and message records.

- PersonalDataMasker: walks arrays, JSON, XML text elements and query
  strings; names match exactly after normalisation (inp.bsn, BG:inp.bsn)
- SensitiveFieldRegistry: the default list plus the names an
  administrator adds (app setting personal_data_fields)
- Admin endpoint and settings section to add field names
- The message that is sent is untouched; a failed call's replayRequest
  keeps the real values because a replay sends it

Assisted-by: ClaudeCode:claude-opus-5-5
claude and others added 7 commits November 17, 2026 01:26
…skip ci]

AdminSettings.vue: both settings sections kept. l10n: both sides' strings.
The masking tests now mock ObjectService with main's option objects, as
development's CallRecorder calls it.

Assisted-by: ClaudeCode:claude-opus-5-5
…skip ci]

Without replayRequest the stored request is what a replay sends; once its
personal data is masked, a replay would send the placeholder. Such a record
is now refused like one whose bodies were stripped.

Assisted-by: ClaudeCode:claude-opus-5-5
…skip ci]

Keeps both admin settings sections (IdP registrations and personal data
fields) and both sides' l10n strings.

Assisted-by: ClaudeCode:claude-opus-5-5
…s [skip ci]

The personal data list, its app config key and the masker over it move
from SensitiveFieldRegistry into PersonalDataFieldList. BodyRedactor and
the personal data settings controller use the new class directly, so the
registry keeps its fan-in and its size, and the module coupling rating
holds at 5.04 against development. Behaviour is unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5
…try [skip ci]

The outbound log and the settings page referenced PersonalDataMasker and
PersonalDataFieldList directly from other components, which exposed both
classes and lowered component independence below development's. They now
use PersonalDataFields, a small entry in the service layer that keeps the
masker and the list internal; behaviour is unchanged. PHP component
independence measures 93.00% again (development 92.98%).

Assisted-by: ClaudeCode:claude-opus-5-5
…skip ci]

Keep both sides: the BSN text pattern from development next to the
personal data field list constructor, both admin settings sections and
both sets of l10n keys.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit f79927c into development Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants