mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +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
|
||||
const whitelisted = {
|
||||
const allowlisted = {
|
||||
// @NOTE: stable
|
||||
site: ['GET'],
|
||||
posts: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||
pages: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||
images: ['POST'],
|
||||
webhooks: ['POST', 'PUT', 'DELETE'],
|
||||
// @NOTE: experimental
|
||||
actions: ['GET'],
|
||||
tags: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||
@ -25,7 +26,6 @@ const notImplemented = function (req, res, next) {
|
||||
themes: ['POST', 'PUT'],
|
||||
members: ['GET', 'PUT', 'DELETE', 'POST'],
|
||||
config: ['GET'],
|
||||
webhooks: ['POST', 'PUT', 'DELETE'],
|
||||
schedules: ['PUT'],
|
||||
db: ['POST']
|
||||
};
|
||||
@ -35,7 +35,7 @@ const notImplemented = function (req, res, next) {
|
||||
if (match) {
|
||||
const entity = match[1];
|
||||
|
||||
if (whitelisted[entity] && whitelisted[entity].includes(req.method)) {
|
||||
if (allowlisted[entity] && allowlisted[entity].includes(req.method)) {
|
||||
return next();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user