Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a new HTMLObfuscatorStrategy that intelligently obfuscates HTML content while preserving essential structure and specific protected elements. The strategy parses HTML, obfuscates text content and attribute values, but preserves text within elements having the "qbd-output" class and protects certain HTML attributes from obfuscation.
Key changes:
- Introduces
HTMLObfuscatorStrategywith HTML parsing capabilities and selective obfuscation - Adds base class architecture with
BaseObfuscatorStrategyfor inheritance consistency - Sets up Jest testing framework with comprehensive test coverage
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/classes/obfuscators/HTMLObfuscatorStrategy.js | Main implementation of HTML-aware obfuscation strategy |
| src/classes/obfuscators/BaseObfuscatorStrategy.js | Base class providing common interface for all obfuscator strategies |
| src/classes/obfuscators/ObfuscatorStrategyMap.js | Registers the new HTML obfuscator in the strategy map |
| src/classes/obfuscators/NoObfuscatorStrategy.js | Updates to extend from BaseObfuscatorStrategy |
| package.json | Adds node-html-parser dependency and Jest testing framework |
| tests/obfuscators/HTMLObfuscatorStrategy.test.js | Comprehensive test suite covering all obfuscation scenarios |
| .github/workflows/test.yml | CI workflow for automated testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lpires-ccs
left a comment
There was a problem hiding this comment.
Great to see unit tests and a ci workflow. Great job.
This obfuscator preserves HTML tags and attributes, preserves text in elements with class "qbd-output", and obfuscates all other text using DictionaryObfuscatorStrategy