Add anonymization of GAIA IDs
These should be stripped from feedback reports. They can appear via 3
different logging techniques. They can be output after a Serialize call
in AccountId, assertion failure in construction of AccountId and also
via the ostream operator in AccountId. Callers could also get the GAIA
ID by itself and log that out, but I didn't find any occurences of that
in the source.
Bug: 575821
Test: Unit tests pass
Change-Id: Ib5241382c88d811471a26628a427b461d90c8d1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1658937
Auto-Submit: Jeffrey Kardatzke <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: Ahmed Fakhry <[email protected]>
Reviewed-by: Ryan Hansberry <[email protected]>
Commit-Queue: Ahmed Fakhry <[email protected]>
Cr-Commit-Position: refs/heads/master@{#669840}
diff --git a/components/feedback/anonymizer_tool_unittest.cc b/components/feedback/anonymizer_tool_unittest.cc
index c2f9a6e..4bb2faa 100644
--- a/components/feedback/anonymizer_tool_unittest.cc
+++ b/components/feedback/anonymizer_tool_unittest.cc
@@ -119,6 +119,12 @@
AnonymizeCustomPatterns("SerialNumber: EVT23-17BA01-004"));
EXPECT_EQ("serial=4", AnonymizeCustomPatterns("serial=\"1234AA5678\""));
+ EXPECT_EQ("\"gaia_id\":\"1\"",
+ AnonymizeCustomPatterns("\"gaia_id\":\"1234567890\""));
+ EXPECT_EQ("gaia_id='2'", AnonymizeCustomPatterns("gaia_id='987654321'"));
+ EXPECT_EQ("{id: 1, email:",
+ AnonymizeCustomPatterns("{id: 123454321, email:"));
+
EXPECT_EQ("<email: 1>",
AnonymizeCustomPatterns("[email protected]"));
EXPECT_EQ("Email: <email: 1>.",