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/auth
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
..
api-key Added API Key auth middleware to v2 content API (#10005) 2018-10-15 16:23:34 +07:00
session Updated session middleware to support node v6 (#9980) 2018-10-10 20:07:31 +07:00
auth-strategies_spec.js Moved utils constants to lib/constants 2017-12-14 14:13:40 +01:00
authenticate_spec.js Session auth service (#9910) 2018-10-02 15:35:23 +07:00
oauth_spec.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
passport_spec.js Removed old jshint/jscs rules 2018-06-02 21:48:23 +02:00