Skip to content

[KIP 482]: Upgrade ACL APis to Version 2(First flexible version) - #5081

Merged
Emanuele Sabellico (emasab) merged 5 commits into
masterfrom
dev_upgrade_acl_apis
Dec 16, 2025
Merged

Emanuele Sabellico (emasab) merged 5 commits into
masterfrom
dev_upgrade_acl_apis

Conversation

@PratRanj07

Copy link
Copy Markdown
Contributor

This PR intends to upgrade ACL Apis to v2(first flexible version) in accordance with KIP 482.

Copilot AI review requested due to automatic review settings May 15, 2025 06:03
@PratRanj07
Pratyush Ranjan (PratRanj07) requested a review from a team as a code owner May 15, 2025 06:03
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Updates ACL Admin APIs (CreateAcls, DescribeAcls, DeleteAcls) to use version 2 flexible requests per KIP 482, including tag handling and updated protocol version support.

  • Bump supported API version min from 1 to 2 and switch to rd_kafka_buf_new_flexver_request
  • Replace fixed-length writes (write_i32, write_str) with flexible versions (write_arraycnt, write_kstr) and handle empty tags
  • Add skipping of response tags in admin response parsing and update protocol versions in documentation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/rdkafka_request.c Use flexible-version request builder, update write calls, handle tags, bump API version checks
src/rdkafka_admin.c Skip tags in response parsing for v2 ACL APIs
INTRODUCTION.md Increment documented flexible-version fields for ACL API versions
Comments suppressed due to low confidence (1)

src/rdkafka_request.c:5805

  • The API version argument is hardcoded to 1; this should use the actual ApiVersion variable when constructing the flexible request.
rkbuf = rd_kafka_buf_new_flexver_request(rkb, RD_KAFKAP_DescribeAcls, 1,

Comment thread src/rdkafka_request.c Resolved
Comment thread src/rdkafka_request.c Resolved
Comment thread src/rdkafka_request.c

rd_kafka_buf_write_i8(rkbuf, new_acl->restype);

rd_kafka_buf_write_str(rkbuf, new_acl->name, -1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rd_kafka_buf_write_str takes care of COMPACT_STRING as well. Same with below.

Comment thread src/rdkafka_request.c Resolved
Comment thread src/rdkafka_request.c Resolved
@airlock-confluentinc
airlock-confluentinc Bot force-pushed the dev_upgrade_acl_apis branch from d7b9d1b to f025417 Compare May 19, 2025 07:23
Comment thread src/rdkafka_admin.c Outdated
Comment on lines +5460 to +5462
if (rd_kafka_buf_ApiVersion(reply) >= 2) {
rd_kafka_buf_skip_tags(reply);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move this above with other buf parsing i.e. before if (error_code) {

Comment thread src/rdkafka_admin.c Outdated

if (rd_kafka_buf_ApiVersion(reply) >= 2) {
rd_kafka_buf_skip_tags(reply);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

line break.

Comment thread src/rdkafka_request.c Outdated
Comment on lines +5740 to +5742
if (ApiVersion >= 2) {
rd_kafka_buf_write_tags_empty(rkbuf);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to check version for rd_kafka_buf_write_tags_empty. It already checks whether the request is flexver or not.

Comment thread src/rdkafka_request.c Outdated
Comment on lines +5972 to +5974
if (ApiVersion >= 2) {
rd_kafka_buf_write_tags_empty(rkbuf);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same

Comment thread src/rdkafka_request.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since we are working in KIP-482, we should use rd_kafka_buf_write_tags_empty in rd_kafka_buf_finalize instead of below. Can be done in another PR as well.

if (rkbuf->rkbuf_flags & RD_KAFKA_OP_F_FLEXVER) {
        /* Empty struct tags */
        rd_kafka_buf_write_i8(rkbuf, 0);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added it in the same PR itself

Comment thread src/rdkafka_admin.c Outdated
Comment on lines +5472 to +5474
if (rd_kafka_buf_ApiVersion(reply) >= 2) {
rd_kafka_buf_skip_tags(reply);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for if condition for rd_kafka_buf_skip_tags. It breaks if the buf is not flexver. Do the same below as well.

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.

Thanks Pratyush Ranjan (@PratRanj07) ! Just a minor thing

Comment thread src/rdkafka_admin.c Outdated
Comment on lines +5470 to +5471
rd_kafka_buf_skip_tags(reply);

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.

Same here: this isn't needed in the top level structure response parsing, please remove it for the three RPCs

Suggested change
rd_kafka_buf_skip_tags(reply);

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.

Please remove this last rd_kafka_buf_skip_tags from rd_kafka_DescribeAclsResponse_parse and rd_kafka_DeleteAclsResponse_parse as well.

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.

LGTM. Thanks Pratyush!

@pranavrth Pranav Rathi (pranavrth) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!.

@emasab
Emanuele Sabellico (emasab) deleted the dev_upgrade_acl_apis branch December 16, 2025 13:26
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.

4 participants