[statusPage] Rename config option

This commit is contained in:
Lukas Olson 2016-05-10 11:35:02 -07:00
parent 04b26937ad
commit db971f4f4f
4 changed files with 6 additions and 6 deletions

View file

@ -124,7 +124,7 @@ module.exports = () => Joi.object({
}).default(),
statusPage: Joi.object({
disableAuth: Joi.boolean().default(false)
allowAnonymous: Joi.boolean().default(false)
}).default()
}).default();

View file

@ -26,13 +26,13 @@ describe('Status wrapAuthConfig', () => {
expect(wrapped).to.not.have.property('config');
});
it('should not add auth config if disableAuth is false', () => {
it('should not add auth config if allowAnonymous is false', () => {
const wrapAuth = wrapAuthConfig(false);
const wrapped = wrapAuth(options);
expect(wrapped).to.not.have.property('config');
});
it('should add auth config if disableAuth is true', () => {
it('should add auth config if allowAnonymous is true', () => {
const wrapAuth = wrapAuthConfig(true);
const wrapped = wrapAuth(options);
expect(wrapped).to.have.property('config');

View file

@ -11,7 +11,7 @@ module.exports = function (kbnServer, server, config) {
kbnServer.mixin(require('./metrics'));
}
const wrapAuth = wrapAuthConfig(config.get('statusPage.disableAuth'));
const wrapAuth = wrapAuthConfig(config.get('statusPage.allowAnonymous'));
server.route(wrapAuth({
method: 'GET',

View file

@ -1,6 +1,6 @@
import {assign, identity} from 'lodash';
export default (disableAuth) => {
if (disableAuth) return options => assign(options, {config: {auth: false}});
export default (allowAnonymous) => {
if (allowAnonymous) return options => assign(options, {config: {auth: false}});
return identity;
};