Skip to content

Commit 528bf5b

Browse files
committed
Merge branch 'failure-store-authz-messages' of github.com:n1v0lg/elasticsearch into failure-store-authz-messages
2 parents 5e75b5a + 6c3f7d0 commit 528bf5b

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

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

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,15 @@ public void testUnknownRoleCausesDenial() {
10011001
)
10021002
)
10031003
);
1004-
assertThat(securityException, throwableWithMessage(containsString("this action is granted by the index privileges [read,all]")));
1004+
assertThat(
1005+
securityException,
1006+
throwableWithMessage(
1007+
containsString(
1008+
"this action is granted by the index privileges [read,all] for data access"
1009+
+ ", or [read_failure_store,all] for access via the failures selector"
1010+
)
1011+
)
1012+
);
10051013

10061014
verify(auditTrail).accessDenied(eq(requestId), eq(authentication), eq(action), eq(request), authzInfoRoles(Role.EMPTY.names()));
10071015
verifyNoMoreInteractions(auditTrail);
@@ -1047,7 +1055,15 @@ public void testServiceAccountDenial() {
10471055
throwableWithMessage(containsString("[" + action + "] is unauthorized for service account [" + serviceUser.principal() + "]"))
10481056
);
10491057
verify(auditTrail).accessDenied(eq(requestId), eq(authentication), eq(action), eq(request), authzInfoRoles(role.names()));
1050-
assertThat(securityException, throwableWithMessage(containsString("this action is granted by the index privileges [read,all]")));
1058+
assertThat(
1059+
securityException,
1060+
throwableWithMessage(
1061+
containsString(
1062+
"this action is granted by the index privileges [read,all] for data access"
1063+
+ ", or [read_failure_store,all] for access via the failures selector"
1064+
)
1065+
)
1066+
);
10511067
verifyNoMoreInteractions(auditTrail);
10521068
}
10531069

@@ -1097,7 +1113,15 @@ public void testThatRoleWithNoIndicesIsDenied() {
10971113
containsString("[" + action + "] is unauthorized" + " for user [test user]" + " with effective roles [no_indices]")
10981114
)
10991115
);
1100-
assertThat(securityException, throwableWithMessage(containsString("this action is granted by the index privileges [read,all]")));
1116+
assertThat(
1117+
securityException,
1118+
throwableWithMessage(
1119+
containsString(
1120+
"this action is granted by the index privileges [read,all] for data access"
1121+
+ ", or [read_failure_store,all] for access via the failures selector"
1122+
)
1123+
)
1124+
);
11011125

11021126
verify(auditTrail).accessDenied(
11031127
eq(requestId),

0 commit comments

Comments
 (0)