[statusPage] Rename config option
This commit is contained in:
parent
04b26937ad
commit
db971f4f4f
|
@ -124,7 +124,7 @@ module.exports = () => Joi.object({
|
|||
}).default(),
|
||||
|
||||
statusPage: Joi.object({
|
||||
disableAuth: Joi.boolean().default(false)
|
||||
allowAnonymous: Joi.boolean().default(false)
|
||||
}).default()
|
||||
|
||||
}).default();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue