Skip to content

feat: revoke Kafka Topic grants - #517

Merged
christeredvartsen merged 1 commit into
mainfrom
revoke-kafka-grant-access
Sep 9, 2026
Merged

feat: revoke Kafka Topic grants#517
christeredvartsen merged 1 commit into
mainfrom
revoke-kafka-grant-access

Conversation

@christeredvartsen

Copy link
Copy Markdown
Member

No description provided.

@thokra-nav thokra-nav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The update logic can incorrectly skip re-adding a grant when the same grant appears in both revokeGrants and addGrants in a single request.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds support for revoking Kafka Topic grants via the existing updateKafkaTopic mutation by introducing a revokeGrants input field and translating it into JSON Patch remove operations against the Topic ACL list.

Changes:

  • Extend UpdateKafkaTopicInput (Go + GraphQL) with revokeGrants.
  • Implement revoke behavior by generating JSON Patch remove ops for matching ACL entries.
  • Add integration tests covering authorization and revoke + combined add/revoke flows.
File summaries
File Description
internal/persistence/kafkatopic/queries.go Build JSON Patch remove operations to revoke ACL grants during topic update.
internal/persistence/kafkatopic/models.go Add RevokeGrants to the update input model.
internal/graph/schema/kafka.graphqls Expose revokeGrants in the public GraphQL schema with a description.
internal/graph/gengql/root_.generated.go Regenerated schema output reflecting revokeGrants.
internal/graph/gengql/kafka.generated.go Regenerated unmarshalling to populate RevokeGrants.
integration_tests/update_kafka_topic.lua Add integration coverage for revoke authorization and behavior.
Review details

Files not reviewed (1)

  • internal/graph/gengql/kafka.generated.go: Generated file
  • Files reviewed: 5/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +155 to 158
seen = make(map[string]struct{})
for _, grant := range input.AddGrants {
key := grant.Access.AivenAccess() + "|" + grant.TeamName + "|" + grant.Subject
if _, ok := seen[key]; ok {
@christeredvartsen
christeredvartsen force-pushed the revoke-kafka-grant-access branch from 29a5635 to 10b8b10 Compare September 9, 2026 12:08
@christeredvartsen
christeredvartsen enabled auto-merge (squash) September 9, 2026 12:10
@christeredvartsen
christeredvartsen merged commit f28721b into main Sep 9, 2026
10 checks passed
@christeredvartsen
christeredvartsen deleted the revoke-kafka-grant-access branch September 9, 2026 12:13
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.

3 participants