-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
functon which can redact device log fields #92
functon which can redact device log fields #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! It is actually less important in the log (which should remain local as we no longer request people to use the CLI to create their requests), but it does need to be sanitized in the other
driver where the settings are generated:
com.tuya/drivers/other/driver.js
Line 18 in 5767e19
props.settings["deviceSpecification"] = JSON.stringify( |
Can you add it there as well, and lets add the following fields as well. For my part you can make this the default list for the function, so we do not need to pass the same list twice.
owner_id
uid
uuid
local_key
…added same redacted function for other driver.
added your requests. But i did not use it as default list but as these fields always need to be redacted i combine the list with the incoming array of second param of the redactFields function. that way you cannot override and miss the ip,lat,lon etc. fields |
Many thanks @eelco2k! I did find a small bug, but fixed that. Will be pushing a release with this soon. |
perfect! I did not test the code so good you found that bugger 👍 |
does the line : i'm not completely sure...? as the json has 2 keys, "device" and "specifications" ... |
No, that was actually the source of the bug. The JSON with two keys is not returned by Tuya, but constructed by us in the com.tuya/drivers/other/driver.js Line 14 in ca04e22
|
yes i understand, on the driver.js i understand, but i mean in the [lib/TuyaOAuth2Driver.js] file in the onPairListDevices() function. is it there also correct? if so. i have said nothing.. :) |
The |
No description provided.