test: add tests for DataRedactor service #7

Open
opened 2026-02-21 00:59:18 +00:00 by Clotho · 0 comments
Member

Summary

The DataRedactor service (src/Mcp/Services/DataRedactor.php) has no unit tests. This service handles sensitive data masking in audit logs and responses.

What needs testing

  • PII field detection and redaction
  • Recursive redaction of nested objects/arrays
  • Custom redaction pattern registration
  • Redaction of common sensitive field names (password, token, secret, api_key, etc.)
  • Partial redaction (e.g. show last 4 of card numbers)
  • Preservation of non-sensitive fields

Files

  • src/Mcp/Services/DataRedactor.php
  • src/Mcp/Tests/Unit/DataRedactorTest.php (to be created)
## Summary The `DataRedactor` service (src/Mcp/Services/DataRedactor.php) has no unit tests. This service handles sensitive data masking in audit logs and responses. ## What needs testing - PII field detection and redaction - Recursive redaction of nested objects/arrays - Custom redaction pattern registration - Redaction of common sensitive field names (password, token, secret, api_key, etc.) - Partial redaction (e.g. show last 4 of card numbers) - Preservation of non-sensitive fields ## Files - `src/Mcp/Services/DataRedactor.php` - `src/Mcp/Tests/Unit/DataRedactorTest.php` (to be created)
Clotho added the
review
discovery
testing
labels 2026-02-21 00:59:18 +00:00
Snider added the
clotho
label 2026-02-21 01:23:27 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:19 +00:00
Sign in to join this conversation.
No description provided.