-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scram Config API in Admin Client [KIP-554] #4241
Conversation
4ee6965
to
4bff8d0
Compare
There was a problem hiding this 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!
examples/user_scram.c
Outdated
/* | ||
* librdkafka - Apache Kafka C library | ||
* | ||
* Copyright (c) 2020, Magnus Edenhill |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Change copyright notice :)
src/rdkafka.h
Outdated
typedef enum rd_kafka_ScramMechanism_s { | ||
UNKNOWN = 0, | ||
SCRAM_SHA_256 = 1, | ||
SCRAM_SHA_512 = 2 |
There was a problem hiding this comment.
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)
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 |
There was a problem hiding this comment.
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
src/rdkafka.h
Outdated
|
||
typedef struct rd_kafka_UserScramCredentialAlteration_s rd_kafka_UserScramCredentialAlteration_t; | ||
|
||
RD_EXPORT |
There was a problem hiding this comment.
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.
src/rdkafka.h
Outdated
RD_EXPORT | ||
void rd_kafka_AlterUserScramCredentials(rd_kafka_t *rk, | ||
rd_kafka_UserScramCredentialAlteration_t **alterations, | ||
size_t num_alterations, |
There was a problem hiding this comment.
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
src/rdkafka.h
Outdated
RD_EXPORT | ||
void rd_kafka_DescribeUserScramCredentials(rd_kafka_t *rk, | ||
char **users, | ||
size_t num_users, |
There was a problem hiding this comment.
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
80daa12
to
0b9b79b
Compare
* 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
Note: Please don't merge immediately after CI green, wait for bindings changes as well, as discussed with @emasab |
sending the request
last optional parameter as in J.
No description provided.