Skip to content

Scram Config API in Admin Client [KIP-554]#4241

Merged
Emanuele Sabellico (emasab) merged 14 commits intomasterfrom
feature/userscram-AdminClient
Jul 10, 2023
Merged

Scram Config API in Admin Client [KIP-554]#4241
Emanuele Sabellico (emasab) merged 14 commits intomasterfrom
feature/userscram-AdminClient

Conversation

@mahajanadhitya
Copy link
Copy Markdown
Contributor

No description provided.

@mahajanadhitya mahajanadhitya force-pushed the feature/userscram-AdminClient branch from 4ee6965 to 4bff8d0 Compare April 3, 2023 06:52
Copy link
Copy Markdown
Contributor

@milindl Milind L (milindl) left a comment

Choose a reason for hiding this comment

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

Reviewed all the non-example code.
Great work mahajanadhitya!

Comment thread examples/user_scram.c Outdated
/*
* librdkafka - Apache Kafka C library
*
* Copyright (c) 2020, Magnus Edenhill
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.

Nit: Change copyright notice :)

Comment thread src/rdkafka.h Outdated
typedef enum rd_kafka_ScramMechanism_s {
UNKNOWN = 0,
SCRAM_SHA_256 = 1,
SCRAM_SHA_512 = 2
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.

Rename these to RD_KAFKA_SCRAM_MECHANISM_SHA_256 and same for 512, and add a enum value at the end of the enum, called RD_KAFKA_SCRAM_MECHANISM__CNT (for looping and marking the end, if required)

Comment thread src/rdkafka.h Outdated
typedef enum rd_kafka_UserScramCredentialAlteration_type_s {
RD_KAFKA_USER_SCRAM_CREDENTIAL_ALTERATION_TYPE_UPSERT,
RD_KAFKA_USER_SCRAM_CREDENTIAL_ALTERATION_TYPE_DELETE,
RD_KAFKA_USER_SCRAM_CREDENTIAL_ALTERATION_TYPE_CNT
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.

use RD_KAFKA_USER_SCRAM_CREDENTIAL_ALTERATION_TYPE__CNT

Comment thread src/rdkafka.h Outdated

typedef struct rd_kafka_UserScramCredentialAlteration_s rd_kafka_UserScramCredentialAlteration_t;

RD_EXPORT
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.

need comments for all the publicly exported functions.

Comment thread src/rdkafka.h Outdated
RD_EXPORT
void rd_kafka_AlterUserScramCredentials(rd_kafka_t *rk,
rd_kafka_UserScramCredentialAlteration_t **alterations,
size_t num_alterations,
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.

Looking at convention, call it alteration_cnt

Comment thread src/rdkafka_admin.h Outdated
Comment thread src/rdkafka_op.h Outdated
Comment thread src/rdkafka.h Outdated
RD_EXPORT
void rd_kafka_DescribeUserScramCredentials(rd_kafka_t *rk,
char **users,
size_t num_users,
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 as alter, call it user_cnt

Comment thread src/rdkafka.h Outdated
Comment thread src/rdkafka.h Outdated
@mahajanadhitya mahajanadhitya force-pushed the feature/userscram-AdminClient branch from 80daa12 to 0b9b79b Compare May 24, 2023 12:32
@emasab Emanuele Sabellico (emasab) changed the title Scram Config API in Admin Client Scram Config API in Admin Client [KIP-554] Jun 1, 2023
* Remove editor configuration file

* Remove example binary and add it to
other places where it's listed

* Change copyright for new files

* Remove new error code

* Doxygen documentation,
remove return values from admin
functions

* Make alteration type an
internal enum

* Make returned types constant,
always return from async functions through
the queue

* Use event functions for top level error

* Return arrays when the array
contains pointers.
Renamed rd_kafka_UserScramCredentialAlterationResultElement
to rd_kafka_AlterUserScramCredentials_result_response
following admin api conventions

* Test improvements and fix for memory leak

* Use byte array for salt and password,
create random salt if not provided,
move hmac so sasl isn't required,
allow multiple alterations for the same
user as in Java,
example taking parameters from command
line

* Remove fprintf from tests

* Correct asserts when configured without SSL

* Compact bytes implementation,
use compact bytes for serialization

* Style fix

* Fix CMake

* Value 0x20000 is used by IncrementalAlterConfigs

* Documentation order

* Documentation improvements

* Read compact bytes implementation

* Improve security, refactor validation

* Changelog and support table

* Api versions update

* Address some comments

* Fix when disabling ssl

* Style fix and
use rd_strcmp2
LICENCE auto fix

* Address comments
@milindl Milind L (milindl) self-requested a review July 6, 2023 11:26
@milindl
Copy link
Copy Markdown
Contributor

Note: Please don't merge immediately after CI green, wait for bindings changes as well, as discussed with Emanuele Sabellico (@emasab)

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