Skip to content

Commit

Permalink
Minor fix of some formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Oct 27, 2023
1 parent 1a1a0bf commit 35fa44c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public PrivilegesEvaluatorResponse evaluate(
if (serviceAccountUser) {
presponse.missingPrivileges.add(action0);
presponse.allowed = false;
log.info("{} is a service account which as no access to cluster level permission of {}.", user, action0);
log.info("{} is a service account which has no access to cluster level permission of {}.", user, action0);
return presponse;
}

Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/opensearch/security/IntegrationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1074,4 +1074,16 @@ public void testMonitorHealth() throws Exception {
RestHelper rh = nonSslRestHelper();
Assert.assertEquals(HttpStatus.SC_OK, rh.executeGetRequest("_cat/health", encodeBasicHeader("picard", "picard")).getStatusCode());
}

// TODO: SOMETHING LIKE THIS
@Test
public void testServiceAccountClusterPermissions() throws Exception {

setup();

RestHelper rh = nonSslRestHelper();
HttpResponse response = rh.executeGetRequest("_cat/health", encodeBasicHeader("bug.99", "nagilum"));
System.out.println("The service account cluster perm response is: " + response.toString());
Assert.assertEquals(HttpStatus.SC_FORBIDDEN, response.getStatusCode());
}
}
2 changes: 1 addition & 1 deletion src/test/resources/internal_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bug.88:
hash: "$2a$12$n5nubfWATfQjSYHiWtUyeOxMIxFInUHOAx8VMmGmxFNPGpaBmeB.m"
reserved: false
hidden: false
backend_roles: [ ]
backend_roles: []
attributes: {}
description: "Migrated from v6"
bug.99:
Expand Down

0 comments on commit 35fa44c

Please sign in to comment.