|
@@ -1096,6 +1096,18 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
assertNoAccessAllowed(role, ".data-frame-internal-1"); // internal use only
|
|
|
|
|
|
assertNoAccessAllowed(role, RestrictedIndicesNames.RESTRICTED_NAMES);
|
|
|
+
|
|
|
+ final String kibanaApplicationWithRandomIndex = "kibana-" + randomFrom(randomAlphaOfLengthBetween(8, 24), ".kibana");
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-foo", "foo"), "*"), is(false));
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-reserved_ml", "reserved_ml"), "*"), is(true));
|
|
|
+
|
|
|
+ final String otherApplication = "logstash-" + randomAlphaOfLengthBetween(8, 24);
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(otherApplication, "app-foo", "foo"), "*"), is(false));
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(otherApplication, "app-reserved_ml", "reserved_ml"), "*"), is(false));
|
|
|
}
|
|
|
|
|
|
public void testDataFrameTransformsUserRole() {
|
|
@@ -1120,6 +1132,18 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
assertNoAccessAllowed(role, ".data-frame-internal-1");
|
|
|
|
|
|
assertNoAccessAllowed(role, RestrictedIndicesNames.RESTRICTED_NAMES);
|
|
|
+
|
|
|
+ final String kibanaApplicationWithRandomIndex = "kibana-" + randomFrom(randomAlphaOfLengthBetween(8, 24), ".kibana");
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-foo", "foo"), "*"), is(false));
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-reserved_ml", "reserved_ml"), "*"), is(true));
|
|
|
+
|
|
|
+ final String otherApplication = "logstash-" + randomAlphaOfLengthBetween(8, 24);
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(otherApplication, "app-foo", "foo"), "*"), is(false));
|
|
|
+ assertThat(role.application().grants(
|
|
|
+ new ApplicationPrivilege(otherApplication, "app-reserved_ml", "reserved_ml"), "*"), is(false));
|
|
|
}
|
|
|
|
|
|
public void testWatcherAdminRole() {
|