Skip to content

Commit 0a89f0b

Browse files
committed
Merge branch 'master' into reporting/5.0/encrypt-headers
Original commit: elastic/x-pack-elasticsearch@38c755c
2 parents 6d48cd5 + 2257cc7 commit 0a89f0b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/permission/IngestAdminRole.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.elasticsearch.xpack.security.authz.RoleDescriptor;
99
import org.elasticsearch.xpack.security.authz.privilege.ClusterPrivilege;
1010
import org.elasticsearch.xpack.security.authz.privilege.Privilege.Name;
11+
import org.elasticsearch.xpack.security.support.MetadataUtils;
1112

1213
/**
1314
* Role for users that should be allowed to use the Add Data/Ingest features in the UI
@@ -18,7 +19,8 @@ public class IngestAdminRole extends Role {
1819
private static final RoleDescriptor.IndicesPrivileges[] INDICES_PRIVILEGES = new RoleDescriptor.IndicesPrivileges[0];
1920

2021
public static final String NAME = "ingest_admin";
21-
public static final RoleDescriptor DESCRIPTOR = new RoleDescriptor(NAME, CLUSTER_PRIVILEGES, INDICES_PRIVILEGES, null);
22+
public static final RoleDescriptor DESCRIPTOR =
23+
new RoleDescriptor(NAME, CLUSTER_PRIVILEGES, INDICES_PRIVILEGES, null, MetadataUtils.DEFAULT_RESERVED_METADATA);
2224
public static final IngestAdminRole INSTANCE = new IngestAdminRole();
2325

2426
private IngestAdminRole() {

elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/IngestAdminRoleTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction;
2121
import org.elasticsearch.xpack.security.authc.Authentication;
2222

23+
import static org.hamcrest.Matchers.hasEntry;
2324
import static org.hamcrest.Matchers.is;
2425
import static org.mockito.Mockito.mock;
2526

@@ -48,4 +49,8 @@ public void testNoIndicesPermissions() {
4849
assertThat(IngestAdminRole.INSTANCE.indices().allowedIndicesMatcher(GetAction.NAME).test(randomAsciiOfLengthBetween(8, 24)),
4950
is(false));
5051
}
52+
53+
public void testHasReservedMetadata() {
54+
assertThat(IngestAdminRole.DESCRIPTOR.getMetadata(), hasEntry("_reserved", true));
55+
}
5156
}

0 commit comments

Comments
 (0)