Tue, 10 Apr 2018 19:40:37 +0200
Web Browser NG, Safe Browsing: identified places needing a change to support the Lookup API (v4)
--- a/WebBrowser/SafeBrowsing/SafeBrowsingAPIClient.py Tue Apr 10 19:39:13 2018 +0200 +++ b/WebBrowser/SafeBrowsing/SafeBrowsingAPIClient.py Tue Apr 10 19:40:37 2018 +0200 @@ -88,6 +88,10 @@ reply.deleteLater() return res + ####################################################################### + ## Methods below implement the 'Update API (v4)' + ####################################################################### + def getThreatsUpdate(self, clientStates): """ Public method to fetch hash prefix updates for the given threat list. @@ -254,6 +258,16 @@ """ return self.__nextRequestNoSoonerThan + ####################################################################### + ## Methods below implement the 'Lookup API (v4)' + ####################################################################### + + # TODO: implement the Lookup API (including temporary caching) + + ####################################################################### + ## Methods below implement global (class wide) functionality + ####################################################################### + @classmethod def getThreatMessage(cls, threatType): """
--- a/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py Tue Apr 10 19:39:13 2018 +0200 +++ b/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py Tue Apr 10 19:40:37 2018 +0200 @@ -66,8 +66,11 @@ self.gsbGroupBox.setChecked(self.__enabled) self.gsbApiKeyEdit.setText(self.__apiKey) self.gsbFilterPlatformCheckBox.setChecked(self.__filterPlatform) + # TODO: add text to label to indicate Update API only self.gsbAutoUpdateCheckBox.setChecked(self.__automaticUpdate) + # TODO: add checkbox to enable the Lookup API + # TODO: enable the cache buttons group box only on Update API self.__updateCacheButtons() super(SafeBrowsingDialog, self).show()
--- a/WebBrowser/SafeBrowsing/SafeBrowsingManager.py Tue Apr 10 19:39:13 2018 +0200 +++ b/WebBrowser/SafeBrowsing/SafeBrowsingManager.py Tue Apr 10 19:40:37 2018 +0200 @@ -373,6 +373,7 @@ @exception ValueError raised for an invalid URL """ if self.isEnabled(): + # TODO: add branch for the lookup API if isinstance(url, QUrl): urlStr = url.toString().strip() else: