|
@@ -22,6 +22,8 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
private static final String ROLES_XFIELD = "roles";
|
|
|
private static final String ROLE_MAPPING_XFIELD = "role_mapping";
|
|
|
private static final String SSL_XFIELD = "ssl";
|
|
|
+ private static final String TOKEN_SERVICE_XFIELD = "token_service";
|
|
|
+ private static final String API_KEY_SERVICE_XFIELD = "api_key_service";
|
|
|
private static final String AUDIT_XFIELD = "audit";
|
|
|
private static final String IP_FILTER_XFIELD = "ipfilter";
|
|
|
private static final String ANONYMOUS_XFIELD = "anonymous";
|
|
@@ -29,6 +31,8 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
private Map<String, Object> realmsUsage;
|
|
|
private Map<String, Object> rolesStoreUsage;
|
|
|
private Map<String, Object> sslUsage;
|
|
|
+ private Map<String, Object> tokenServiceUsage;
|
|
|
+ private Map<String, Object> apiKeyServiceUsage;
|
|
|
private Map<String, Object> auditUsage;
|
|
|
private Map<String, Object> ipFilterUsage;
|
|
|
private Map<String, Object> anonymousUsage;
|
|
@@ -39,6 +43,10 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
realmsUsage = in.readMap();
|
|
|
rolesStoreUsage = in.readMap();
|
|
|
sslUsage = in.readMap();
|
|
|
+ if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO change the version to V_7_1_0 on backporting
|
|
|
+ tokenServiceUsage = in.readMap();
|
|
|
+ apiKeyServiceUsage = in.readMap();
|
|
|
+ }
|
|
|
auditUsage = in.readMap();
|
|
|
ipFilterUsage = in.readMap();
|
|
|
if (in.getVersion().before(Version.V_6_0_0_beta1)) {
|
|
@@ -52,12 +60,15 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
public SecurityFeatureSetUsage(boolean available, boolean enabled, Map<String, Object> realmsUsage,
|
|
|
Map<String, Object> rolesStoreUsage, Map<String, Object> roleMappingStoreUsage,
|
|
|
Map<String, Object> sslUsage, Map<String, Object> auditUsage,
|
|
|
- Map<String, Object> ipFilterUsage, Map<String, Object> anonymousUsage) {
|
|
|
+ Map<String, Object> ipFilterUsage, Map<String, Object> anonymousUsage,
|
|
|
+ Map<String, Object> tokenServiceUsage, Map<String, Object> apiKeyServiceUsage) {
|
|
|
super(XPackField.SECURITY, available, enabled);
|
|
|
this.realmsUsage = realmsUsage;
|
|
|
this.rolesStoreUsage = rolesStoreUsage;
|
|
|
this.roleMappingStoreUsage = roleMappingStoreUsage;
|
|
|
this.sslUsage = sslUsage;
|
|
|
+ this.tokenServiceUsage = tokenServiceUsage;
|
|
|
+ this.apiKeyServiceUsage = apiKeyServiceUsage;
|
|
|
this.auditUsage = auditUsage;
|
|
|
this.ipFilterUsage = ipFilterUsage;
|
|
|
this.anonymousUsage = anonymousUsage;
|
|
@@ -69,6 +80,8 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
out.writeMap(realmsUsage);
|
|
|
out.writeMap(rolesStoreUsage);
|
|
|
out.writeMap(sslUsage);
|
|
|
+ out.writeMap(tokenServiceUsage);
|
|
|
+ out.writeMap(apiKeyServiceUsage);
|
|
|
out.writeMap(auditUsage);
|
|
|
out.writeMap(ipFilterUsage);
|
|
|
if (out.getVersion().before(Version.V_6_0_0_beta1)) {
|
|
@@ -87,6 +100,8 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
builder.field(ROLES_XFIELD, rolesStoreUsage);
|
|
|
builder.field(ROLE_MAPPING_XFIELD, roleMappingStoreUsage);
|
|
|
builder.field(SSL_XFIELD, sslUsage);
|
|
|
+ builder.field(TOKEN_SERVICE_XFIELD, tokenServiceUsage);
|
|
|
+ builder.field(API_KEY_SERVICE_XFIELD, apiKeyServiceUsage);
|
|
|
builder.field(AUDIT_XFIELD, auditUsage);
|
|
|
builder.field(IP_FILTER_XFIELD, ipFilterUsage);
|
|
|
builder.field(ANONYMOUS_XFIELD, anonymousUsage);
|
|
@@ -96,4 +111,5 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
|
|
|
public Map<String, Object> getRealmsUsage() {
|
|
|
return Collections.unmodifiableMap(realmsUsage);
|
|
|
}
|
|
|
+
|
|
|
}
|