Skip to content

Conversation

@rwaweber
Copy link

In an ACL-enabled kafka environment trying to get karapace running as a schema registry, we ran into this hiccup since we aren't giving karapace full admin permissions.

Tracing down the topic authorization failure we were getting, it looks like karapace attempts topic creation before checking if the topic exists, then takes action based on that failure.

Instead, I think it makes sense to check the topic metadata before attempting to create the topic, as that's possible to do with a smaller, more scoped set of permissions.

About this change - What it does

  • Perform a topic list that match the config topic name before we try to create the schema storage topic

References: N/A (I figured a small patch may set the scene better than a bug report, but happy to create one if you all prefer!)

Why this way

In ACL-enabled kafka clusters, karapace would require a "CreateTopics" permission on the "Cluster" resource to complete this operation as-is. With these changes, the karapace identity only requires a "Describe" on a "Topic" resource with the "Metadata" API, which is easier to scope for an administrator perspective.

That being said, happy to consider alternative approaches, as I'm still pretty unfamiliar with this codebase at large!

- Perform a get on topics that match the config topic name before we try
  to create the schema storage topic

- In ACL-enabled kafka clusters, karapace would require a "CreateTopics"
  permission on the "Cluster" resource to complete this operation as-is.
  With these changes, the karapace identity only requires a "Describe"
  on a "Topic" resource with the "Metadata" API, which is easier to
  scope for an administrator perspective.
@rwaweber rwaweber requested a review from a team as a code owner January 19, 2026 22:23
@muralibasani
Copy link
Contributor

@rwaweber thanks for the pr.
Can you fix lint (pre-commit run --all-files) and you may run smoke tests locally too

@rwaweber
Copy link
Author

Hey @muralibasani! Yeah absolutely, will hopefully get around to it tonight or this weekend!

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.

2 participants