Added Tenor contentFilter setting to config

refs https://github.com/TryGhost/Team/issues/1217

- moved top-level `tenorApiKey` to `tenor:apiKey` and added `tenor:contentFilter`
- added base config to `defaults.json`
- updated `public-config.js` and API output serializer to use the new top-level `tenor` key
This commit is contained in:
Kevin Ansfield 2021-11-16 17:42:19 +00:00
parent 9fba3d6661
commit 63b7ef7dc6
5 changed files with 9 additions and 5 deletions

View File

@ -22,7 +22,7 @@ module.exports = {
];
if (labs.isSet('gifsCard')) {
keys.push('tenorApiKey');
keys.push('tenor');
}
frame.response = {

View File

@ -17,7 +17,7 @@ module.exports = function getConfigProperties() {
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
emailAnalytics: config.get('emailAnalytics'),
hostSettings: config.get('hostSettings'),
tenorApiKey: config.get('tenorApiKey')
tenor: config.get('tenor')
};
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';

View File

@ -128,5 +128,9 @@
"portal": {
"url": "https://unpkg.com/@tryghost/portal@~1.12.0/umd/portal.min.js",
"version": "1.12"
},
"tenor": {
"apiKey": null,
"contentFilter": "off"
}
}

View File

@ -15,12 +15,12 @@ describe('Config API', function () {
});
afterEach(function () {
configUtils.set('tenorApiKey', undefined);
configUtils.set('tenor:apiKey', 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('tenorApiKey', 'TENOR_KEY');
configUtils.set('tenor:apiKey', 'TENOR_KEY');
const res = await request
.get(localUtils.API.getApiQuery('config/'))

View File

@ -29,7 +29,7 @@ const expectedProperties = {
action: ['id', 'resource_type', 'actor_type', 'event', 'created_at', 'actor'],
config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar', 'stripeDirect', 'emailAnalytics', 'tenorApiKey'],
config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar', 'stripeDirect', 'emailAnalytics', 'tenor'],
post: [
'id',