Skip to content

Commit

Permalink
WTF
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Apr 9, 2024
1 parent 435f79a commit 2f6cae4
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;

//TODO: add remote cluster tests here too (don't rely on NONE)
public class RoleDescriptorTests extends ESTestCase {

public void testIndexGroup() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ private void createRole(String name, Collection<String> clusterPrivileges, Strin
null,
new RoleDescriptor.RemoteIndicesPrivileges[] {
RoleDescriptor.RemoteIndicesPrivileges.builder(remoteIndicesClusterAliases).indices("*").privileges("read").build() },
null,
null, //TODO: add test here
null
);
getSecurityClient().putRole(role);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;

//TODO: add more tests here
public class CrossClusterAccessHeadersForCcsRestIT extends SecurityOnTrialLicenseRestTestCase {

private static final String CLUSTER_A = "my_remote_cluster_a";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;

//TODO: add the remote cluster analog here too
public class RoleWithRemoteIndicesPrivilegesRestIT extends SecurityOnTrialLicenseRestTestCase {

private static final String REMOTE_SEARCH_USER = "remote_search_user";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ && hasRemoteCluster(request.getRoleDescriptors())) {
return;
}

//TODO: test this !
final Set<RoleDescriptor> filteredUserRoleDescriptors = maybeRemoveRemotePrivileges(
userRoleDescriptors,
transportVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testGetRoleDescriptorsIntersectionForRemoteCluster() throws IOExcept
.build(),
randomNonEmptySubsetOf(List.of(concreteClusterAlias, "*")).toArray(new String[0])
) },
null, // TODO: maybe add tests here
null, // TODO: add tests here
null
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;

//TODO: more tests here
public class CompositeRolesStoreTests extends ESTestCase {

private static final Settings SECURITY_ENABLED_SETTINGS = Settings.builder().put(XPackSettings.SECURITY_ENABLED.getKey(), true).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ public void testUsageStats() throws Exception {
assertThat(usageStats.get("remote_indices"), is(1L));
assertThat(usageStats.get("fls"), is(flsDlsEnabled));
assertThat(usageStats.get("dls"), is(flsDlsEnabled));
//TODO: add more tests here
}

public void testExists() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void innerPutRole(final PutRoleRequest request, final RoleDescriptor role, final
null,
new RoleDescriptor.RemoteIndicesPrivileges[] {
RoleDescriptor.RemoteIndicesPrivileges.builder("remote").privileges("read").indices("index").build() },
null,
null, //TODO: more tests here
null
);
PlainActionFuture<Boolean> future = new PlainActionFuture<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private static RoleDescriptor randomRoleDescriptor(boolean includeRemoteIndices)
RoleDescriptorTests.randomRoleDescriptorMetadata(false),
Map.of(),
includeRemoteIndices ? RoleDescriptorTests.randomRemoteIndicesPrivileges(1, 3, excludedPrivileges) : null,
null, // TODO: probably add test here
null, // TODO: add tests here
null
);
}
Expand Down

0 comments on commit 2f6cae4

Please sign in to comment.