Skip to content

Commit

Permalink
Addesed last 2 comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Pleskach <[email protected]>
  • Loading branch information
willyborankin committed Oct 4, 2023
1 parent ef0a327 commit 8281a1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ boolean accessHandler(final RestRequest request) {
switch (request.method()) {
case PATCH:
case PUT:
if (!allowPutOrPatch && !restApiAdminEnabled) {
return false;
} else if (allowPutOrPatch && !restApiAdminEnabled) {
return true;
if (!restApiAdminEnabled) {
return allowPutOrPatch;

Check warning on line 90 in src/main/java/org/opensearch/security/dlic/rest/api/SecurityConfigApiAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/security/dlic/rest/api/SecurityConfigApiAction.java#L90

Added line #L90 was not covered by tests
} else {
return securityApiDependencies.restApiAdminPrivilegesEvaluator()
.isCurrentUserAdminFor(endpoint, SECURITY_CONFIG_UPDATE);

Check warning on line 93 in src/main/java/org/opensearch/security/dlic/rest/api/SecurityConfigApiAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/security/dlic/rest/api/SecurityConfigApiAction.java#L92-L93

Added lines #L92 - L93 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void hasExplicitClusterPermissionPermissionForRestAdminWitFullAccess() {

@Test
public void hasExplicitClusterPermissionPermissionForRestAdmin() {
// verify all endpoint except SSL
// verify all endpoint except SSL and verify CONFIG endpoints
final Collection<Endpoint> noSslEndpoints = ENDPOINTS_WITH_PERMISSIONS.keySet()
.stream()
.filter(e -> e != Endpoint.SSL && e != Endpoint.CONFIG)
Expand Down

0 comments on commit 8281a1b

Please sign in to comment.