mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
Allowed core integrations to work with Admin API
This commit is contained in:
parent
c813e5d96e
commit
0e284edbad
@ -672,7 +672,7 @@
|
||||
"slug": "ghost-explore",
|
||||
"name": "Ghost Explore",
|
||||
"description": "Built-in Ghost Explore integration",
|
||||
"type": "builtin",
|
||||
"type": "core",
|
||||
"api_keys": [{"type": "admin", "role": "Ghost Explore Integration"}]
|
||||
},
|
||||
{
|
||||
|
@ -319,7 +319,7 @@ module.exports = {
|
||||
maxlength: 50,
|
||||
nullable: false,
|
||||
defaultTo: 'custom',
|
||||
validations: {isIn: [['internal', 'builtin', 'custom']]}
|
||||
validations: {isIn: [['internal', 'builtin', 'custom', 'core']]}
|
||||
},
|
||||
name: {type: 'string', maxlength: 191, nullable: false},
|
||||
slug: {type: 'string', maxlength: 191, nullable: false, unique: true},
|
||||
|
@ -127,11 +127,7 @@ 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'))
|
||||
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
|
||||
)
|
||||
) {
|
||||
&& (apiKey.relations.integration && !['internal', 'core'].includes(apiKey.relations.integration.get('type')))) {
|
||||
// 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');
|
||||
|
@ -43,11 +43,7 @@ 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'))
|
||||
&& !['ghost-explore'].includes(apiKey.relations.integration.get('slug'))
|
||||
)
|
||||
) {
|
||||
&& (apiKey.relations.integration && !['internal', 'core'].includes(apiKey.relations.integration.get('type')))) {
|
||||
// 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');
|
||||
|
@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = '45337ae85129a98e4c1b551cc91790da';
|
||||
const currentFixturesHash = 'a75211a41f515202280be7cb287e101f';
|
||||
const currentFixturesHash = '0ae1887dd0b42508be946bdbd20d41c8';
|
||||
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
|
@ -845,7 +845,7 @@
|
||||
"slug": "ghost-explore",
|
||||
"name": "Ghost Explore",
|
||||
"description": "Built-in Ghost Explore integration",
|
||||
"type": "builtin",
|
||||
"type": "core",
|
||||
"api_keys": [{"type": "admin", "role": "Ghost Explore Integration"}]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user