Skip to content

Commit

Permalink
Add server.xsrf.token as a deprecated config. Closes #5635.
Browse files Browse the repository at this point in the history
Fixes #5641
  • Loading branch information
jbudz committed Dec 11, 2015
1 parent f44b822 commit d617fc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cli/serve/read_yaml_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};

Expand All @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module.exports = () => Joi.object({
}),
xsrf: Joi.object({
disableProtection: Joi.boolean().default(false),
token: Joi.string().optional().notes('Deprecated')
}).default(),
}).default(),

Expand Down

0 comments on commit d617fc6

Please sign in to comment.