0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/api/v2
Fabien O'Carroll 3db102a776
Added API Key auth middleware to v2 content API (#10005)
* Added API Key auth middleware to v2 content API

refs #9865

- add `auth.authenticate.authenticateContentApiKey` middleware
  - accepts `?key=` query param, sets `req.api_key` if it's a known Content API key
- add `requiresAuthorizedUserOrApiKey` authorization middleware
  - passes if either `req.user` or `req.api_key` exists
- update `authenticatePublic` middleware stack for v2 content routes

* Fixed functional content api tests

no-issue

This fixes the functional content api tests so they use the content api
auth.

* Fixed context check and removed skip

* Updated cors middleware for content api

* Removed client_id from frame.context

no-issue

The v2 api doesn't have a notion of clients as we do not use oauth for it

* Fixed tests for posts input serializer
2018-10-15 16:23:34 +07:00
..
utils Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
index.js Added users ctrl to v2 (#10001) 2018-10-12 23:27:30 +02:00
invites.js Added invites ctrl to v2 2018-10-12 21:13:20 +02:00
mail.js Added mail ctrl to v2 2018-10-12 21:13:20 +02:00
notifications.js Added notifications ctrl to v2 2018-10-12 21:13:20 +02:00
pages.js Added tiny framework to support multiple API versions (#9933) 2018-10-05 00:50:45 +02:00
posts.js Added posts controller to v2 2018-10-12 19:21:43 +02:00
roles.js Migrated roles controller to API v2 2018-10-10 16:48:22 +02:00
session.js
settings.js Added settings ctrl to v2 2018-10-12 21:13:20 +02:00
slugs.js Added v2 controller for slugs (#9978) 2018-10-12 17:55:20 +05:30
subscribers.js Added subscribers controller to v2 2018-10-12 22:27:37 +02:00
tags.js Added tags ctrl to v2 (#10000) 2018-10-12 23:10:43 +02:00
upload.js Added upload controller to v1 (#9997) 2018-10-12 22:41:39 +02:00
users.js Added users ctrl to v2 (#10001) 2018-10-12 23:27:30 +02:00
webhooks.js Added webhooks controller to API v2 2018-10-12 18:42:23 +05:30