
Ich versuche, Firefox zu erstellen, indem ich einen Bing-API-Schlüssel ( ac_add_options --with-bing-api-keyfile=</path/to/keyfile>
im .mozconfig
) angebe. Wenn die Konfiguration ausgeführt wird, erhalte ich jedoch die Fehlermeldung, dass ERROR: Bing API key file has an invalid format.
ich die API in der Datei </path/to/keyfile>
als Zeichenfolge mit 64 Zeichen angegeben habe (mit oder ohne abschließende Zeilenumbruchfunktion, beides funktioniert nicht).
Antwort1
Die Antwort ist:
Der Benutzername, zu dem der API-Schlüssel gehört, muss vorangestellt werden, getrennt durch Leerzeichen. Das Format sollte also sein
<https://www.bingmapsportal.com/-Username> <API key>
Mit Blick auf diePython-Skript, das die Firefox-Build-Konfiguration überprüftlegt nahe, dass bestimmte Informationen, wie beispielsweise 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, {})
[...]