-
Notifications
You must be signed in to change notification settings - Fork 14.6k
KAFKA-15983 Kafka-acls should return authorization already done if repeating work is issued #20482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jack2012aa Could you please add tests?
Thanks for the review. The test was added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jack2012aa thanks for this patch. Two small comments remains. PTAL
} | ||
|
||
if (!aclBindings.isEmpty()) { | ||
System.out.println("Adding ACLs for resource `" + resource + "`: " + NL + " " + aclsToAdd.stream().map(a -> "\t" + a).collect(Collectors.joining(NL)) + NL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aclsToAdd.stream()
could be replaced by aclBindings.stream().map(AclBinding::entry)
, right?
admin.createAcls(aclBindings).all().get(); | ||
|
||
AclBindingFilter filter = new AclBindingFilter(resource.toFilter(), AccessControlEntryFilter.ANY); | ||
Collection<AclBinding> existingBindings = admin.describeAcls(filter).values().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var existingBindingsSet = Set.copyOf(admin.describeAcls(filter).values().get());
Description
kafka-acls.sh
doesn't print message about duplicate authorization.Changes
Now the cli searches for existing AclBinding, prints duplicate bindings, and removes them from the adding list.