DOCS: Add SecurityExtension breaking change (#35358)

We changed the way realm settings are defined, and this affects custom
realms in SecurityExtensions. This change adds those details to the
breaking changes docs.

Relates: #30241
This commit is contained in:
Tim Vernum 2018-11-09 16:57:49 +11:00 committed by GitHub
parent 02b4e28534
commit b0acd709d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -43,3 +43,24 @@ Elasticsearch and requires no plugin. The location of the hosts file has moved
from `$ES_PATH_CONF/file-discovery/unicast_hosts.txt` to
`$ES_PATH_CONF/unicast_hosts.txt`. See <<file-based-hosts-provider, the
file-based hosts provider documentation>> for further information.
[float]
==== Security Extensions
As a consequence of the <<include-realm-type-in-setting, change to Realm settings>>,
the `getRealmSettings` method has been removed from the `SecurityExtension` class,
and the `settings` method on `RealmConfig` now returns the node's (global) settings.
Custom security extensions should register their settings by implementing the standard
`Plugin.getSettings` method, and can retrieve them from `RealmConfig.settings()` or
using one of the `RealmConfig.getSetting` methods.
Each realm setting should be defined as an `AffixSetting` as shown in the example below:
[source,java]
--------------------------------------------------
Setting.AffixSetting<String> MY_SETTING = Setting.affixKeySetting(
"xpack.security.authc.realms." + MY_REALM_TYPE + ".", "my_setting",
key -> Setting.simpleString(key, properties)
);
--------------------------------------------------
The `RealmSettings.simpleString` method can be used as a convenience for the above.