2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Updated stability index comments around Admin API v2 endpoints

refs 067d2eb614

- v2 API has been in maintenance mode since v3 has been released, updated comments accordingly
This commit is contained in:
Nazar Gargol 2020-08-03 23:46:23 +12:00
parent 067d2eb614
commit 2a4ad0e10f

View file

@ -11,18 +11,17 @@ const notImplemented = function (req, res, next) {
}
// @NOTE: integrations have limited access for now
const whitelisted = {
// @NOTE: stable
// all APIs are considered to be in "maintenance" stability index
const allowlisted = {
site: ['GET'],
posts: ['GET', 'PUT', 'DELETE', 'POST'],
pages: ['GET', 'PUT', 'DELETE', 'POST'],
images: ['POST'],
// @NOTE: experimental
webhooks: ['POST', 'PUT', 'DELETE'],
tags: ['GET', 'PUT', 'DELETE', 'POST'],
users: ['GET'],
themes: ['POST', 'PUT'],
config: ['GET'],
webhooks: ['POST', 'PUT', 'DELETE'],
schedules: ['PUT'],
db: ['POST']
};
@ -32,7 +31,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();
}
}