Welches ist das richtige Format für Firefox-Build "--with-bing-api-keyfile"?

295
Golar Ramblar

Ich versuche, Firefox mit der Angabe eines Bing-API-Schlüssels ( ac_add_options --with-bing-api-keyfile=</path/to/keyfile>in .mozconfig) zu erstellen . Wenn die Konfiguration jedoch ausgeführt wird, erhalte ich die Fehlermeldung, ERROR: Bing API key file has an invalid format.dass die API in der Datei </path/to/keyfile>als eine Zeichenfolge mit 64 Zeichen angegeben wurde (mit oder ohne nachstehende Zeile, beide funktionieren nicht).

0

1 Antwort auf die Frage

0
Golar Ramblar

Die Antwort ist:

Der Benutzername, zu dem der API-Schlüssel gehört, muss durch Leerzeichen getrennt vorangestellt werden. Das Format sollte also sein

<https://www.bingmapsportal.com/-Username> <API key> 

Ein Blick auf das Python-Skript, das die Firefox-Build-Konfiguration überprüft, legt nahe, dass einige Informationen wie eine ID erforderlich sind:

[...] with MockedOpen({'key': 'fake-id fake-key\n'}): config, output, status = self.get_result( "id_and_secret_keyfile('Bing API')", args=['--with-bing-api-keyfile=key'], includes=includes) self.assertEqual(status, 0) self.assertEqual(output, textwrap.dedent('''\ checking for the Bing API key... yes ''')) self.assertEqual(config, { 'MOZ_BING_API_CLIENTID': 'fake-id', 'MOZ_BING_API_KEY': 'fake-key', })  with MockedOpen({'key': 'fake-key\n'}): config, output, status = self.get_result( "id_and_secret_keyfile('Bing API')", args=['--with-bing-api-keyfile=key'], includes=includes) self.assertEqual(status, 1) self.assertEqual(output, textwrap.dedent('''\ checking for the Bing API key... no ERROR: Bing API key file has an invalid format. ''')) self.assertEqual(config, {}) [...]