Skip to content

Commit

Permalink
Spotless Check and Adding one more test for coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Sam <samuel.costa@eliatra.com>
  • Loading branch information
samuelcostae committed Aug 16, 2023
1 parent 6d026f7 commit 0d64a48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private PrivilegesEvaluatorResponse evaluateNewSecuredIndicesAccess(
Boolean isDebugEnabled

) {
if (matchAnyDenyIndices(requestedResolved)){
if (matchAnyDenyIndices(requestedResolved)) {
auditLog.logSecurityIndexAttempt(request, action, task);
if (log.isInfoEnabled()) {
log.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ public void protectedActionLocalAll() {
verify(log).info("{} for '_all' indices is not allowed for a regular user", "indices:data/write");
}

@Test
public void protectedActionLocalAllWithNewAccessControl() {
setupEvaluatorWithSystemIndicesControl();
final Resolved resolved = Resolved._LOCAL_ALL;

// Action
evaluator.evaluate(request, task, PROTECTED_ACTION, resolved, presponse, securityRoles);
verify(log).isDebugEnabled();

verify(auditLog).logSecurityIndexAttempt(request, PROTECTED_ACTION, task);
assertThat(presponse.allowed, is(false));
verify(presponse).markComplete();
verify(presponse).isComplete();
verify(log).isDebugEnabled();
verify(log).info("{} for '_all' indices is not allowed for a regular user", "indices:data/write");
}
@Test
public void protectedActionSystemIndex() {
setupEvaluatorWithSystemIndicesControl();
Expand Down

0 comments on commit 0d64a48

Please sign in to comment.