💡 Upgraded Tenor API to v2 (#15087)

closes: https://github.com/TryGhost/Ghost/issues/14980
refs: cc276486f0

- Tenor is now operated by Google, and the old v1 Tenor API has been decommissioned
- At present anyone with a pre-configured tenor integration will get intermittent errors, whilst it is impossible to setup a new tenor API integration
- Sadly old keys do not work with the new API, and new keys do not work with the old API, so there is no happy path forward.
- After this lands, everyone will need to go and get a new Google API Key for Tenor, update their config, and then the integration will work properly again.
- This particular change renames the API key from `publicReadOnlyApiKey` to `googleApiKey` to reflect that the key itself changes in type and behaviour

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
This commit is contained in:
arsereg 2022-08-05 07:13:27 -04:00 committed by GitHub
parent ba863966ad
commit 182a7ea07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -25,8 +25,7 @@ export default class TenorService extends Service {
_nextPos = null;
get apiKey() {
// @TODO confirm this!
return this.config.get('tenor.apiKey');
return this.config.get('tenor.googleApiKey');
}
get contentfilter() {

View File

@ -195,7 +195,7 @@ export const CARD_MENU = [
payload: {
imageSelector: 'tenor'
},
isAvailable: 'config.tenor.publicReadOnlyApiKey'
isAvailable: 'config.tenor.googleApiKey'
},
{
label: 'Toggle',

View File

@ -153,7 +153,7 @@
"url": "https://unpkg.com/@tryghost/koenig-react/dist/umd/koenig-react.min.js"
},
"tenor": {
"publicReadOnlyApiKey": null,
"googleApiKey": null,
"contentFilter": "off"
},
"opensea": {

View File

@ -15,12 +15,12 @@ describe('Config API', function () {
});
afterEach(function () {
configUtils.set('tenor:publicReadOnlyApiKey', undefined);
configUtils.set('tenor:googleApiKey', undefined);
});
it('can retrieve config and all expected properties', async function () {
// set any non-default keys so we can be sure they're exposed
configUtils.set('tenor:publicReadOnlyApiKey', 'TENOR_KEY');
configUtils.set('tenor:googleApiKey', 'TENOR_KEY');
const res = await request
.get(localUtils.API.getApiQuery('config/'))