Mask protected fields by default and add --print-protected-fields flag#75
Mask protected fields by default and add --print-protected-fields flag#75aivanovski wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e12d96bc3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| isColorEnabled = !parsedArgs.isNoColoredOutput, | ||
| isVerboseOutput = parsedArgs.isVerboseOutput | ||
| isVerboseOutput = parsedArgs.isVerboseOutput, | ||
| isPrintProtectedFields = parsedArgs.isPrintProtectedFields |
There was a problem hiding this comment.
Honor protected-field flag for file output
When --output-file is set, execution takes the writeDiffUseCase.writeDiff branch above and skips this options block, so parsedArgs.isPrintProtectedFields is never forwarded to WriteDiffToFileUseCase (which creates DiffFormatterOptions with the default false). As a result, kp-diff --output-file out --print-protected-fields ... still writes masked passwords even though the new flag requests unmasked protected values.
Useful? React with 👍 / 👎.
Motivation
Description
"***"inDiffFormatterImplvia a newmaskProtectedFieldshelper.--print-protected-fieldsand--print-passwordsinOptionalArgumentand wire them throughArgumentParserinto the parsedArgumentsandMutableArguments.DiffFormatterOptionsandMainInteractorso stdout formatting respects the opt-in.PrintHelpUseCaseand adjust unit tests (DiffFormatterImplTest,ArgumentParserTest,MainInteractorTest,GetKeysUseCaseTest, and related helpers) to cover default masking and explicit opt-in behavior.Testing
git diff --checkwhich produced no warnings../gradlew test --stacktracefailed under the environment default Java (25.0.2) due to Kotlin Gradle tooling incompatibility, andJAVA_HOME=/root/.local/share/mise/installs/java/17.0.2 ./gradlew test --offlinefailed due to plugin resolution not available in the offline/local cache; no project unit tests were able to complete in this environment.isPrintProtectedFieldsis enabled; these tests were modified but could not be executed fully here due to the Gradle/tooling issues described above.Codex Task