From 4fced60a834f31cf042aae246bb403d13927c583 Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Wed, 6 May 2026 19:12:50 +0000 Subject: [PATCH] feat: align save-time redaction with codex v0.3.0 ProjectZomboidRedactor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the codex constraint from ^0.2.0 to ^0.3.0 to pull the PZ-B42 parser fix and the IP-redaction passes added in the codex v0.3.0 release. Wires codex's ProjectZomboidRedactor into the save-time Filter chain via a thin ProjectZomboidRedactorFilter wrapper, and removes the now-redundant IPv4Filter / IPv6Filter chain entries: - Codex's IPv4 / IPv6 redaction is generic-applicable (not PZ-only) and superior to the prior in-tree filters because it consumes the port suffix together with the address; previously only the IP was scrubbed, leaving e.g. ":27015" visible. - Codex additionally redacts PZ-specific PII the prior filters never touched (Steam IDs, player names, world coordinates). - The IPv4Filter and IPv6Filter source files are retained on disk for easy restore from history if a future paste type proves unsuitable for codex-driven IP scrubbing. UsernameFilter (OS-path username scrubbing — different concern from PZ player names) and AccessTokenFilter remain untouched. Co-Authored-By: Claude Opus 4.7 (1M context) --- composer.json | 2 +- composer.lock | 8 ++-- src/Filter/Filter.php | 3 +- src/Filter/ProjectZomboidRedactorFilter.php | 45 +++++++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 src/Filter/ProjectZomboidRedactorFilter.php diff --git a/composer.json b/composer.json index 401b9f8..39aef2e 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "ext-mongodb": "*", "ext-uri": "*", "ext-zlib": "*", - "indifferentketchup/codex": "^0.2.0", + "indifferentketchup/codex": "^0.3.0", "mongodb/mongodb": "2.1.2" }, "autoload": { diff --git a/composer.lock b/composer.lock index 512514f..75d709f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,15 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "821a03243eb4b751e38ca3f8f063dd3e", + "content-hash": "c970170e823f1c31130ee1eec742a090", "packages": [ { "name": "indifferentketchup/codex", - "version": "v0.2.0", + "version": "v0.3.0", "source": { "type": "git", "url": "https://git.indifferentketchup.com/indifferentketchup/ik-codex", - "reference": "2bd4fe6189c21be5b1fb03e8ac23b1a3c01d747c" + "reference": "656142dbf8979da7d5f06908e5dd53afa1b5e56d" }, "require": { "php": ">=8.4" @@ -47,7 +47,7 @@ } ], "description": "Generic PHP log parsing and analysis framework.", - "time": "2026-05-01T22:08:43+00:00" + "time": "2026-05-06T19:04:37+00:00" }, { "name": "mongodb/mongodb", diff --git a/src/Filter/Filter.php b/src/Filter/Filter.php index c1d7279..66a476b 100644 --- a/src/Filter/Filter.php +++ b/src/Filter/Filter.php @@ -23,8 +23,7 @@ abstract class Filter implements \JsonSerializable new TrimFilter(), new LimitBytesFilter(), new LimitLinesFilter(), - new IPv4Filter(), - new IPv6Filter(), + new ProjectZomboidRedactorFilter(), new UsernameFilter(), new AccessTokenFilter(), ]; diff --git a/src/Filter/ProjectZomboidRedactorFilter.php b/src/Filter/ProjectZomboidRedactorFilter.php new file mode 100644 index 0000000..a60fea2 --- /dev/null +++ b/src/Filter/ProjectZomboidRedactorFilter.php @@ -0,0 +1,45 @@ +redact($data); + } +}