Skip to content

Commit 56a7989

Browse files
committed
Remove feature flag from xpack main code
1 parent 8222e76 commit 56a7989

File tree

6 files changed

+25
-33
lines changed

6 files changed

+25
-33
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ protected void innerXContent(XContentBuilder builder, Params params) throws IOEx
5050
super.innerXContent(builder, params);
5151
builder.field("data_streams", streamStats.totalDataStreamCount);
5252
builder.field("indices_count", streamStats.indicesBehindDataStream);
53-
if (DataStream.isFailureStoreFeatureFlagEnabled()) {
54-
builder.startObject("failure_store");
55-
builder.field("explicitly_enabled_count", streamStats.failureStoreExplicitlyEnabledDataStreamCount);
56-
builder.field("effectively_enabled_count", streamStats.failureStoreEffectivelyEnabledDataStreamCount);
57-
builder.field("failure_indices_count", streamStats.failureStoreIndicesCount);
58-
builder.endObject();
59-
}
53+
builder.startObject("failure_store");
54+
builder.field("explicitly_enabled_count", streamStats.failureStoreExplicitlyEnabledDataStreamCount);
55+
builder.field("effectively_enabled_count", streamStats.failureStoreEffectivelyEnabledDataStreamCount);
56+
builder.field("failure_indices_count", streamStats.failureStoreIndicesCount);
57+
builder.endObject();
6058
}
6159

6260
@Override

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/RoleDescriptorRequestValidator.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ public static ActionRequestValidationException validate(
5555
} catch (IllegalArgumentException ile) {
5656
validationException = addValidationError(ile.getMessage(), validationException);
5757
}
58-
if (DataStream.isFailureStoreFeatureFlagEnabled()) {
59-
for (final String indexName : idp.getIndices()) {
60-
validationException = validateIndexNameExpression(indexName, validationException);
61-
}
58+
for (final String indexName : idp.getIndices()) {
59+
validationException = validateIndexNameExpression(indexName, validationException);
6260
}
6361
}
6462
}
@@ -78,10 +76,8 @@ public static ActionRequestValidationException validate(
7876
} catch (IllegalArgumentException ile) {
7977
validationException = addValidationError(ile.getMessage(), validationException);
8078
}
81-
if (DataStream.isFailureStoreFeatureFlagEnabled()) {
82-
for (String indexName : ridp.indicesPrivileges().getIndices()) {
83-
validationException = validateIndexNameExpression(indexName, validationException);
84-
}
79+
for (String indexName : ridp.indicesPrivileges().getIndices()) {
80+
validationException = validateIndexNameExpression(indexName, validationException);
8581
}
8682
}
8783
if (roleDescriptor.hasRemoteClusterPermissions()) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/AuthorizationEngine.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,15 @@ public ActionRequestValidationException validate(ActionRequestValidationExceptio
348348
validationException
349349
);
350350
}
351-
if (DataStream.isFailureStoreFeatureFlagEnabled()) {
352-
// best effort prevent users from attempting to use selectors in privilege check
353-
for (String indexPattern : indicesPrivileges.getIndices()) {
354-
if (IndexNameExpressionResolver.hasSelector(indexPattern, IndexComponentSelector.FAILURES)
355-
|| IndexNameExpressionResolver.hasSelector(indexPattern, IndexComponentSelector.DATA)) {
356-
validationException = addValidationError(
357-
"may only check index privileges without selectors in index patterns [" + indexPattern + "]",
358-
validationException
359-
);
360-
break;
361-
}
351+
// best effort prevent users from attempting to use selectors in privilege check
352+
for (String indexPattern : indicesPrivileges.getIndices()) {
353+
if (IndexNameExpressionResolver.hasSelector(indexPattern, IndexComponentSelector.FAILURES)
354+
|| IndexNameExpressionResolver.hasSelector(indexPattern, IndexComponentSelector.DATA)) {
355+
validationException = addValidationError(
356+
"may only check index privileges without selectors in index patterns [" + indexPattern + "]",
357+
validationException
358+
);
359+
break;
362360
}
363361
}
364362
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ public final class IndexPrivilege extends Privilege {
239239
private static final Map<String, IndexPrivilege> VALUES = combineSortedInOrder(
240240
sortByAccessLevel(
241241
Stream.of(
242-
DataStream.isFailureStoreFeatureFlagEnabled() ? entry("read_failure_store", READ_FAILURE_STORE) : null,
243-
DataStream.isFailureStoreFeatureFlagEnabled() ? entry("manage_failure_store", MANAGE_FAILURE_STORE) : null
244-
).filter(Objects::nonNull).collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue))
242+
entry("read_failure_store", READ_FAILURE_STORE),
243+
entry("manage_failure_store", MANAGE_FAILURE_STORE)
244+
).collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue))
245245
),
246246
sortByAccessLevel(
247247
Stream.of(

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/InternalUsers.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public class InternalUsers {
161161
.privileges(
162162
filterNonNull(
163163
// needed to rollover failure store
164-
DataStream.isFailureStoreFeatureFlagEnabled() ? "manage_failure_store" : null,
164+
"manage_failure_store",
165165
"delete_index",
166166
RolloverAction.NAME,
167167
ForceMergeAction.NAME + "*",
@@ -184,7 +184,7 @@ public class InternalUsers {
184184
.privileges(
185185
filterNonNull(
186186
// needed to rollover failure store
187-
DataStream.isFailureStoreFeatureFlagEnabled() ? "manage_failure_store" : null,
187+
"manage_failure_store",
188188
"delete_index",
189189
RolloverAction.NAME,
190190
ForceMergeAction.NAME + "*",
@@ -262,7 +262,7 @@ public class InternalUsers {
262262
.privileges(
263263
filterNonNull(
264264
// needed to rollover failure store
265-
DataStream.isFailureStoreFeatureFlagEnabled() ? "manage_failure_store" : null,
265+
"manage_failure_store",
266266
LazyRolloverAction.NAME
267267
)
268268
)

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ public enum Cap {
948948
/**
949949
* Index component selector syntax (my-data-stream-name::failures)
950950
*/
951-
INDEX_COMPONENT_SELECTORS(DataStream.isFailureStoreFeatureFlagEnabled()),
951+
INDEX_COMPONENT_SELECTORS,
952952

953953
/**
954954
* Make numberOfChannels consistent with layout in DefaultLayout by removing duplicated ChannelSet.

0 commit comments

Comments
 (0)