Add transport ssl enabled value back to security usage (elastic/x-pack-elasticsearch#2695)
Since the transport ssl enabled setting is usable in 6.x again, this change adds back the value to the xpack security usage so that it can be included in phone home data. Original commit: elastic/x-pack-elasticsearch@52f6176df0
This commit is contained in:
parent
a9d7c232be
commit
f73d0c7a07
|
@ -32,6 +32,7 @@ import org.elasticsearch.xpack.security.user.AnonymousUser;
|
|||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static org.elasticsearch.xpack.XPackSettings.HTTP_SSL_ENABLED;
|
||||
import static org.elasticsearch.xpack.XPackSettings.TRANSPORT_SSL_ENABLED;
|
||||
|
||||
/**
|
||||
* Indicates whether the features of Security are currently in use
|
||||
|
@ -141,7 +142,10 @@ public class SecurityFeatureSet implements XPackFeatureSet {
|
|||
}
|
||||
|
||||
static Map<String, Object> sslUsage(Settings settings) {
|
||||
return singletonMap("http", singletonMap("enabled", HTTP_SSL_ENABLED.get(settings)));
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("http", singletonMap("enabled", HTTP_SSL_ENABLED.get(settings)));
|
||||
map.put("transport", singletonMap("enabled", TRANSPORT_SSL_ENABLED.get(settings)));
|
||||
return map;
|
||||
}
|
||||
|
||||
static Map<String, Object> auditUsage(Settings settings) {
|
||||
|
|
|
@ -97,6 +97,8 @@ public class SecurityFeatureSetTests extends ESTestCase {
|
|||
|
||||
final boolean httpSSLEnabled = randomBoolean();
|
||||
settings.put("xpack.security.http.ssl.enabled", httpSSLEnabled);
|
||||
final boolean transportSSLEnabled = randomBoolean();
|
||||
settings.put("xpack.security.transport.ssl.enabled", transportSSLEnabled);
|
||||
final boolean auditingEnabled = randomBoolean();
|
||||
settings.put(XPackSettings.AUDIT_ENABLED.getKey(), auditingEnabled);
|
||||
final String[] auditOutputs = randomFrom(
|
||||
|
@ -184,8 +186,9 @@ public class SecurityFeatureSetTests extends ESTestCase {
|
|||
assertThat(source.getValue("realms"), is(notNullValue()));
|
||||
}
|
||||
|
||||
// check http SSL
|
||||
// check SSL
|
||||
assertThat(source.getValue("ssl.http.enabled"), is(httpSSLEnabled));
|
||||
assertThat(source.getValue("ssl.transport.enabled"), is(transportSSLEnabled));
|
||||
|
||||
// auditing
|
||||
assertThat(source.getValue("audit.enabled"), is(auditingEnabled));
|
||||
|
|
Loading…
Reference in New Issue