Skip to content

Commit

Permalink
order of needed permissions is changed on latest security version or …
Browse files Browse the repository at this point in the history
…at least not always consistent now

Signed-off-by: Amit Galitzky <[email protected]>
  • Loading branch information
amitgalitz committed Nov 15, 2024
1 parent f56e8fc commit f9b833c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/java/org/opensearch/ad/rest/SecureADRestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,13 @@ public void testCreateAnomalyDetectorWithCustomResultIndex() throws IOException
AnomalyDetector detector = cloneDetector(anomalyDetector, resultIndex);
// User goat has no permission to create index
Exception exception = expectThrows(IOException.class, () -> { createAnomalyDetector(detector, true, goatClient); });
System.out.println("error message: " + exception.getMessage());
Assert
.assertTrue(
"got " + exception.getMessage(),
exception.getMessage().contains("no permissions for [indices:admin/aliases, indices:admin/create]")
exception.getMessage().contains("indices:admin/aliases")
&& exception.getMessage().contains("indices:admin/create")
&& exception.getMessage().contains("no permissions for")
);

// User cat has permission to create index
Expand Down

0 comments on commit f9b833c

Please sign in to comment.