@@ -27,6 +27,7 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
27
27
private static final String AUDIT_XFIELD = "audit" ;
28
28
private static final String IP_FILTER_XFIELD = "ipfilter" ;
29
29
private static final String ANONYMOUS_XFIELD = "anonymous" ;
30
+ private static final String FIPS_140_XFIELD = "fips_140" ;
30
31
31
32
private Map <String , Object > realmsUsage ;
32
33
private Map <String , Object > rolesStoreUsage ;
@@ -37,6 +38,7 @@ public class SecurityFeatureSetUsage extends XPackFeatureSet.Usage {
37
38
private Map <String , Object > ipFilterUsage ;
38
39
private Map <String , Object > anonymousUsage ;
39
40
private Map <String , Object > roleMappingStoreUsage ;
41
+ private Map <String , Object > fips140Usage ;
40
42
41
43
public SecurityFeatureSetUsage (StreamInput in ) throws IOException {
42
44
super (in );
@@ -51,13 +53,17 @@ public SecurityFeatureSetUsage(StreamInput in) throws IOException {
51
53
ipFilterUsage = in .readMap ();
52
54
anonymousUsage = in .readMap ();
53
55
roleMappingStoreUsage = in .readMap ();
56
+ if (in .getVersion ().onOrAfter (Version .V_7_5_0 )) {
57
+ fips140Usage = in .readMap ();
58
+ }
54
59
}
55
60
56
61
public SecurityFeatureSetUsage (boolean available , boolean enabled , Map <String , Object > realmsUsage ,
57
62
Map <String , Object > rolesStoreUsage , Map <String , Object > roleMappingStoreUsage ,
58
63
Map <String , Object > sslUsage , Map <String , Object > auditUsage ,
59
64
Map <String , Object > ipFilterUsage , Map <String , Object > anonymousUsage ,
60
- Map <String , Object > tokenServiceUsage , Map <String , Object > apiKeyServiceUsage ) {
65
+ Map <String , Object > tokenServiceUsage , Map <String , Object > apiKeyServiceUsage ,
66
+ Map <String , Object > fips140Usage ) {
61
67
super (XPackField .SECURITY , available , enabled );
62
68
this .realmsUsage = realmsUsage ;
63
69
this .rolesStoreUsage = rolesStoreUsage ;
@@ -68,6 +74,7 @@ public SecurityFeatureSetUsage(boolean available, boolean enabled, Map<String, O
68
74
this .auditUsage = auditUsage ;
69
75
this .ipFilterUsage = ipFilterUsage ;
70
76
this .anonymousUsage = anonymousUsage ;
77
+ this .fips140Usage = fips140Usage ;
71
78
}
72
79
73
80
@ Override
@@ -84,6 +91,9 @@ public void writeTo(StreamOutput out) throws IOException {
84
91
out .writeMap (ipFilterUsage );
85
92
out .writeMap (anonymousUsage );
86
93
out .writeMap (roleMappingStoreUsage );
94
+ if (out .getVersion ().onOrAfter (Version .V_7_5_0 )) {
95
+ out .writeMap (fips140Usage );
96
+ }
87
97
}
88
98
89
99
@ Override
@@ -99,6 +109,7 @@ protected void innerXContent(XContentBuilder builder, Params params) throws IOEx
99
109
builder .field (AUDIT_XFIELD , auditUsage );
100
110
builder .field (IP_FILTER_XFIELD , ipFilterUsage );
101
111
builder .field (ANONYMOUS_XFIELD , anonymousUsage );
112
+ builder .field (FIPS_140_XFIELD , fips140Usage );
102
113
} else if (sslUsage .isEmpty () == false ) {
103
114
// A trial (or basic) license can have SSL without security.
104
115
// This is because security defaults to disabled on that license, but that dynamic-default does not disable SSL.
0 commit comments