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,7 +679,7 @@ public void testUnknownRoleCausesDenial() throws IOException {
ElasticsearchSecurityException securityException = expectThrows(ElasticsearchSecurityException.class,
() -> authorize(authentication, action, request));
assertThat(securityException,
throwableWithMessage(containsString("[" + action + "] is unauthorized for user [test user] on indices [")));
throwableWithMessage(containsString("[" + action + "] is unauthorized for user [test user],")));
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 @@ -718,7 +718,7 @@ public void testThatRoleWithNoIndicesIsDenied() throws IOException {
ElasticsearchSecurityException securityException = expectThrows(ElasticsearchSecurityException.class,
() -> authorize(authentication, action, request));
assertThat(securityException,
throwableWithMessage(containsString("[" + action + "] is unauthorized for user [test user] on indices [")));
throwableWithMessage(containsString("[" + action + "] is unauthorized for user [test user],")));
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