0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/test/unit/services
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
..
apps Dynamic Routing Beta (#9596) 2018-06-05 19:02:20 +02:00
auth Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
mail Removed old jshint/jscs rules 2018-06-02 21:48:23 +02:00
permissions Removed old jshint/jscs rules 2018-06-02 21:48:23 +02:00
routing 🔥 Removed permalink setting 2018-08-16 12:13:24 +02:00
rss 🎨Added absolute_url flag to public api (#9833) 2018-08-31 11:02:39 +01:00
settings Optimised test folder structure (#9958) 2018-10-07 16:36:02 +02:00
themes 🔥 Removed permalink setting 2018-08-16 12:13:24 +02:00
url Removed testUtils.API.getApiPath 2018-10-05 16:49:46 +02:00
slack_spec.js Dynamic Routing Beta (#9596) 2018-06-05 19:02:20 +02:00
webhooks_spec.js Import lib/common only 2017-12-12 10:28:13 +01:00
xmlrpc_spec.js Fixed RPC pings (#9816) 2018-08-23 15:20:29 +02:00