Skip to content

Commit 0be2246

Browse files
committed
Fix more tests
1 parent 678256c commit 0be2246

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

docs/reference/rest-api/security/get-builtin-privileges.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ A successful call returns an object with "cluster", "index", and "remote_cluster
155155
"none",
156156
"read",
157157
"read_cross_cluster",
158+
"read_failures",
158159
"view_index_metadata",
159160
"write"
160161
],

x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/RemoteClusterSecurityFcActionAuthorizationIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,15 @@ public void testUpdateCrossClusterApiKey() throws Exception {
428428
ElasticsearchSecurityException.class,
429429
() -> executeRemote(remoteClusterClient, TransportFieldCapabilitiesAction.REMOTE_TYPE, request)
430430
);
431+
// TODO why did privilege order change?
431432
assertThat(
432433
e1.getMessage(),
433434
containsString(
434435
"action [indices:data/read/field_caps] towards remote cluster is unauthorized "
435436
+ "for user [foo] with assigned roles [role] authenticated by API key id ["
436437
+ apiKeyId
437438
+ "] of user [test_user] on indices [index], this action is granted by the index privileges "
438-
+ "[view_index_metadata,manage,read,all]"
439+
+ "[read,view_index_metadata,manage,all]"
439440
)
440441
);
441442

@@ -483,7 +484,7 @@ public void testUpdateCrossClusterApiKey() throws Exception {
483484
+ "for user [foo] with assigned roles [role] authenticated by API key id ["
484485
+ apiKeyId
485486
+ "] of user [test_user] on indices [index], this action is granted by the index privileges "
486-
+ "[view_index_metadata,manage,read,all]"
487+
+ "[read,view_index_metadata,manage,all]"
487488
)
488489
);
489490
}

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ public void testGetRoleDescriptorsForRemoteClusterForReservedRoles() {
17701770
IndicesPrivileges.builder().indices("*").privileges("all").allowRestrictedIndices(false).build(),
17711771
IndicesPrivileges.builder()
17721772
.indices("*")
1773-
.privileges("monitor", "read", "read_cross_cluster", "view_index_metadata")
1773+
.privileges("monitor", "read", "read_cross_cluster", "read_failures", "view_index_metadata")
17741774
.allowRestrictedIndices(true)
17751775
.build() },
17761776
null,

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/privileges/11_builtin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ setup:
1616
# I would much prefer we could just check that specific entries are in the array, but we don't have
1717
# an assertion for that
1818
- length: { "cluster" : 62 }
19-
- length: { "index" : 22 }
19+
- length: { "index" : 23 }

0 commit comments

Comments
 (0)