mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
parent
eafbaaeba5
commit
59036577af
2 changed files with 1 additions and 27 deletions
|
@ -102,9 +102,7 @@ const authenticate = {
|
|||
)(req, res, next);
|
||||
},
|
||||
|
||||
// @NOTE: authentication for admin api keys is disabled
|
||||
// authenticateAdminApi: [apiKeyAuth.admin.authenticate, session.authenticate],
|
||||
authenticateAdminApi: [session.authenticate],
|
||||
authenticateAdminApi: [apiKeyAuth.admin.authenticate, session.authenticate],
|
||||
|
||||
authenticateContentApi: [apiKeyAuth.content.authenticateContentApiKey, members.authenticateMembersToken]
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@ const config = require('../../../../server/config');
|
|||
|
||||
const ghost = testUtils.startGhost;
|
||||
|
||||
// TODO: remove this suite once Admin API key auth is enabled
|
||||
describe('Admin API V2 key authentication', function () {
|
||||
let request;
|
||||
|
||||
|
@ -21,29 +20,6 @@ describe('Admin API V2 key authentication', function () {
|
|||
});
|
||||
});
|
||||
|
||||
it('browse with correct GET endpoint token', function () {
|
||||
return request.get(localUtils.API.getApiQuery('posts/'))
|
||||
.set('Authorization', `Ghost ${localUtils.getValidAdminToken(localUtils.API.getApiQuery('posts/'))}`)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(403);
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: enable this suite once Admin API key auth is enabled
|
||||
describe.skip('Admin API V2 key authentication', function () {
|
||||
let request;
|
||||
|
||||
before(function () {
|
||||
return ghost()
|
||||
.then(function (_ghostServer) {
|
||||
request = supertest.agent(config.get('url'));
|
||||
})
|
||||
.then(function () {
|
||||
return testUtils.initFixtures('api_keys');
|
||||
});
|
||||
});
|
||||
|
||||
it('do not authenticate without token header', function () {
|
||||
return request.get(localUtils.API.getApiQuery('posts/'))
|
||||
.set('Authorization', `Ghost`)
|
||||
|
|
Loading…
Reference in a new issue