Allow for redacting/hiding sensitive test in inputText
command
#1944
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.
Proposed changes
redact
boolean field to theinputText
commandtrue
, replace the value oftext
to"[REDACTED]"
in the following locations:--format=NOOP
maestro.log
commands-(<flow>).json
I chose to use
redact
instead ofmask
and[REDACTED]
instead ofXXXX
as it seemed clearer but feel free to ask if you want it changed back.Testing
I added 3 test cases:
InputTextCommand
(No deserialization though)redact
fieldI ran the following commands:
./gradlew :maestro-test:test
./gradlew :maestro-cli:test
./gradlew :maestro-client:test
./gradlew :maestro-orchestra:test
./gradlew :maestro-orchestra-models:test
Manual tests
The tests below have been done manually. I tried seeing how to automate them, but ideally, this needs to be able to intercept the
LOGGER
calls inIntegrationTest.kt
. Please advise if you want me to add tests for the cases below.012_input_text.yaml
./gradlew maestro-cli:installDist
./maestro-cli/build/install/maestro/bin/maestro test maestro-test/src/test/resources/012_input_text.yaml
~/.maestro/tests/<timestamp>/maestro.log
~/.maestro/tests/<timestamp>/commands-(012_input_text.yaml).json
012_input_text.yaml
012_input_text.yaml
on an Android devicemaestro.log
andcommands-(012_input_text.yaml).json
)Here are sample files with the results:
commands-(012_input_text.yaml).json
maestro.log
output.txt
With "💸" replacing "secret password" on Android :
commands-(012_input_text.yaml).json
maestro.log
output.txt
Issues fixed
Fixes #1226