Repository navigation
2.1.0
Added secrets sanitation
If you pass secrets through parameters, you can sanitize them from the log like this:
twx -v=deployment.log call Things/MyDeploymentThing/InitializeDatabase \
-pusername="thingworx" \
-ppassword="$DB_PASSWORD" \
-secret="$DB_PASSWORD"This will replace $DB_PASSWORD in deployment.log with asterisks ********. Resulting log file:
Parameter 'username' = 'thingworx'
Parameter 'password' = '******* (redacted)'
Will call 'http://192.168.0.24:8080/Thingworx/Things/MyDeploymentThing/Services/InitializeDatabase'
It also works with substrings, thus it handles JSON parameters correctly. For example:
twx -v=deployment.log call Things/MyDeploymentThing/InitializeDatabase \
-pconfig="{\"username\": \"thingworx\", \"password\": \"$DB_PASSWORD\"}" \
-secret="$DB_PASSWORD"Resulting log file:
Parameter 'config' = '{"username": "thingworx", "password": "******* (redacted)"}'
Will call 'http://192.168.0.24:8080/Thingworx/Things/MyDeploymentThing/Services/InitializeDatabase'