@@ -22,13 +22,17 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
2222 private static final String ROLES_XFIELD = "roles" ;
2323 private static final String ROLE_MAPPING_XFIELD = "role_mapping" ;
2424 private static final String SSL_XFIELD = "ssl" ;
25+ private static final String TOKEN_SERVICE_XFIELD = "token_service" ;
26+ private static final String API_KEY_SERVICE_XFIELD = "api_key_service" ;
2527 private static final String AUDIT_XFIELD = "audit" ;
2628 private static final String IP_FILTER_XFIELD = "ipfilter" ;
2729 private static final String ANONYMOUS_XFIELD = "anonymous" ;
2830
2931 private Map <String , Object > realmsUsage ;
3032 private Map <String , Object > rolesStoreUsage ;
3133 private Map <String , Object > sslUsage ;
34+ private Map <String , Object > tokenServiceUsage ;
35+ private Map <String , Object > apiKeyServiceUsage ;
3236 private Map <String , Object > auditUsage ;
3337 private Map <String , Object > ipFilterUsage ;
3438 private Map <String , Object > anonymousUsage ;
@@ -39,6 +43,10 @@ public SecurityFeatureSetUsage(StreamInput in) throws IOException {
3943 realmsUsage = in .readMap ();
4044 rolesStoreUsage = in .readMap ();
4145 sslUsage = in .readMap ();
46+ if (in .getVersion ().onOrAfter (Version .V_7_1_0 )) {
47+ tokenServiceUsage = in .readMap ();
48+ apiKeyServiceUsage = in .readMap ();
49+ }
4250 auditUsage = in .readMap ();
4351 ipFilterUsage = in .readMap ();
4452 if (in .getVersion ().before (Version .V_6_0_0_beta1 )) {
@@ -52,12 +60,15 @@ public SecurityFeatureSetUsage(StreamInput in) throws IOException {
5260 public SecurityFeatureSetUsage (boolean available , boolean enabled , Map <String , Object > realmsUsage ,
5361 Map <String , Object > rolesStoreUsage , Map <String , Object > roleMappingStoreUsage ,
5462 Map <String , Object > sslUsage , Map <String , Object > auditUsage ,
55- Map <String , Object > ipFilterUsage , Map <String , Object > anonymousUsage ) {
63+ Map <String , Object > ipFilterUsage , Map <String , Object > anonymousUsage ,
64+ Map <String , Object > tokenServiceUsage , Map <String , Object > apiKeyServiceUsage ) {
5665 super (XPackField .SECURITY , available , enabled );
5766 this .realmsUsage = realmsUsage ;
5867 this .rolesStoreUsage = rolesStoreUsage ;
5968 this .roleMappingStoreUsage = roleMappingStoreUsage ;
6069 this .sslUsage = sslUsage ;
70+ this .tokenServiceUsage = tokenServiceUsage ;
71+ this .apiKeyServiceUsage = apiKeyServiceUsage ;
6172 this .auditUsage = auditUsage ;
6273 this .ipFilterUsage = ipFilterUsage ;
6374 this .anonymousUsage = anonymousUsage ;
@@ -69,6 +80,8 @@ public void writeTo(StreamOutput out) throws IOException {
6980 out .writeMap (realmsUsage );
7081 out .writeMap (rolesStoreUsage );
7182 out .writeMap (sslUsage );
83+ out .writeMap (tokenServiceUsage );
84+ out .writeMap (apiKeyServiceUsage );
7285 out .writeMap (auditUsage );
7386 out .writeMap (ipFilterUsage );
7487 if (out .getVersion ().before (Version .V_6_0_0_beta1 )) {
@@ -87,6 +100,8 @@ protected void innerXContent(XContentBuilder builder, Params params) throws IOEx
87100 builder .field (ROLES_XFIELD , rolesStoreUsage );
88101 builder .field (ROLE_MAPPING_XFIELD , roleMappingStoreUsage );
89102 builder .field (SSL_XFIELD , sslUsage );
103+ builder .field (TOKEN_SERVICE_XFIELD , tokenServiceUsage );
104+ builder .field (API_KEY_SERVICE_XFIELD , apiKeyServiceUsage );
90105 builder .field (AUDIT_XFIELD , auditUsage );
91106 builder .field (IP_FILTER_XFIELD , ipFilterUsage );
92107 builder .field (ANONYMOUS_XFIELD , anonymousUsage );
@@ -96,4 +111,5 @@ protected void innerXContent(XContentBuilder builder, Params params) throws IOEx
96111 public Map <String , Object > getRealmsUsage () {
97112 return Collections .unmodifiableMap (realmsUsage );
98113 }
114+
99115}
0 commit comments