src/eric7/Documentation/Source/eric7.WebBrowser.SafeBrowsing.SafeBrowsingManager.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 10479
856476537696
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.WebBrowser.SafeBrowsing.SafeBrowsingManager</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.WebBrowser.SafeBrowsing.SafeBrowsingManager</h1>
10
11 <p>
12 Module implementing the interface for Google Safe Browsing.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#SafeBrowsingManager">SafeBrowsingManager</a></td>
25 <td>Class implementing the interface for Google Safe Browsing.</td>
26 </tr>
27 </table>
28 <h3>Functions</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <hr />
34 <hr />
35 <a NAME="SafeBrowsingManager" ID="SafeBrowsingManager"></a>
36 <h2>SafeBrowsingManager</h2>
37
38 <p>
39 Class implementing the interface for Google Safe Browsing.
40 </p>
41 <h3>Signals</h3>
42 <dl>
43
44 <dt>progress(current)</dt>
45 <dd>
46 emitted to signal the current progress
47 </dd>
48 <dt>progressMessage(message,maximum)</dt>
49 <dd>
50 emitted to give a message for the
51 action about to be performed and the maximum value
52 </dd>
53 </dl>
54 <h3>Derived from</h3>
55 QObject
56 <h3>Class Attributes</h3>
57
58 <table>
59 <tr><td>enabled</td></tr>
60 </table>
61 <h3>Class Methods</h3>
62
63 <table>
64
65 <tr>
66 <td><a href="#SafeBrowsingManager.getIgnoreSchemes">getIgnoreSchemes</a></td>
67 <td>Class method to get the schemes not to be checked.</td>
68 </tr>
69 <tr>
70 <td><a href="#SafeBrowsingManager.isEnabled">isEnabled</a></td>
71 <td>Class method to check, if safe browsing is enabled.</td>
72 </tr>
73 </table>
74 <h3>Methods</h3>
75
76 <table>
77
78 <tr>
79 <td><a href="#SafeBrowsingManager.__init__">SafeBrowsingManager</a></td>
80 <td>Constructor</td>
81 </tr>
82 <tr>
83 <td><a href="#SafeBrowsingManager.__lookupHashes">__lookupHashes</a></td>
84 <td>Private method to lookup the given hashes.</td>
85 </tr>
86 <tr>
87 <td><a href="#SafeBrowsingManager.__setAutoUpdateThreatLists">__setAutoUpdateThreatLists</a></td>
88 <td>Private method to set auto update for the threat lists.</td>
89 </tr>
90 <tr>
91 <td><a href="#SafeBrowsingManager.__setLookupMethod">__setLookupMethod</a></td>
92 <td>Private method to set the lookup method (Update API or Lookup API).</td>
93 </tr>
94 <tr>
95 <td><a href="#SafeBrowsingManager.__setPlatforms">__setPlatforms</a></td>
96 <td>Private method to set the platforms to be checked against.</td>
97 </tr>
98 <tr>
99 <td><a href="#SafeBrowsingManager.__showNotificationMessage">__showNotificationMessage</a></td>
100 <td>Private method to show some message in a notification widget.</td>
101 </tr>
102 <tr>
103 <td><a href="#SafeBrowsingManager.__syncFullHashes">__syncFullHashes</a></td>
104 <td>Private method to download full hashes matching given prefixes.</td>
105 </tr>
106 <tr>
107 <td><a href="#SafeBrowsingManager.__threatListsUpdateTimerTimeout">__threatListsUpdateTimerTimeout</a></td>
108 <td>Private slot to perform the auto update of the threat lists.</td>
109 </tr>
110 <tr>
111 <td><a href="#SafeBrowsingManager.__verifyThreatListChecksum">__verifyThreatListChecksum</a></td>
112 <td>Private method to verify the local checksum of a threat list with the checksum of the safe browsing server.</td>
113 </tr>
114 <tr>
115 <td><a href="#SafeBrowsingManager.close">close</a></td>
116 <td>Public method to close the safe browsing interface.</td>
117 </tr>
118 <tr>
119 <td><a href="#SafeBrowsingManager.configurationChanged">configurationChanged</a></td>
120 <td>Public method to handle changes of the settings.</td>
121 </tr>
122 <tr>
123 <td><a href="#SafeBrowsingManager.fairUseDelayExpired">fairUseDelayExpired</a></td>
124 <td>Public method to check, if the fair use wait period has expired.</td>
125 </tr>
126 <tr>
127 <td><a href="#SafeBrowsingManager.fullCacheCleanup">fullCacheCleanup</a></td>
128 <td>Public method to clean up the cache completely.</td>
129 </tr>
130 <tr>
131 <td><a href="#SafeBrowsingManager.getPlatformString">getPlatformString</a></td>
132 <td>Public method to get the platform string for a given platform type.</td>
133 </tr>
134 <tr>
135 <td><a href="#SafeBrowsingManager.getThreatEntryString">getThreatEntryString</a></td>
136 <td>Public method to get the threat entry string.</td>
137 </tr>
138 <tr>
139 <td><a href="#SafeBrowsingManager.getThreatMessage">getThreatMessage</a></td>
140 <td>Public method to get a warning message for the given threat type.</td>
141 </tr>
142 <tr>
143 <td><a href="#SafeBrowsingManager.getThreatMessages">getThreatMessages</a></td>
144 <td>Public method to get threat messages for the given threats.</td>
145 </tr>
146 <tr>
147 <td><a href="#SafeBrowsingManager.getThreatType">getThreatType</a></td>
148 <td>Public method to get a display string for a given threat type.</td>
149 </tr>
150 <tr>
151 <td><a href="#SafeBrowsingManager.isUpdatingThreatLists">isUpdatingThreatLists</a></td>
152 <td>Public method to check, if we are in the process of updating the threat lists.</td>
153 </tr>
154 <tr>
155 <td><a href="#SafeBrowsingManager.lookupUrl">lookupUrl</a></td>
156 <td>Public method to lookup an URL.</td>
157 </tr>
158 <tr>
159 <td><a href="#SafeBrowsingManager.showSafeBrowsingDialog">showSafeBrowsingDialog</a></td>
160 <td>Public slot to show the safe browsing management dialog.</td>
161 </tr>
162 <tr>
163 <td><a href="#SafeBrowsingManager.updateHashPrefixCache">updateHashPrefixCache</a></td>
164 <td>Public method to load or update the locally cached threat lists.</td>
165 </tr>
166 </table>
167 <h3>Static Methods</h3>
168
169 <table>
170 <tr><td>None</td></tr>
171 </table>
172
173 <a NAME="SafeBrowsingManager.getIgnoreSchemes" ID="SafeBrowsingManager.getIgnoreSchemes"></a>
174 <h4>SafeBrowsingManager.getIgnoreSchemes (class method)</h4>
175 <b>getIgnoreSchemes</b>(<i></i>)
176
177 <p>
178 Class method to get the schemes not to be checked.
179 </p>
180 <dl>
181 <dt>Return:</dt>
182 <dd>
183 list of schemes to be ignored
184 </dd>
185 </dl>
186 <dl>
187 <dt>Return Type:</dt>
188 <dd>
189 list of str
190 </dd>
191 </dl>
192 <a NAME="SafeBrowsingManager.isEnabled" ID="SafeBrowsingManager.isEnabled"></a>
193 <h4>SafeBrowsingManager.isEnabled (class method)</h4>
194 <b>isEnabled</b>(<i></i>)
195
196 <p>
197 Class method to check, if safe browsing is enabled.
198 </p>
199 <dl>
200 <dt>Return:</dt>
201 <dd>
202 flag indicating the enabled state
203 </dd>
204 </dl>
205 <dl>
206 <dt>Return Type:</dt>
207 <dd>
208 bool
209 </dd>
210 </dl>
211 <a NAME="SafeBrowsingManager.__init__" ID="SafeBrowsingManager.__init__"></a>
212 <h4>SafeBrowsingManager (Constructor)</h4>
213 <b>SafeBrowsingManager</b>(<i></i>)
214
215 <p>
216 Constructor
217 </p>
218 <a NAME="SafeBrowsingManager.__lookupHashes" ID="SafeBrowsingManager.__lookupHashes"></a>
219 <h4>SafeBrowsingManager.__lookupHashes</h4>
220 <b>__lookupHashes</b>(<i>fullHashes</i>)
221
222 <p>
223 Private method to lookup the given hashes.
224 </p>
225 <dl>
226
227 <dt><i>fullHashes</i> (list of bytes)</dt>
228 <dd>
229 list of hashes to lookup
230 </dd>
231 </dl>
232 <dl>
233 <dt>Return:</dt>
234 <dd>
235 names of threat lists hashes were found in
236 </dd>
237 </dl>
238 <dl>
239 <dt>Return Type:</dt>
240 <dd>
241 list of ThreatList
242 </dd>
243 </dl>
244 <a NAME="SafeBrowsingManager.__setAutoUpdateThreatLists" ID="SafeBrowsingManager.__setAutoUpdateThreatLists"></a>
245 <h4>SafeBrowsingManager.__setAutoUpdateThreatLists</h4>
246 <b>__setAutoUpdateThreatLists</b>(<i></i>)
247
248 <p>
249 Private method to set auto update for the threat lists.
250 </p>
251 <a NAME="SafeBrowsingManager.__setLookupMethod" ID="SafeBrowsingManager.__setLookupMethod"></a>
252 <h4>SafeBrowsingManager.__setLookupMethod</h4>
253 <b>__setLookupMethod</b>(<i></i>)
254
255 <p>
256 Private method to set the lookup method (Update API or Lookup API).
257 </p>
258 <a NAME="SafeBrowsingManager.__setPlatforms" ID="SafeBrowsingManager.__setPlatforms"></a>
259 <h4>SafeBrowsingManager.__setPlatforms</h4>
260 <b>__setPlatforms</b>(<i></i>)
261
262 <p>
263 Private method to set the platforms to be checked against.
264 </p>
265 <a NAME="SafeBrowsingManager.__showNotificationMessage" ID="SafeBrowsingManager.__showNotificationMessage"></a>
266 <h4>SafeBrowsingManager.__showNotificationMessage</h4>
267 <b>__showNotificationMessage</b>(<i>message, timeout=5</i>)
268
269 <p>
270 Private method to show some message in a notification widget.
271 </p>
272 <dl>
273
274 <dt><i>message</i> (str)</dt>
275 <dd>
276 message to be shown
277 </dd>
278 <dt><i>timeout</i> (int)</dt>
279 <dd>
280 amount of time in seconds the message should be shown
281 (0 = indefinitely)
282 </dd>
283 </dl>
284 <a NAME="SafeBrowsingManager.__syncFullHashes" ID="SafeBrowsingManager.__syncFullHashes"></a>
285 <h4>SafeBrowsingManager.__syncFullHashes</h4>
286 <b>__syncFullHashes</b>(<i>hashPrefixes</i>)
287
288 <p>
289 Private method to download full hashes matching given prefixes.
290 </p>
291 <p>
292 This also updates the cache expiration timestamps.
293 </p>
294 <dl>
295
296 <dt><i>hashPrefixes</i> (list of bytes)</dt>
297 <dd>
298 list of hash prefixes to get full hashes for
299 </dd>
300 </dl>
301 <a NAME="SafeBrowsingManager.__threatListsUpdateTimerTimeout" ID="SafeBrowsingManager.__threatListsUpdateTimerTimeout"></a>
302 <h4>SafeBrowsingManager.__threatListsUpdateTimerTimeout</h4>
303 <b>__threatListsUpdateTimerTimeout</b>(<i></i>)
304
305 <p>
306 Private slot to perform the auto update of the threat lists.
307 </p>
308 <a NAME="SafeBrowsingManager.__verifyThreatListChecksum" ID="SafeBrowsingManager.__verifyThreatListChecksum"></a>
309 <h4>SafeBrowsingManager.__verifyThreatListChecksum</h4>
310 <b>__verifyThreatListChecksum</b>(<i>threatList, remoteChecksum</i>)
311
312 <p>
313 Private method to verify the local checksum of a threat list with the
314 checksum of the safe browsing server.
315 </p>
316 <dl>
317
318 <dt><i>threatList</i> (ThreatList)</dt>
319 <dd>
320 threat list to calculate checksum for
321 </dd>
322 <dt><i>remoteChecksum</i> (bytes)</dt>
323 <dd>
324 SHA256 checksum as reported by the Google server
325 </dd>
326 </dl>
327 <dl>
328 <dt>Return:</dt>
329 <dd>
330 flag indicating equality
331 </dd>
332 </dl>
333 <dl>
334 <dt>Return Type:</dt>
335 <dd>
336 bool
337 </dd>
338 </dl>
339 <a NAME="SafeBrowsingManager.close" ID="SafeBrowsingManager.close"></a>
340 <h4>SafeBrowsingManager.close</h4>
341 <b>close</b>(<i></i>)
342
343 <p>
344 Public method to close the safe browsing interface.
345 </p>
346 <a NAME="SafeBrowsingManager.configurationChanged" ID="SafeBrowsingManager.configurationChanged"></a>
347 <h4>SafeBrowsingManager.configurationChanged</h4>
348 <b>configurationChanged</b>(<i></i>)
349
350 <p>
351 Public method to handle changes of the settings.
352 </p>
353 <a NAME="SafeBrowsingManager.fairUseDelayExpired" ID="SafeBrowsingManager.fairUseDelayExpired"></a>
354 <h4>SafeBrowsingManager.fairUseDelayExpired</h4>
355 <b>fairUseDelayExpired</b>(<i></i>)
356
357 <p>
358 Public method to check, if the fair use wait period has expired.
359 </p>
360 <dl>
361 <dt>Return:</dt>
362 <dd>
363 flag indicating expiration
364 </dd>
365 </dl>
366 <dl>
367 <dt>Return Type:</dt>
368 <dd>
369 bool
370 </dd>
371 </dl>
372 <a NAME="SafeBrowsingManager.fullCacheCleanup" ID="SafeBrowsingManager.fullCacheCleanup"></a>
373 <h4>SafeBrowsingManager.fullCacheCleanup</h4>
374 <b>fullCacheCleanup</b>(<i></i>)
375
376 <p>
377 Public method to clean up the cache completely.
378 </p>
379 <a NAME="SafeBrowsingManager.getPlatformString" ID="SafeBrowsingManager.getPlatformString"></a>
380 <h4>SafeBrowsingManager.getPlatformString</h4>
381 <b>getPlatformString</b>(<i>platformType</i>)
382
383 <p>
384 Public method to get the platform string for a given platform type.
385 </p>
386 <dl>
387
388 <dt><i>platformType</i> (str)</dt>
389 <dd>
390 platform type as defined in the v4 API
391 </dd>
392 </dl>
393 <dl>
394 <dt>Return:</dt>
395 <dd>
396 platform string
397 </dd>
398 </dl>
399 <dl>
400 <dt>Return Type:</dt>
401 <dd>
402 str
403 </dd>
404 </dl>
405 <a NAME="SafeBrowsingManager.getThreatEntryString" ID="SafeBrowsingManager.getThreatEntryString"></a>
406 <h4>SafeBrowsingManager.getThreatEntryString</h4>
407 <b>getThreatEntryString</b>(<i>threatEntry</i>)
408
409 <p>
410 Public method to get the threat entry string.
411 </p>
412 <dl>
413
414 <dt><i>threatEntry</i> (str)</dt>
415 <dd>
416 threat entry type as defined in the v4 API
417 </dd>
418 </dl>
419 <dl>
420 <dt>Return:</dt>
421 <dd>
422 threat entry string
423 </dd>
424 </dl>
425 <dl>
426 <dt>Return Type:</dt>
427 <dd>
428 str
429 </dd>
430 </dl>
431 <a NAME="SafeBrowsingManager.getThreatMessage" ID="SafeBrowsingManager.getThreatMessage"></a>
432 <h4>SafeBrowsingManager.getThreatMessage</h4>
433 <b>getThreatMessage</b>(<i>threatType</i>)
434
435 <p>
436 Public method to get a warning message for the given threat type.
437 </p>
438 <dl>
439
440 <dt><i>threatType</i> (str)</dt>
441 <dd>
442 threat type to get the message for
443 </dd>
444 </dl>
445 <dl>
446 <dt>Return:</dt>
447 <dd>
448 threat message
449 </dd>
450 </dl>
451 <dl>
452 <dt>Return Type:</dt>
453 <dd>
454 str
455 </dd>
456 </dl>
457 <a NAME="SafeBrowsingManager.getThreatMessages" ID="SafeBrowsingManager.getThreatMessages"></a>
458 <h4>SafeBrowsingManager.getThreatMessages</h4>
459 <b>getThreatMessages</b>(<i>threatLists</i>)
460
461 <p>
462 Public method to get threat messages for the given threats.
463 </p>
464 <dl>
465
466 <dt><i>threatLists</i> (list of ThreatList)</dt>
467 <dd>
468 list of threat lists to get a message for
469 </dd>
470 </dl>
471 <dl>
472 <dt>Return:</dt>
473 <dd>
474 list of threat messages, one per unique threat type
475 </dd>
476 </dl>
477 <dl>
478 <dt>Return Type:</dt>
479 <dd>
480 list of str
481 </dd>
482 </dl>
483 <a NAME="SafeBrowsingManager.getThreatType" ID="SafeBrowsingManager.getThreatType"></a>
484 <h4>SafeBrowsingManager.getThreatType</h4>
485 <b>getThreatType</b>(<i>threatList</i>)
486
487 <p>
488 Public method to get a display string for a given threat type.
489 </p>
490 <dl>
491
492 <dt><i>threatList</i> (str)</dt>
493 <dd>
494 threat list to get display string for
495 </dd>
496 </dl>
497 <dl>
498 <dt>Return:</dt>
499 <dd>
500 display string
501 </dd>
502 </dl>
503 <dl>
504 <dt>Return Type:</dt>
505 <dd>
506 str
507 </dd>
508 </dl>
509 <a NAME="SafeBrowsingManager.isUpdatingThreatLists" ID="SafeBrowsingManager.isUpdatingThreatLists"></a>
510 <h4>SafeBrowsingManager.isUpdatingThreatLists</h4>
511 <b>isUpdatingThreatLists</b>(<i></i>)
512
513 <p>
514 Public method to check, if we are in the process of updating the
515 threat lists.
516 </p>
517 <dl>
518 <dt>Return:</dt>
519 <dd>
520 flag indicating an update process is active
521 </dd>
522 </dl>
523 <dl>
524 <dt>Return Type:</dt>
525 <dd>
526 bool
527 </dd>
528 </dl>
529 <a NAME="SafeBrowsingManager.lookupUrl" ID="SafeBrowsingManager.lookupUrl"></a>
530 <h4>SafeBrowsingManager.lookupUrl</h4>
531 <b>lookupUrl</b>(<i>url</i>)
532
533 <p>
534 Public method to lookup an URL.
535 </p>
536 <dl>
537
538 <dt><i>url</i> (str or QUrl)</dt>
539 <dd>
540 URL to be checked
541 </dd>
542 </dl>
543 <dl>
544 <dt>Return:</dt>
545 <dd>
546 tuple containing the list of threat lists the URL was found in
547 and an error message
548 </dd>
549 </dl>
550 <dl>
551 <dt>Return Type:</dt>
552 <dd>
553 tuple of (list of ThreatList, str)
554 </dd>
555 </dl>
556 <dl>
557
558 <dt>Raises <b>ValueError</b>:</dt>
559 <dd>
560 raised for an invalid URL
561 </dd>
562 </dl>
563 <a NAME="SafeBrowsingManager.showSafeBrowsingDialog" ID="SafeBrowsingManager.showSafeBrowsingDialog"></a>
564 <h4>SafeBrowsingManager.showSafeBrowsingDialog</h4>
565 <b>showSafeBrowsingDialog</b>(<i></i>)
566
567 <p>
568 Public slot to show the safe browsing management dialog.
569 </p>
570 <a NAME="SafeBrowsingManager.updateHashPrefixCache" ID="SafeBrowsingManager.updateHashPrefixCache"></a>
571 <h4>SafeBrowsingManager.updateHashPrefixCache</h4>
572 <b>updateHashPrefixCache</b>(<i></i>)
573
574 <p>
575 Public method to load or update the locally cached threat lists.
576 </p>
577 <dl>
578 <dt>Return:</dt>
579 <dd>
580 flag indicating success and an error message
581 </dd>
582 </dl>
583 <dl>
584 <dt>Return Type:</dt>
585 <dd>
586 tuple of (bool, str)
587 </dd>
588 </dl>
589 <div align="right"><a href="#top">Up</a></div>
590 <hr />
591 </body></html>

eric ide

mercurial