Skip to content

feat(kafka): manage topic access grants - #773

Merged
christeredvartsen merged 1 commit into
mainfrom
kafka-grants
Sep 10, 2026
Merged

christeredvartsen merged 1 commit into
mainfrom
kafka-grants

Conversation

@christeredvartsen

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

📝 Changelog preview

Below is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog.

v5.49.0 - 2026-09-10

Full Changelog: v5.48.0...v5.49.0

🚀 Features

  • (kafka) Manage topic access grants (dacfcef)

@christeredvartsen
christeredvartsen requested a lite review from Copilot September 10, 2026 11:34
@christeredvartsen
christeredvartsen merged commit a8d5790 into main Sep 10, 2026
23 checks passed
@christeredvartsen
christeredvartsen deleted the kafka-grants branch September 10, 2026 11:36

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 new revoke-grant command has avoidable UX/API inconsistencies (argument order vs grant-access and validation placement) that should be addressed before merging.

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

Pull request overview

Adds Kafka topic access grant management capabilities to the CLI by introducing commands to list and revoke ACL grants, backed by new GraphQL query/mutation support.

Changes:

  • Add kafka list-grants to display ACL grants for a Kafka topic (table or JSON output).
  • Add kafka revoke-grant to revoke a specific subject’s access level on a Kafka topic, including grant-aware autocompletion.
  • Extend generated GraphQL client code for fetching grants and revoking them; remove leftover debug dumping in config code.
File summaries
File Description
internal/naisapi/gql/generated.go Adds genqlient-generated types and operations for GetKafkaTopicGrants and RevokeAccessFromKafkaTopic.
internal/kafka/kafka.go Introduces Grant model plus API helpers to list grants and revoke a grant via GraphQL.
internal/kafka/command/revoke_grant.go New kafka revoke-grant command and grant-aware argument autocompletion.
internal/kafka/command/list_grants.go New kafka list-grants command for listing topic ACL entries.
internal/kafka/command/list_grants_test.go Adds tests for the new commands and grant table headings.
internal/kafka/command/flag/flag.go Tightens access validation (reject empty) and adds ListGrants flags.
internal/kafka/command/command.go Registers new subcommands and adds topic name autocompletion helper.
internal/config/config.go Removes accidental debug spew.Dump usage.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • 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 +25 to +33
ValidateFunc: validation.RequireTeamAndEnvironment(parentFlags),
AutoCompleteFunc: autoCompleteKafkaGrantArguments(parentFlags),
RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error {
topicName := args.Get("topic")
subject := kafkaApplicationName(args.Get("username"))
access := flag.KafkaTopicGrantAccess(args.Get("access"))
if err := access.Validate(); err != nil {
return err
}
Comment on lines +20 to +24
Args: []naistrix.Argument{
{Name: "topic"},
{Name: "username"},
{Name: "access"},
},
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