don't leak personal data into logs

pull/28/head
geeksville 2020-04-12 10:56:45 -07:00
rodzic 83c491078d
commit d1afb6fac6
3 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -10,9 +10,11 @@ import com.geeksville.mesh.ui.latLongToMeter
* When printing strings to logs sometimes we want to print useful debugging information about users
* or positions. But we don't want to leak things like usernames or locations. So this function
* if given a string, will return a string which is a maximum of three characters long, taken from the tail
* of the string. Which should effectively hide real usernames and locations, but still let us see if values were zero or empty.
* of the string. Which should effectively hide real usernames and locations,
* but still let us see if values were zero, empty or different.
*/
val Any.anonymized: String get() = this.toString().takeLast(3) + "..."
val Any?.anonymized: String
get() = if (this != null) ("..." + this.toString().takeLast(3)) else "null"
// model objects that directly map to the corresponding protobufs
data class MeshUser(val id: String, val longName: String, val shortName: String) :

Wyświetl plik

@ -708,7 +708,7 @@ class MeshService : Service(), Logging {
while (infoBytes != null) {
val info =
MeshProtos.NodeInfo.parseFrom(infoBytes)
debug("Received initial nodeinfo $info")
debug("Received initial nodeinfo num=${info.num}, hasUser=${info.hasUser()}, hasPosition=${info.hasPosition()}")
// Just replace/add any entry
updateNodeInfo(info.num) {

Wyświetl plik

@ -313,7 +313,7 @@ class RadioInterfaceService : Service(), Logging {
// FIXME - no need to discover services more than once - instead use lazy() to use them in future attempts
safe!!.asyncDiscoverServices { discRes ->
discRes.getOrThrow() // FIXME, instead just try to reconnect?
debug("Discovered services!")
debug("Discovered services! Service size=${service.characteristics.size}")
// we begin by setting our MTU size as high as it can go
safe!!.asyncRequestMtu(512) { mtuRes ->