0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server
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
..
adapters Refactored direct usages of api controllers 2018-09-21 15:18:22 +02:00
api Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
apps 🐛 Fixed redirect issue with private sites (#9960) 2018-10-08 16:31:08 +07:00
config Updated overrides config for api versions with v0.1 to deprecated (#9921) 2018-09-27 19:34:12 +02:00
data 🐛 Fixed migration from v1 to 2.2.1 (#9984) 2018-10-11 09:04:47 +02:00
helpers Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
lib Extended sequence utility 2018-10-03 00:17:45 +02:00
models Updated ApiKey onSaving to forward options (#9994) 2018-10-14 16:54:10 +07:00
public Removed change frequency and priority fields from sitemap generator (#9771) 2018-09-24 19:16:31 +02:00
services Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
translations Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
views Fixed error trying to render 404 for missing asset 2017-12-22 20:08:59 +00:00
web Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
analytics-events.js Cleared out old unused events 2017-12-13 09:08:25 +00:00
filters.js Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
ghost-server.js Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
index.js Refactored method urlFor to use versionType instead of admin: true 2018-10-04 16:49:55 +05:30
overrides.js Disabled bluebird debug logs 2018-08-13 14:01:31 +02:00
update-check.js Updated docs links 2018-08-16 12:13:24 +02:00