Fixed limit service not allowing explore integration

no issue

- Don't run limit checks for the Ghost Explore integration
This commit is contained in:
Aileen Nowak 2022-08-09 12:54:37 +01:00 committed by Aileen Booker
parent f34740d6d0
commit fd9e19ce07
2 changed files with 10 additions and 2 deletions

View File

@ -127,7 +127,11 @@ const authenticateWithToken = async (req, res, next, {token, JWT_OPTIONS}) => {
// CASE: blocking all non-internal: "custom" and "builtin" integration requests when the limit is reached
if (limitService.isLimited('customIntegrations')
&& (apiKey.relations.integration && !['internal'].includes(apiKey.relations.integration.get('type')))) {
&& (apiKey.relations.integration
&& !['internal'].includes(apiKey.relations.integration.get('type'))
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
)
) {
// NOTE: using "checkWouldGoOverLimit" instead of "checkIsOverLimit" here because flag limits don't have
// a concept of measuring if the limit has been surpassed
await limitService.errorIfWouldGoOverLimit('customIntegrations');

View File

@ -43,7 +43,11 @@ const authenticateContentApiKey = async function authenticateContentApiKey(req,
// CASE: blocking all non-internal: "custom" and "builtin" integration requests when the limit is reached
if (limitService.isLimited('customIntegrations')
&& (apiKey.relations.integration && !['internal'].includes(apiKey.relations.integration.get('type')))) {
&& (apiKey.relations.integration
&& !['internal'].includes(apiKey.relations.integration.get('type'))
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
)
) {
// NOTE: using "checkWouldGoOverLimit" instead of "checkIsOverLimit" here because flag limits don't have
// a concept of measuring if the limit has been surpassed
await limitService.errorIfWouldGoOverLimit('customIntegrations');