Skip to content

Commit

Permalink
IGNITE-21832 Remove permissions check to obtain cluster tag and id vi…
Browse files Browse the repository at this point in the history
…a Control Utility (apache#11287)
  • Loading branch information
Nastya828 authored Mar 27, 2024
1 parent 4365f71 commit 9285414
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteEx;
Expand Down Expand Up @@ -82,6 +83,25 @@ public static List<String> commandHandlers() {
stopAllGrids();
}

/** */
@Test
public void testClusterTag() throws Exception {
Ignite ignite = startGrid(0, userData(TEST_NO_PERMISSIONS_LOGIN, NO_PERMISSIONS));

assertEquals(
EXIT_CODE_OK,
execute(enrichWithConnectionArguments(Collections.singleton("--state"), TEST_NO_PERMISSIONS_LOGIN))
);

String out = testOut.toString();

UUID clId = ignite.cluster().id();
String clTag = ignite.cluster().tag();

assertTrue(out.contains("Cluster ID: " + clId));
assertTrue(out.contains("Cluster tag: " + clTag));
}

/** */
@Test
public void testCacheScan() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
import org.apache.ignite.internal.processors.task.GridInternal;
import org.apache.ignite.internal.visor.VisorJob;
import org.apache.ignite.internal.visor.VisorOneNodeTask;
import org.apache.ignite.plugin.security.SecurityPermissionSet;
import org.jetbrains.annotations.Nullable;

import static org.apache.ignite.plugin.security.SecurityPermissionSetBuilder.NO_PERMISSIONS;

/**
*
*/
Expand Down Expand Up @@ -63,5 +66,10 @@ private VisorIdAndTagViewTaskResult view() {

return new VisorIdAndTagViewTaskResult(cl.id(), cl.tag());
}

/** {@inheritDoc} */
@Override public SecurityPermissionSet requiredPermissions() {
return NO_PERMISSIONS;
}
}
}

0 comments on commit 9285414

Please sign in to comment.