Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ public String getFailureContext() {
}

public static String getFailureDescription(Collection<?> deniedIndices) {
if (deniedIndices.isEmpty()) {
return null;
}
return "on indices [" + Strings.collectionToCommaDelimitedString(deniedIndices) + "]";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,7 @@ public void testUnknownRoleCausesDenial() throws IOException {
assertThat(securityException, throwableWithMessage(containsString(
"[" + action + "] is unauthorized" +
" for user [test user]" +
" with roles [non-existent-role]" +
" on indices [")));
" with roles [non-existent-role],")));
assertThat(securityException, throwableWithMessage(containsString("this action is granted by the index privileges [read,all]")));

verify(auditTrail).accessDenied(eq(requestId), eq(authentication), eq(action), eq(request), authzInfoRoles(Role.EMPTY.names()));
Expand Down Expand Up @@ -721,8 +720,7 @@ public void testThatRoleWithNoIndicesIsDenied() throws IOException {
assertThat(securityException, throwableWithMessage(containsString(
"[" + action + "] is unauthorized" +
" for user [test user]" +
" with roles [no_indices]" +
" on indices [")));
" with roles [no_indices],")));
assertThat(securityException, throwableWithMessage(containsString("this action is granted by the index privileges [read,all]")));

verify(auditTrail).accessDenied(eq(requestId), eq(authentication), eq(action), eq(request),
Expand Down