mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 16:41:24 +03:00
Moved canary/v3 webhooks API to "stable" group
no issue - Webhooks API has been stabilized with latest changes and there are no breaking changes planned for v3. The change has strictly "informative" purpose - Changed variable naming from "whitelisted" to "allowlisted" to follow updated naming convention (refs. https://mysqlhighavailability.com/mysql-terminology-updates/)
This commit is contained in:
parent
b76a6a1eee
commit
067d2eb614
@ -11,12 +11,13 @@ const notImplemented = function (req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @NOTE: integrations have limited access for now
|
// @NOTE: integrations have limited access for now
|
||||||
const whitelisted = {
|
const allowlisted = {
|
||||||
// @NOTE: stable
|
// @NOTE: stable
|
||||||
site: ['GET'],
|
site: ['GET'],
|
||||||
posts: ['GET', 'PUT', 'DELETE', 'POST'],
|
posts: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||||
pages: ['GET', 'PUT', 'DELETE', 'POST'],
|
pages: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||||
images: ['POST'],
|
images: ['POST'],
|
||||||
|
webhooks: ['POST', 'PUT', 'DELETE'],
|
||||||
// @NOTE: experimental
|
// @NOTE: experimental
|
||||||
actions: ['GET'],
|
actions: ['GET'],
|
||||||
tags: ['GET', 'PUT', 'DELETE', 'POST'],
|
tags: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||||
@ -25,7 +26,6 @@ const notImplemented = function (req, res, next) {
|
|||||||
themes: ['POST', 'PUT'],
|
themes: ['POST', 'PUT'],
|
||||||
members: ['GET', 'PUT', 'DELETE', 'POST'],
|
members: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||||
config: ['GET'],
|
config: ['GET'],
|
||||||
webhooks: ['POST', 'PUT', 'DELETE'],
|
|
||||||
schedules: ['PUT'],
|
schedules: ['PUT'],
|
||||||
db: ['POST']
|
db: ['POST']
|
||||||
};
|
};
|
||||||
@ -35,7 +35,7 @@ const notImplemented = function (req, res, next) {
|
|||||||
if (match) {
|
if (match) {
|
||||||
const entity = match[1];
|
const entity = match[1];
|
||||||
|
|
||||||
if (whitelisted[entity] && whitelisted[entity].includes(req.method)) {
|
if (allowlisted[entity] && allowlisted[entity].includes(req.method)) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user