Skip to content

Commit 0093671

Browse files
committed
Rename azure value to azure_imds and replace UAMI that is the identity with IMDS that is the authentication service
1 parent d74004b commit 0093671

File tree

6 files changed

+50
-46
lines changed

6 files changed

+50
-46
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
librdkafka v2.12.0 is a feature release:
44

55
* Support for OAUTHBEARER metadata based authentication types,
6-
starting with Azure UAMI. [Introduction available](INTRODUCTION.md#oauthbearer-oidc-metadata-authentication) (#5155).
6+
starting with Azure IMDS. [Introduction available](INTRODUCTION.md#oauthbearer-oidc-metadata-authentication) (#5155).
77

88

99

CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ sasl.oauthbearer.assertion.claim.jti.include | * | true, false | f
121121
sasl.oauthbearer.assertion.claim.nbf.seconds | * | 0 .. 2147483647 | 60 | low | Assertion not before time in seconds. Only used when `sasl.oauthbearer.method` is set to "oidc" and JWT assertion is needed. <br>*Type: integer*
122122
sasl.oauthbearer.assertion.claim.sub | * | | | low | JWT subject claim. Only used when `sasl.oauthbearer.method` is set to "oidc" and JWT assertion is needed. <br>*Type: string*
123123
sasl.oauthbearer.assertion.jwt.template.file | * | | | low | Path to the JWT template file. Only used when `sasl.oauthbearer.method` is set to "oidc" and JWT assertion is needed. <br>*Type: string*
124-
sasl.oauthbearer.metadata.authentication.type | * | none, azure | none | low | Type of metadata based authentication to use for OAUTHBEARER/OIDC `azure` authenticates using the Azure UAMI endpoint. Sets a default value for `sasl.oauthbearer.token.endpoint.url` if missing. Configuration values specific of chosen authentication type can be passed through `sasl.oauthbearer.config`. <br>*Type: enum value*
124+
sasl.oauthbearer.metadata.authentication.type | * | none, azure_imds | none | low | Type of metadata based authentication to use for OAUTHBEARER/OIDC `azure_imds` authenticates using the Azure IMDS endpoint. Sets a default value for `sasl.oauthbearer.token.endpoint.url` if missing. Configuration values specific of chosen authentication type can be passed through `sasl.oauthbearer.config`. <br>*Type: enum value*
125125
plugin.library.paths | * | | | low | List of plugin libraries to load (; separated). The library search path is platform dependent (see dlopen(3) for Unix and LoadLibrary() for Windows). If no filename extension is specified the platform-specific extension (such as .dll or .so) will be appended automatically. <br>*Type: string*
126126
interceptors | * | | | low | Interceptors added through rd_kafka_conf_interceptor_add_..() and any configuration handled by interceptors. <br>*Type: see dedicated API*
127127
group.id | C | | | high | Client group id string. All clients sharing the same group.id belong to the same group. <br>*Type: string*

INTRODUCTION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,24 +1247,24 @@ some metadata based OAUTHBEARER authentication types.
12471247

12481248
Currently these authentication types are supported:
12491249

1250-
###### Azure UAMI
1250+
###### Azure IMDS
12511251

12521252
to use this method you set:
12531253

1254-
* `sasl.oauthbearer.metadata.authentication.type=azure` this make that ` sasl.oauthbearer.client.id`
1254+
* `sasl.oauthbearer.metadata.authentication.type=azure_imds` this make that ` sasl.oauthbearer.client.id`
12551255
and `sasl.oauthbearer.client.secret` aren't required
12561256
* `sasl.oauthbearer.config` is a general purpose configuration property
12571257
In this case it's accepts comma-separated `key=value` pairs.
12581258
The `params` key is required and its value is the GET query string to append
12591259
to the token endpoint URL. Such query string contains params required by
1260-
Azure UAMI such as `client_id` (the UAMI), `resource` for determining the
1260+
Azure IMDS such as `client_id` (the UAMI), `resource` for determining the
12611261
target audience and `api-version` for the API version to be used by the endpoint
12621262
* `sasl.oauthbearer.token.endpoint.url` (optional) is set automatically
1263-
when chosing `sasl.oauthbearer.metadata.authentication.type=azure` but can
1263+
when chosing `sasl.oauthbearer.metadata.authentication.type=azure_imds` but can
12641264
be customized
12651265

12661266

1267-
_Example:_ `sasl.oauthbearer.metadata.authentication.type=azure` and
1267+
_Example:_ `sasl.oauthbearer.metadata.authentication.type=azure_imds` and
12681268
`sasl.oauthbearer.config=params=api-version=2018-02-01&resource=api://<App registration client id>&client_id=<UAMI client id>`
12691269

12701270

src/rdkafka_conf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
12141214
_RK_C_S2I,
12151215
_RK(sasl.oauthbearer.metadata_authentication.type),
12161216
"Type of metadata based authentication to use for OAUTHBEARER/OIDC "
1217-
"`azure` authenticates using the Azure UAMI endpoint. "
1217+
"`azure_imds` authenticates using the Azure IMDS endpoint. "
12181218
"Sets a default value for `sasl.oauthbearer.token.endpoint.url` if "
12191219
"missing. "
12201220
"Configuration values specific of chosen authentication type can be "
@@ -1225,7 +1225,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
12251225
.s2i = {{RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_NONE,
12261226
"none"},
12271227
{RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_AZURE,
1228-
"azure"}},
1228+
"azure_imds"}},
12291229
},
12301230

12311231
/* Plugins */

tests/0126-oauthbearer_oidc.c

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -388,30 +388,30 @@ void do_test_produce_consumer_with_OIDC_jwt_bearer(rd_kafka_conf_t *conf) {
388388

389389

390390
typedef enum oidc_configuration_metadata_authentication_variation_t {
391-
/** Azure UAMI. Successful case. */
392-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_SUCCESS,
393-
/** Azure UAMI. Missing client ID. */
394-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_CLIENT_ID,
395-
/** Azure UAMI. Missing resource parameter. */
396-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_RESOURCE,
397-
/** Azure UAMI. Missing API version. */
398-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_API_VERSION,
391+
/** Azure IMDS. Successful case. */
392+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_SUCCESS,
393+
/** Azure IMDS. Missing client ID. */
394+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_CLIENT_ID,
395+
/** Azure IMDS. Missing resource parameter. */
396+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_RESOURCE,
397+
/** Azure IMDS. Missing API version. */
398+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_API_VERSION,
399399
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION__CNT
400400
} oidc_configuration_metadata_authentication_variation_t;
401401

402402
#define OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION__FIRST_FAILING \
403-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_CLIENT_ID
403+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_CLIENT_ID
404404

405405
static const char *oidc_configuration_metadata_authentication_variation_name(
406406
oidc_configuration_metadata_authentication_variation_t variation) {
407407
rd_assert(
408408
variation >=
409-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_SUCCESS &&
409+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_SUCCESS &&
410410
variation <
411411
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION__CNT);
412412
static const char *names[] = {
413-
"Azure UAMI: success", "Azure UAMI: missing client ID",
414-
"Azure UAMI: missing resource", "Azure UAMI: missing API version"};
413+
"Azure IMDS: success", "Azure IMDS: missing client ID",
414+
"Azure IMDS: missing resource", "Azure IMDS: missing API version"};
415415
return names[variation];
416416
}
417417

@@ -420,41 +420,45 @@ static rd_kafka_conf_t *oidc_configuration_metadata_authentication(
420420
oidc_configuration_metadata_authentication_variation_t variation) {
421421
conf = rd_kafka_conf_dup(conf);
422422
switch (variation) {
423-
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_SUCCESS:
423+
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_SUCCESS:
424424
test_conf_set(conf,
425425
"sasl.oauthbearer.metadata.authentication.type",
426-
"azure");
427-
test_conf_set(conf, "sasl.oauthbearer.config",
428-
"params=__metadata_authentication_type=azure&"
429-
"api-version=2018-02-01&resource="
430-
"api://external_resource_id&client_id=client_id");
426+
"azure_imds");
427+
test_conf_set(
428+
conf, "sasl.oauthbearer.config",
429+
"params=__metadata_authentication_type=azure_imds&"
430+
"api-version=2018-02-01&resource="
431+
"api://external_resource_id&client_id=client_id");
431432
break;
432-
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_CLIENT_ID:
433+
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_CLIENT_ID:
433434
test_conf_set(conf,
434435
"sasl.oauthbearer.metadata.authentication.type",
435-
"azure");
436-
test_conf_set(conf, "sasl.oauthbearer.config",
437-
"params=__metadata_authentication_type=azure&"
438-
"api-version=2018-02-01&resource="
439-
"api://external_resource_id");
436+
"azure_imds");
437+
test_conf_set(
438+
conf, "sasl.oauthbearer.config",
439+
"params=__metadata_authentication_type=azure_imds&"
440+
"api-version=2018-02-01&resource="
441+
"api://external_resource_id");
440442
break;
441-
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_RESOURCE:
443+
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_RESOURCE:
442444
test_conf_set(conf,
443445
"sasl.oauthbearer.metadata.authentication.type",
444-
"azure");
445-
test_conf_set(conf, "sasl.oauthbearer.config",
446-
"params=__metadata_authentication_type=azure&"
447-
"api-version=2018-02-01&"
448-
"client_id=client_id");
446+
"azure_imds");
447+
test_conf_set(
448+
conf, "sasl.oauthbearer.config",
449+
"params=__metadata_authentication_type=azure_imds&"
450+
"api-version=2018-02-01&"
451+
"client_id=client_id");
449452
break;
450-
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_MISSING_API_VERSION:
453+
case OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_MISSING_API_VERSION:
451454
test_conf_set(conf,
452455
"sasl.oauthbearer.metadata.authentication.type",
453-
"azure");
454-
test_conf_set(conf, "sasl.oauthbearer.config",
455-
"params=__metadata_authentication_type=azure&"
456-
"resource="
457-
"api://external_resource_id&client_id=client_id");
456+
"azure_imds");
457+
test_conf_set(
458+
conf, "sasl.oauthbearer.config",
459+
"params=__metadata_authentication_type=azure_imds&"
460+
"resource="
461+
"api://external_resource_id&client_id=client_id");
458462
break;
459463
default:
460464
TEST_ASSERT(rd_false,
@@ -469,7 +473,7 @@ void do_test_produce_consumer_with_OIDC_metadata_authentication(
469473
oidc_configuration_metadata_authentication_variation_t variation;
470474
for (
471475
variation =
472-
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_SUCCESS;
476+
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION_AZURE_IMDS_SUCCESS;
473477
variation <
474478
OIDC_CONFIGURATION_METADATA_AUTHENTICATION_VARIATION__CNT;
475479
variation++) {

tests/trivup/trivup-0.14.0.tar.gz

7 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)