
ac_add_options --with-bing-api-keyfile=</path/to/keyfile>
Bing API 키( 에서 ) 를 지정하여 Firefox를 빌드하려고 합니다 .mozconfig
. 그러나 구성이 실행되면 ERROR: Bing API key file has an invalid format.
파일 내에서 API를 64자의 문자열로 제공했다는 오류가 발생합니다 </path/to/keyfile>
(후행 개행 여부에 관계없이 둘 다 작동하지 않습니다).
답변1
정답은:
API 키가 속한 사용자 이름을 공백으로 구분하여 앞에 추가해야 합니다. 따라서 형식은 다음과 같아야합니다.
<https://www.bingmapsportal.com/-Username> <API key>
을 보면서firefox-build-configuration을 확인하는 Python 스크립트ID와 같은 정보가 필요하다고 제안합니다.
[...]
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, {})
[...]