Updated comments around API access

no issue

- While auditing the access rights to endpoints have come across the "stable" / "experimental" notes that do not make any sense in the current approach towards the API. Every endpoint that's documented and exposed just "is" there no stable/unstable/canary/whatever distinction in the Admin API since Ghost v5
- Staff tokens were also acked as a separate way to access the API, so we have them in mind when modifying the access-list
This commit is contained in:
Naz 2022-08-30 11:23:47 +08:00
parent 619af026d6
commit 8af8905fa9
No known key found for this signature in database

View File

@ -14,15 +14,13 @@ const notImplemented = function (req, res, next) {
return next();
}
// @NOTE: integrations have limited access for now
// @NOTE: integrations & staff tokens have limited access to the API
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'],
labels: ['GET', 'PUT', 'DELETE', 'POST'],