Skip to content

Commit

Permalink
small bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: Sam <[email protected]>
  • Loading branch information
samuelcostae committed Sep 20, 2023
1 parent 81cbbc0 commit 82708fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/opensearch/security/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,14 @@ public void includeAccountsIfType(SecurityDynamicConfiguration<?> configuration,
List<String> toBeRemoved = new ArrayList<>();

if (requestedAccountType == UserFilterType.SERVICE) {
accountToRemoveFromConfig(configuration, toBeRemoved, false);
accountsToRemoveFromConfiguration(configuration, toBeRemoved, false);
} else if (requestedAccountType == UserFilterType.INTERNAL) {
accountToRemoveFromConfig(configuration, toBeRemoved, true);
accountsToRemoveFromConfiguration(configuration, toBeRemoved, true);
}
configuration.remove(toBeRemoved);
}

private void accountsToRemoveFromConfiguration(SecurityDynamicConfiguration<?> configuration, ArrayList<String> toBeRemoved, boolean isServiceAccountRequested) {
private void accountsToRemoveFromConfiguration(SecurityDynamicConfiguration<?> configuration, List<String> toBeRemoved, boolean isServiceAccountRequested) {
for (Map.Entry<String, ?> entry : configuration.getCEntries().entrySet()) {
final InternalUserV7 internalUserEntry = (InternalUserV7) entry.getValue();
final Map accountAttributes = internalUserEntry.getAttributes();
Expand Down

0 comments on commit 82708fd

Please sign in to comment.