fune/toolkit/components/url-classifier/components.conf
Dimi 42eafaedd0 Bug 1728871 - P1. Add UrlClassifierRemoteSettingsService to serve update data over RemoteSettings r=gcp,leplatrem
This patch implements UrlClassifierRemoteSettingsService to get SafeBrowsing data (protocol v2)
from RemoteSettings instead of from the Shavar server. This is only used
by data provided by Mozilla.

To distinguish if the data should be coming from RemoteSettings or
Shavar, We added a custom scheme "moz-sbrs" to denote that the data should be
retrieved from Remote Setting. This is done by changing the value of pref
"browser.safebrowsing.provider.mozilla.updateURL" to something like
"moz-sbrf://tracking-protection-list". (Note that the hostname is not
used at this point).

The goal of this patch is to make the new architecture compatible with
the original Safe Browsing design. So we don't notify Safe Browsing
there is new data available (via "sync" event of RemoteSettings). We still follow
how Safe Browsing periodically checks whether there is a newer version of list.

Note.
This patch changes the flow comparing with how we usualy receive SafeBrowsing response from Shavar.
In Shavar case, the list data response usually comes with
"n:21600\ni:listname1\nu:redirectURL1\ni:listname2\nu:redirectURL2 ..." first.
And then we fetch the data again from the redirectURL for each list.

But in the current implementation, responses don't contain
redirectURL anymore (since we already have the data). So the mocked response
will contain all the data needed in one response.
For example:
"n:21600\ni:listname1\n:chunkdata1\ni:listname2\n:chunkdata2...".

Differential Revision: https://phabricator.services.mozilla.com/D135989
2022-07-07 15:01:08 +00:00

32 lines
1.3 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Classes = [
{
'cid': '{26a4a019-2827-4a89-a85c-5931a678823a}',
'contract_ids': ['@mozilla.org/url-classifier/jslib;1'],
'jsm': 'resource://gre/modules/UrlClassifierLib.jsm',
'constructor': 'UrlClassifierLib',
},
{
'cid': '{ca168834-cc00-48f9-b83c-fd018e58cae3}',
'contract_ids': ['@mozilla.org/url-classifier/listmanager;1'],
'jsm': 'resource://gre/modules/UrlClassifierListManager.jsm',
'constructor': 'RegistrationData',
},
{
'cid': '{9111de73-9322-4bfc-8b65-2b727f3e6ec8}',
'contract_ids': ['@mozilla.org/url-classifier/hashcompleter;1'],
'jsm': 'resource://gre/modules/UrlClassifierHashCompleter.jsm',
'constructor': 'HashCompleter',
},
{
'cid': '{1980624c-c50b-4b46-a91c-dfaba7792706}',
'contract_ids': ['@mozilla.org/url-classifier/list-service;1'],
'jsm': 'resource://gre/modules/UrlClassifierRemoteSettingsService.jsm',
'constructor': 'UrlClassifierRemoteSettingsService',
},
]