Add server.xsrf.token as a deprecated config. Closes #5635.

Fixes #5641
This commit is contained in:
Jonathan Budzenski 2015-12-10 16:25:37 -06:00 committed by Jon Budzenski
parent 8d8b7dd21b
commit a06807f94c
2 changed files with 9 additions and 0 deletions

View file

@ -35,6 +35,10 @@ let legacySettingMap = {
verify_ssl: 'elasticsearch.ssl.verify',
};
const deprecatedSettings = {
'server.xsrf.token': 'server.xsrf.token is deprecated. It is no longer used when providing xsrf protection.'
};
module.exports = function (path) {
if (!path) return {};
@ -50,6 +54,10 @@ module.exports = function (path) {
}
}
_.each(deprecatedSettings, function (message, setting) {
if (_.get(file, setting)) console.error(message);
});
// transform legeacy options into new namespaced versions
return _.transform(file, function (config, val, key) {
if (legacySettingMap.hasOwnProperty(key)) {

View file

@ -44,6 +44,7 @@ module.exports = () => Joi.object({
}),
xsrf: Joi.object({
disableProtection: Joi.boolean().default(false),
token: Joi.string().optional().notes('Deprecated')
}).default(),
}).default(),