2019-08-09 17:25:12 +03:00
|
|
|
const should = require('should');
|
2020-03-30 18:26:47 +03:00
|
|
|
const middleware = require('../../../../../../core/server/web/api/canary/content/middleware');
|
2019-08-09 17:25:12 +03:00
|
|
|
|
|
|
|
describe('Content Api canary middleware', function () {
|
|
|
|
it('exports an authenticatePublic middleware', function () {
|
|
|
|
should.exist(middleware.authenticatePublic);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('authenticatePublic', function () {
|
|
|
|
it('uses brute content api middleware as the first middleware in the chain', function () {
|
|
|
|
const firstMiddleware = middleware.authenticatePublic[0];
|
2020-03-30 18:26:47 +03:00
|
|
|
const brute = require('../../../../../../core/server/web/shared/middlewares/brute');
|
2019-08-09 17:25:12 +03:00
|
|
|
|
|
|
|
should.equal(firstMiddleware, brute.contentApiKey);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|