diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index 49a9e3525850b..ac65758319f1e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -194,49 +194,5 @@ private static void checkSystemIndexAccess( if (netNewSystemIndices.isEmpty() == false) { throw systemIndices.netNewSystemIndexAccessException(threadContext, netNewSystemIndices); } - checkSystemAliasAccess(request, systemIndices, systemIndexAccessLevel, threadContext); - } - - private static void checkSystemAliasAccess( - GetAliasesRequest request, - SystemIndices systemIndices, - SystemIndexAccessLevel systemIndexAccessLevel, - ThreadContext threadContext - ) { - final Predicate systemIndexAccessAllowPredicate; - if (systemIndexAccessLevel == SystemIndexAccessLevel.NONE) { - systemIndexAccessAllowPredicate = name -> true; - } else if (systemIndexAccessLevel == SystemIndexAccessLevel.RESTRICTED) { - systemIndexAccessAllowPredicate = systemIndices.getProductSystemIndexNamePredicate(threadContext).negate(); - } else { - throw new IllegalArgumentException("Unexpected system index access level: " + systemIndexAccessLevel); - } - - final List systemAliases = new ArrayList<>(); - final List netNewSystemAliases = new ArrayList<>(); - for (String alias : request.aliases()) { - if (systemIndices.isSystemName(alias)) { - if (systemIndexAccessAllowPredicate.test(alias)) { - if (systemIndices.isNetNewSystemIndex(alias)) { - netNewSystemAliases.add(alias); - } else { - systemAliases.add(alias); - } - } - } - } - - if (systemAliases.isEmpty() == false) { - deprecationLogger.warn( - DeprecationCategory.API, - "open_system_alias_access", - "this request accesses aliases with names reserved for system indices: {}, but in a future major version, direct " - + "access to system indices and their aliases will not be allowed", - systemAliases - ); - } - if (netNewSystemAliases.isEmpty() == false) { - throw systemIndices.netNewSystemIndexAccessException(threadContext, netNewSystemAliases); - } } } diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java index 9e537763943fb..b368ace8fcb3c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java @@ -241,40 +241,6 @@ public void testDeprecationWarningNotEmittedWhenOnlyNonsystemIndexRequested() { assertThat(result.get("c").size(), equalTo(1)); } - public void testDeprecationWarningEmittedWhenRequestingNonExistingAliasInSystemPattern() { - ClusterState state = systemIndexTestClusterState(); - SystemIndices systemIndices = new SystemIndices( - Collections.singletonMap( - this.getTestName(), - new SystemIndices.Feature( - this.getTestName(), - "test feature", - Collections.singletonList(new SystemIndexDescriptor(".y*", "an index that doesn't exist")) - ) - ) - ); - - GetAliasesRequest request = new GetAliasesRequest(".y"); - ImmutableOpenMap> aliases = ImmutableOpenMap.>builder().build(); - final String[] concreteIndices = {}; - assertEquals(state.metadata().findAliases(request, concreteIndices), aliases); - ImmutableOpenMap> result = TransportGetAliasesAction.postProcess( - request, - concreteIndices, - aliases, - state, - SystemIndexAccessLevel.NONE, - null, - systemIndices - ); - assertThat(result.size(), equalTo(0)); - assertWarnings( - Level.WARN, - "this request accesses aliases with names reserved for system indices: [.y], but in a future major version, direct" - + " access to system indices and their aliases will not be allowed" - ); - } - public void testPostProcessDataStreamAliases() { IndexNameExpressionResolver resolver = TestIndexNameExpressionResolver.newInstance(); List> tuples = Arrays.asList( diff --git a/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetDataStreamIT.java b/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetDataStreamIT.java index 5cf3034ea14c3..7989a330c515e 100644 --- a/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetDataStreamIT.java +++ b/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetDataStreamIT.java @@ -111,9 +111,7 @@ private void assertGetAliasAPIBehavesAsExpected(String regularIndex, String regu .setWarningsHandler( warnings -> org.elasticsearch.core.List.of( "this request accesses system indices: [.fleet-artifacts-7], but " - + "in a future major version, direct access to system indices will be prevented by default", - "this request accesses aliases with names reserved for system indices: [.fleet-artifacts], but in a future major " - + "version, direct access to system indices and their aliases will not be allowed" + + "in a future major version, direct access to system indices will be prevented by default" ).equals(warnings) == false ) .build();