Use the registrar client ID and abuse email address in Spec11

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244899045
This commit is contained in:
gbrodman 2019-04-23 12:04:40 -07:00 committed by jianglai
parent 9f979790e4
commit 2b12ca42f5
9 changed files with 87 additions and 27 deletions

View file

@ -98,12 +98,12 @@ public class Spec11RegistrarThreatMatchesParser {
private RegistrarThreatMatches parseRegistrarThreatMatch(String line) throws JSONException {
JSONObject reportJSON = new JSONObject(line);
String registrarEmail = reportJSON.getString(Spec11Pipeline.REGISTRAR_EMAIL_FIELD);
String clientId = reportJSON.getString(Spec11Pipeline.REGISTRAR_CLIENT_ID_FIELD);
JSONArray threatMatchesArray = reportJSON.getJSONArray(Spec11Pipeline.THREAT_MATCHES_FIELD);
ImmutableList.Builder<ThreatMatch> threatMatches = ImmutableList.builder();
for (int i = 0; i < threatMatchesArray.length(); i++) {
threatMatches.add(ThreatMatch.fromJSON(threatMatchesArray.getJSONObject(i)));
}
return RegistrarThreatMatches.create(registrarEmail, threatMatches.build());
return RegistrarThreatMatches.create(clientId, threatMatches.build());
}
}