Skip to content

feat(acls): list, create and delete Kafka ACLs - #46

Open
tructn wants to merge 2 commits into
mainfrom
feat/acl-management
Open

tructn wants to merge 2 commits into
mainfrom
feat/acl-management

Conversation

@tructn

@tructn tructn commented Nov 16, 2026

Copy link
Copy Markdown
Owner

What

A new ACLs page (sidebar, ⌘4) to manage a cluster's ACLs:

  • List every ACL, with a filter by principal, resource or host and a resource-type select. Columns are sortable and the list is paginated.
  • Create: principal, host, resource type, name, exact or prefix match, Allow/Deny, and one checkbox per operation. One ACL is created per chosen operation, which is how Kafka stores them. The dialog only offers the operations Kafka checks on the chosen resource type.
  • Delete a single ACL after a confirmation that spells it out ("Allow User:alice to Read topic orders* from any host").

How

  • rust-rdkafka 0.39 (the latest release) doesn't wrap librdkafka's ACL admin API. kui_kafka/src/acl_admin.rs calls rd_kafka_DescribeAcls/CreateAcls/DeleteAcls directly, following the existing groups.rs exception to the unsafe_code lint. The exception is now written down in docs/CODE_STANDARDS.md.
  • The queue/poll plumbing moves from groups.rs to a shared admin_request.rs. It now also explains SECURITY_DISABLED (a broker without an authorizer) instead of returning librdkafka's raw text.
  • Delete is exact. Every delete filter repeats all of the ACL's fields and never uses ANY/MATCH, so deleting one row can't remove other ACLs. The integration test checks this: deleting Read leaves its Describe sibling.
  • Pure types and validation are in acls.rs, outside the unsafe exception and unit-tested. IPC input is validated in Rust (principal format, cluster name, operations that apply to the resource, NUL characters, at most 100 ACLs per request).
  • Bindings with values this version doesn't know are left out of the list rather than mislabeled (for example, shown as Allow).
  • create_acls/delete_acls are in CHANGING_COMMANDS, and list_acls is classified read-only.

Infra

The dev and e2e brokers now run StandardAuthorizer with super.users=User:ANONYMOUS. Every PLAINTEXT client, the controller included, keeps full access, and ACLs can be created and listed. Run bun run kafka:down && bun run kafka:up to pick this up locally.

Tests

  • bun run lint, bun run test (83 frontend + Rust unit tests) and bunx tsc --noEmit pass.
  • bun run test:e2e passes in Docker: Rust 109 passed, 0 ignored (incl. the new acls_are_created_listed_and_deleted_exactly against a real broker); UI 10/10 spec files.
    • New 11-acls.e2e.ts: create two ACLs, cancel a delete, delete exactly one, and check that operations are filtered by resource type.
    • 08-no-unprompted-changes: browsing ACLs, the ⌘4 shortcut, and filling in then closing the create dialog send no changing command.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JJgxwKrEXCgPunVy24RExr

Adds an ACLs page: filter a cluster's ACLs by principal, resource or host,
create one ACL per chosen operation, and delete a single ACL after a
confirmation.

rust-rdkafka 0.39 doesn't wrap librdkafka's ACL admin API, so acl_admin.rs
calls it directly, following the existing groups.rs exception to the unsafe
lint. The shared request plumbing moves to admin_request.rs. Delete filters
repeat every field of the ACL, never ANY/MATCH, so one delete can't remove
other ACLs. Pure types and validation live in acls.rs, outside the exception.

The dev and e2e brokers now run StandardAuthorizer with ANONYMOUS as a super
user, so ACLs can be managed without locking out existing clients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJgxwKrEXCgPunVy24RExr
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9088fce1-30fa-4953-a178-ac212b3363a1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The ACLs page had nothing to show on a fresh dev broker, and every local client
connects as ANONYMOUS, a super user, so no ACL could ever be seen refusing
anything.

The seed now creates 30 ACLs covering every resource type, literal and
prefixed patterns, wildcards, DENY rules and host restrictions, plus an empty
demo.payments topic to produce to. The dev broker gets a SASL/PLAIN listener
on localhost:9094 with one login per demo principal, where the ACLs apply.

examples/acl-demo logs in as those users with KafkaJS: `bun run
kafka:acl-demo` tries 18 actions and exits 1 when the broker disagrees with
the ACLs, and one small program per service shows how each would use Kafka.
It never commits offsets, so demo-billing keeps its seeded lag.

docs/LOCAL_KAFKA.md documents the demo data, listeners, logins and ACLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJgxwKrEXCgPunVy24RExr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant