Repository navigation
Add log masking feature and general updates - #3
Open
MichaelBengtsson wants to merge 11 commits into
Open
MichaelBengtsson wants to merge 11 commits into
MichaelBengtsson wants to merge 11 commits into
Conversation
Version 1.0.0
Matched rows are masked before output with FieldMasker and KeyMasker from krokedil/wp-api, plus decoding of JSON logged as strings and masking of plain text. Adds a --no-mask CLI option and PHPUnit tests over real plugin log fixtures.
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.
This pull request introduces significant enhancements to the log parsing tool, focusing on robust masking of sensitive data, extensibility via interfaces, improved CLI options, and testability. It adds a masking system based on the
krokedil/wp-apipackage, new CLI options (notably--no-mask), and a suite of interfaces and classes to support modular log parsing, masking, and output. The project now also includes PHPUnit tests and improved documentation.Key changes:
Masking and Security
Added masking of matched log rows before output, using
FieldMaskerandKeyMaskerfromkrokedil/wp-api, and introducedWcLogLineMasker,NullLineMasker, andMaskingProfilefor flexible masking strategies. This ensures logs can be safely shared without exposing personal data. (readme.md,changelog.md,composer.json, [1] [2] [3]Introduced the optional
--no-maskCLI flag to allow output of unmasked logs for local use only, and updated documentation accordingly. (index.php,readme.md, [1] [2]Extensibility and Refactoring
Added new interfaces:
LineMaskerInterface,LogDataProviderInterface,LogResultHandlerInterface, andOutputLoggerInterfaceto decouple log parsing, masking, and output handling, enabling easier extension and testing. [1] [2] [3] [4]Implemented
FileSystemLogDataProviderandStringLogDataProviderto allow logs to be sourced from files or strings, supporting both CLI and programmatic usage. [1] [2]Testing and Tooling
composer.json, and aphpunit.xmlconfiguration file. Test fixtures and instructions are provided in the documentation. (composer.json,phpunit.xml,readme.md, [1] [2] [3]CLI and Documentation
LogParsernow returns all lines if no search terms are provided, and the CLI interface and documentation were updated to reflect new options and masking behavior. (index.php,readme.md, [1] [2] [3]Project Configuration
.gitattributesfile to enforce LF line endings for code and configuration files and to exclude development tooling from export.