summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-20 07:52:24 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-20 07:52:24 (GMT)
commitebe771fa2d32f433823a87f612c27dec137b0de4 (patch)
tree95c518c3798eadcded4cae580869468ad12824c2
parent8094abcc664a3e0c324fabab268cab3fc0b47624 (diff)
Improve generate json
-rw-r--r--webengineviewer/src/checkphishingurl/searchfullhashjob.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp b/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
index c5ef41f..a0be23f 100644
--- a/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
+++ b/webengineviewer/src/checkphishingurl/searchfullhashjob.cpp
@@ -98,6 +98,28 @@ void SearchFullHashJob::setUrl(const QUrl &url)
QByteArray SearchFullHashJob::jsonRequest() const
{
+ /*
+{
+ "client": {
+ "clientId": "yourcompanyname",
+ "clientVersion": "1.5.2"
+ },
+ "clientStates": [
+ "ChAIARABGAEiAzAwMSiAEDABEAE=",
+ "ChAIAhABGAEiAzAwMSiAEDABEOgH"
+ ],
+ "threatInfo": {
+ "threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
+ "platformTypes": ["WINDOWS"],
+ "threatEntryTypes": ["URL"],
+ "threatEntries": [
+ {"hash": "WwuJdQ=="},
+ {"hash": "771MOg=="},
+ {"hash": "5eOrwQ=="}
+ ]
+ }
+}
+ */
QVariantMap clientMap;
QVariantMap map;
@@ -105,6 +127,9 @@ QByteArray SearchFullHashJob::jsonRequest() const
clientMap.insert(QStringLiteral("clientVersion"), QStringLiteral("5.4.0")); //FIXME
map.insert(QStringLiteral("client"), clientMap);
+ //clientStates
+
+
QVariantMap threatMap;
const QVariantList platformList = { QStringLiteral("WINDOWS") };
threatMap.insert(QStringLiteral("platformTypes"), platformList);
@@ -114,9 +139,9 @@ QByteArray SearchFullHashJob::jsonRequest() const
const QVariantList threatEntryTypesList = { QStringLiteral("URL") };
threatMap.insert(QStringLiteral("threatEntryTypes"), threatEntryTypesList);
QVariantList threatEntriesList;
- QVariantMap urlMap;
- urlMap.insert(QStringLiteral("url"), mUrl.toString());
- threatEntriesList.append(urlMap);
+ QVariantMap hashUrlMap;
+ hashUrlMap.insert(QStringLiteral("hash"), mUrl.toString());
+ threatEntriesList.append(hashUrlMap);
threatMap.insert(QStringLiteral("threatEntries"), threatEntriesList);
map.insert(QStringLiteral("threatInfo"), threatMap);