Backed out changeset 6c2e00bcd2bb (bug 1531176) due to google-location-api-keyfile build busatges CLOSED TREE

This commit is contained in:
Ciure Andrei 2019-03-07 10:49:26 +02:00
Родитель 03ac617a44
Коммит 06cf4b1f67
20 изменённых файлов: 33 добавлений и 57 удалений

Просмотреть файл

@ -1379,7 +1379,7 @@ pref("dom.debug.propagate_gesture_events_through_content", false);
// All the Geolocation preferences are here.
//
#ifndef EARLY_BETA_OR_EARLIER
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_GEOLOCATION_API_KEY%");
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%");
#else
// Use MLS on Nightly and early Beta.
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");

Просмотреть файл

@ -3,8 +3,7 @@
. $topsrcdir/build/mozconfig.stylo
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=/builds/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key
. $topsrcdir/build/unix/mozconfig.linux32

Просмотреть файл

@ -3,8 +3,7 @@
. $topsrcdir/build/mozconfig.stylo
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=/builds/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key
. $topsrcdir/build/unix/mozconfig.linux

Просмотреть файл

@ -2,8 +2,7 @@
ac_add_options --disable-debug
ac_add_options --enable-optimize="-O2 -gline-tables-only"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=/builds/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key
. $topsrcdir/build/mozconfig.stylo

Просмотреть файл

@ -3,8 +3,7 @@
. $topsrcdir/build/macosx/mozconfig.common
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=/builds/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-desktop-geoloc-api.key
# Needed to enable breakpad in application.ini

Просмотреть файл

@ -6,8 +6,7 @@
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=${WORKSPACE}/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=${WORKSPACE}/sb-gapi.data
ac_add_options --with-google-api-keyfile=${WORKSPACE}/gapi.data
ac_add_options --with-mozilla-api-keyfile=${WORKSPACE}/mozilla-desktop-geoloc-api.key

Просмотреть файл

@ -6,8 +6,7 @@
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=${WORKSPACE}/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=${WORKSPACE}/sb-gapi.data
ac_add_options --with-google-api-keyfile=${WORKSPACE}/gapi.data
ac_add_options --with-mozilla-api-keyfile=${WORKSPACE}/mozilla-desktop-geoloc-api.key

Просмотреть файл

@ -6,8 +6,7 @@
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=${WORKSPACE}/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=${WORKSPACE}/sb-gapi.data
ac_add_options --with-google-api-keyfile=${WORKSPACE}/gapi.data
ac_add_options --with-mozilla-api-keyfile=${WORKSPACE}/mozilla-desktop-geoloc-api.key

Просмотреть файл

@ -1,8 +1,7 @@
MOZ_AUTOMATION_L10N_CHECK=0
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-location-api-keyfile=${WORKSPACE}/gls-gapi.data
ac_add_options --with-google-safebrowsing-api-keyfile=${WORKSPACE}/sb-gapi.data
ac_add_options --with-google-api-keyfile=${WORKSPACE}/gapi.data
ac_add_options --with-mozilla-api-keyfile=${WORKSPACE}/mozilla-desktop-geoloc-api.key
. "$topsrcdir/build/mozconfig.win-common"

Просмотреть файл

@ -48,8 +48,7 @@ export MOZ_ANDROID_POCKET=1
# Disable Keyfile Loading (and checks) since dependency fetching doesn't need these keys.
# This overrides the settings in the common android mozconfig
ac_add_options --without-mozilla-api-keyfile
ac_add_options --without-google-geolocation-api-keyfile
ac_add_options --without-google-safebrowsing-api-keyfile
ac_add_options --without-google-api-keyfile
# We need dummy Keyfiles in order to enable features we care about.
ac_add_options --with-adjust-sdk-keyfile="$topsrcdir/mobile/android/base/adjust-sdk-sandbox.token"
ac_add_options --with-leanplum-sdk-keyfile="$topsrcdir/mobile/android/base/leanplum-sdk-sandbox.token"

Просмотреть файл

@ -36,8 +36,7 @@ fi
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --with-google-safebrowsing-api-keyfile=/builds/sb-gapi.data
ac_add_options --with-google-location-api-keyfile=/builds/gls-gapi.data
ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-fennec-geoloc-api.key
ac_add_options --enable-marionette

Просмотреть файл

@ -5618,7 +5618,7 @@ pref("browser.safebrowsing.id", "Firefox");
pref("browser.safebrowsing.downloads.enabled", true);
pref("browser.safebrowsing.downloads.remote.enabled", true);
pref("browser.safebrowsing.downloads.remote.timeout_ms", 15000);
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_SAFEBROWSING_API_KEY%");
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.downloads.remote.block_dangerous", true);
pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true);
pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", true);
@ -5627,7 +5627,7 @@ pref("browser.safebrowsing.downloads.remote.block_uncommon", true);
// Google Safe Browsing provider (legacy)
pref("browser.safebrowsing.provider.google.pver", "2.2");
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,googpub-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_SAFEBROWSING_API_KEY%");
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
pref("browser.safebrowsing.provider.google.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
@ -5638,14 +5638,14 @@ pref("browser.safebrowsing.provider.google.advisoryName", "Google Safe Browsing"
// Google Safe Browsing provider
pref("browser.safebrowsing.provider.google4.pver", "4");
pref("browser.safebrowsing.provider.google4.lists", "goog-badbinurl-proto,goog-downloadwhite-proto,goog-phish-proto,googpub-phish-proto,goog-malware-proto,goog-unwanted-proto,goog-harmful-proto,goog-passwordwhite-proto");
pref("browser.safebrowsing.provider.google4.updateURL", "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.gethashURL", "https://safebrowsing.googleapis.com/v4/fullHashes:find?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.updateURL", "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$ct=application/x-protobuf&key=%GOOGLE_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.gethashURL", "https://safebrowsing.googleapis.com/v4/fullHashes:find?$ct=application/x-protobuf&key=%GOOGLE_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
pref("browser.safebrowsing.provider.google4.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.provider.google4.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
pref("browser.safebrowsing.provider.google4.advisoryURL", "https://developers.google.com/safe-browsing/v4/advisory");
pref("browser.safebrowsing.provider.google4.advisoryName", "Google Safe Browsing");
pref("browser.safebrowsing.provider.google4.dataSharingURL", "https://safebrowsing.googleapis.com/v4/threatHits?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.dataSharingURL", "https://safebrowsing.googleapis.com/v4/threatHits?$ct=application/x-protobuf&key=%GOOGLE_API_KEY%&$httpMethod=POST");
pref("browser.safebrowsing.provider.google4.dataSharing.enabled", false);
pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");

Просмотреть файл

@ -352,10 +352,10 @@ var SafeBrowsing = {
gethashURL = gethashURL.replace("SAFEBROWSING_ID", clientID);
// Disable updates and gethash if the Google API key is missing.
let googleSBKey = Services.urlFormatter.formatURL("%GOOGLE_SAFEBROWSING_API_KEY%").trim();
let googleKey = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
if ((provider == "google" || provider == "google4") &&
(!googleSBKey || googleSBKey == "no-google-safebrowsing-api-key")) {
log("Missing Google SafeBrowsing API key, clearing updateURL and gethashURL.");
(!googleKey || googleKey == "no-google-api-key")) {
log("Missing Google API key, clearing updateURL and gethashURL.");
updateURL = "";
gethashURL = "";
}

Просмотреть файл

@ -60,7 +60,7 @@ for (let pref of prefs) {
var listmanager = Cc["@mozilla.org/url-classifier/listmanager;1"].
getService(Ci.nsIUrlListManager);
let googleKey = SpecialPowers.Services.urlFormatter.formatURL("%GOOGLE_SAFEBROWSING_API_KEY%").trim();
let googleKey = SpecialPowers.Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
for (let list of lists) {
if (!list)
@ -75,7 +75,7 @@ for (let list of lists) {
let provider = listsToProvider[index];
let pref = "browser.safebrowsing.provider." + provider + ".gethashURL";
if ((provider == "google" || provider == "google4") &&
(!googleKey || googleKey == "no-google-safebrowsing-api-key")) {
(!googleKey || googleKey == "no-google-api-key")) {
is(url, "", "getHash url of " + list + " should be empty");
} else {
is(url, SpecialPowers.getCharPref(pref), list + " matches its gethash url");

Просмотреть файл

@ -85,8 +85,7 @@ nsURLFormatterService.prototype = {
OS_VERSION() { return this.OSVersion; },
CHANNEL: () => UpdateUtils.UpdateChannel,
MOZILLA_API_KEY: () => AppConstants.MOZ_MOZILLA_API_KEY,
GOOGLE_GEOLOCATION_API_KEY: () => AppConstants.MOZ_GOOGLE_GEOLOCATION_API_KEY,
GOOGLE_SAFEBROWSING_API_KEY: () => AppConstants.MOZ_GOOGLE_SAFEBROWSING_API_KEY,
GOOGLE_API_KEY: () => AppConstants.MOZ_GOOGLE_API_KEY,
BING_API_CLIENTID: () => AppConstants.MOZ_BING_API_CLIENTID,
BING_API_KEY: () => AppConstants.MOZ_BING_API_KEY,
DISTRIBUTION() { return this.distribution.id; },
@ -127,12 +126,9 @@ nsURLFormatterService.prototype = {
},
trimSensitiveURLs: function uf_trimSensitiveURLs(aMsg) {
// Only the google API keys is sensitive for now.
aMsg = AppConstants.MOZ_GOOGLE_GEOLOCATION_API_KEY ? aMsg.replace(RegExp(AppConstants.MOZ_GOOGLE_GEOLOCATION_API_KEY, "g"),
"[trimmed-google-geolocation-api-key]")
: aMsg;
return AppConstants.MOZ_GOOGLE_SAFEBROWSING_API_KEY ? aMsg.replace(RegExp(AppConstants.MOZ_GOOGLE_SAFEBROWSING_API_KEY, "g"),
"[trimmed-google-safebrowsing-api-key]")
// Only the google API key is sensitive for now.
return AppConstants.MOZ_GOOGLE_API_KEY ? aMsg.replace(RegExp(AppConstants.MOZ_GOOGLE_API_KEY, "g"),
"[trimmed-google-api-key]")
: aMsg;
},
};

Просмотреть файл

@ -46,14 +46,11 @@ function run_test() {
Assert.equal(formatter.formatURL(advancedUrl), advancedUrlRef);
for (let val of ["MOZILLA_API_KEY", "GOOGLE_GEOLOCATION_API_KEY", "GOOGLE_SAFEBROWSING_API_KEY", "BING_API_CLIENTID", "BING_API_KEY"]) {
for (let val of ["MOZILLA_API_KEY", "GOOGLE_API_KEY", "BING_API_CLIENTID", "BING_API_KEY"]) {
let url = "http://test.mozilla.com/?val=%" + val + "%";
Assert.notEqual(formatter.formatURL(url), url);
}
let url_sb = "http://test.mozilla.com/%GOOGLE_SAFEBROWSING_API_KEY%/?val=%GOOGLE_SAFEBROWSING_API_KEY%";
Assert.equal(formatter.trimSensitiveURLs(formatter.formatURL(url_sb)), "http://test.mozilla.com/[trimmed-google-safebrowsing-api-key]/?val=[trimmed-google-safebrowsing-api-key]");
let url_gls = "http://test.mozilla.com/%GOOGLE_GEOLOCATION_API_KEY%/?val=%GOOGLE_GEOLOCATION_API_KEY%";
Assert.equal(formatter.trimSensitiveURLs(formatter.formatURL(url_gls)), "http://test.mozilla.com/[trimmed-google-geolocation-api-key]/?val=[trimmed-google-geolocation-api-key]");
let url = "http://test.mozilla.com/%GOOGLE_API_KEY%/?val=%GOOGLE_API_KEY%";
Assert.equal(formatter.trimSensitiveURLs(formatter.formatURL(url)), "http://test.mozilla.com/[trimmed-google-api-key]/?val=[trimmed-google-api-key]");
}

Просмотреть файл

@ -320,8 +320,7 @@ this.AppConstants = Object.freeze({
MOZ_BING_API_CLIENTID: "@MOZ_BING_API_CLIENTID@",
MOZ_BING_API_KEY: "@MOZ_BING_API_KEY@",
MOZ_GOOGLE_GEOLOCATION_API_KEY: "@MOZ_GOOGLE_GEOLOCATION_API_KEY@",
MOZ_GOOGLE_SAFEBROWSING_API_KEY: "@MOZ_GOOGLE_SAFEBROWSING_API_KEY@",
MOZ_GOOGLE_API_KEY: "@MOZ_GOOGLE_API_KEY@",
MOZ_MOZILLA_API_KEY: "@MOZ_MOZILLA_API_KEY@",
BROWSER_CHROME_URL: "@BROWSER_CHROME_URL@",

Просмотреть файл

@ -226,11 +226,8 @@ var dataProviders = {
data.policiesStatus = Services.policies.status;
}
const keyGLSGoogle = Services.urlFormatter.formatURL("%GOOGLE_GEOLOCATION_API_KEY%").trim();
data.keyGLSGoogleFound = keyGLSGoogle != "no-google-geolocation-api-key" && keyGLSGoogle.length > 0;
const keySBGoogle = Services.urlFormatter.formatURL("%GOOGLE_SAFEBROWSING_API_KEY%").trim();
data.keySBGoogleFound = keySBGoogle != "no-google-safebrowsing-api-key" && keySBGoogle.length > 0;
const keyGoogle = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
data.keyGoogleFound = keyGoogle != "no-google-api-key" && keyGoogle.length > 0;
const keyMozilla = Services.urlFormatter.formatURL("%MOZILLA_API_KEY%").trim();
data.keyMozillaFound = keyMozilla != "no-mozilla-api-key" && keyMozilla.length > 0;

Просмотреть файл

@ -302,8 +302,7 @@ for var in ('ANDROID_PACKAGE_NAME',
'MOZ_APP_VERSION_DISPLAY',
'MOZ_BING_API_CLIENTID',
'MOZ_BING_API_KEY',
'MOZ_GOOGLE_GEOLOCATION_API_KEY',
'MOZ_GOOGLE_SAFEBROWSING_API_KEY',
'MOZ_GOOGLE_API_KEY',
'MOZ_MACBUNDLE_NAME',
'MOZ_MOZILLA_API_KEY',
'MOZ_WIDGET_TOOLKIT',

Просмотреть файл

@ -651,9 +651,7 @@ include('../build/moz.configure/keyfiles.configure')
simple_keyfile('Mozilla API')
simple_keyfile('Google Location Service API')
simple_keyfile('Google Safebrowsing API')
simple_keyfile('Google API')
id_and_secret_keyfile('Bing API')