Skip to content

Commit 2456bf4

Browse files
committed
Fix deleteUser when authorization disabled
1 parent e4b731c commit 2456bf4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

auth/src/main/java/org/apache/rocketmq/auth/authentication/manager/AuthenticationMetadataManagerImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ public CompletableFuture<Void> deleteUser(String username) {
146146
throw new AuthenticationException("username can not be blank");
147147
}
148148
CompletableFuture<Void> deleteUser = this.getAuthenticationMetadataProvider().deleteUser(username);
149-
CompletableFuture<Void> deleteAcl = this.getAuthorizationMetadataProvider().deleteAcl(User.of(username));
149+
CompletableFuture<Void> deleteAcl = null;
150+
if (authorizationMetadataProvider == null) {
151+
deleteAcl = CompletableFuture.completedFuture(null);
152+
} else {
153+
deleteAcl = this.getAuthorizationMetadataProvider().deleteAcl(User.of(username));
154+
}
150155
return CompletableFuture.allOf(deleteUser, deleteAcl);
151156
} catch (Exception e) {
152157
this.handleException(e, result);

0 commit comments

Comments
 (0)