Skip to content

Commit

Permalink
#8615 fix DeleteUserSubCommand command failed when acl2.0 authenticat…
Browse files Browse the repository at this point in the history
…ion enabled
  • Loading branch information
kingkh1995 committed Aug 30, 2024
1 parent 720c87e commit f0d1aff
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ public CompletableFuture<Void> deleteUser(String username) {
throw new AuthenticationException("username can not be blank");
}
CompletableFuture<Void> deleteUser = this.getAuthenticationMetadataProvider().deleteUser(username);
CompletableFuture<Void> deleteAcl = this.getAuthorizationMetadataProvider().deleteAcl(User.of(username));
CompletableFuture<Void> deleteAcl = CompletableFuture.completedFuture(null);
if (this.getAuthorizationMetadataProvider() != null) {
deleteAcl = this.getAuthorizationMetadataProvider().deleteAcl(User.of(username));
}
return CompletableFuture.allOf(deleteUser, deleteAcl);
} catch (Exception e) {
this.handleException(e, result);
Expand Down Expand Up @@ -214,9 +217,6 @@ private AuthenticationMetadataProvider getAuthenticationMetadataProvider() {
}

private AuthorizationMetadataProvider getAuthorizationMetadataProvider() {
if (authorizationMetadataProvider == null) {
throw new IllegalStateException("The authorizationMetadataProvider is not configured");
}
return authorizationMetadataProvider;
}
}

0 comments on commit f0d1aff

Please sign in to comment.