@platformatic/rdkafka 4.0.1 → 4.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bench/seed.sh +0 -0
- package/binding.gyp +8 -1
- package/ci/prepublish.js +4 -4
- package/config.d.ts +126 -10
- package/configure +0 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +67 -44
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +471 -1
- package/deps/librdkafka/CONFIGURATION.md +29 -9
- package/deps/librdkafka/INTRODUCTION.md +909 -601
- package/deps/librdkafka/LICENSES.txt +592 -1
- package/deps/librdkafka/Makefile +2 -1
- package/deps/librdkafka/configure +0 -0
- package/deps/librdkafka/debian/rules +0 -0
- package/deps/librdkafka/dev-conf.sh +0 -0
- package/deps/librdkafka/examples/consumer.c +18 -8
- package/deps/librdkafka/examples/describe_consumer_groups.c +25 -6
- package/deps/librdkafka/examples/incremental_alter_configs.c +4 -5
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +26 -42
- package/deps/librdkafka/examples/openssl_engine_example.cpp +3 -4
- package/deps/librdkafka/examples/producer.cpp +2 -2
- package/deps/librdkafka/examples/user_scram.c +4 -5
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +4 -3
- package/deps/librdkafka/lds-gen.py +0 -0
- package/deps/librdkafka/mklove/Makefile.base +0 -0
- package/deps/librdkafka/packaging/RELEASE.md +8 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +0 -0
- package/deps/librdkafka/packaging/cp/README.md +4 -1
- package/deps/librdkafka/packaging/cp/check_features.c +12 -4
- package/deps/librdkafka/packaging/cp/verify-deb.sh +6 -6
- package/deps/librdkafka/packaging/cp/verify-packages.sh +52 -31
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +6 -13
- package/deps/librdkafka/packaging/debian/rules +0 -0
- package/deps/librdkafka/packaging/get_version.py +0 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +0 -0
- package/deps/librdkafka/packaging/mingw-w64/{travis-before-install.sh → export-variables.sh} +0 -7
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +1 -1
- package/deps/librdkafka/packaging/nuget/artifact.py +0 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +0 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/release.py +0 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -3
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +3 -1
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +0 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +0 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +0 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +0 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +6 -5
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +154 -0
- package/deps/librdkafka/src/generate_proto.sh +0 -0
- package/deps/librdkafka/src/rd.h +145 -2
- package/deps/librdkafka/src/rdaddr.h +6 -7
- package/deps/librdkafka/src/rdatomic.h +15 -11
- package/deps/librdkafka/src/rdavg.h +3 -2
- package/deps/librdkafka/src/rdbase64.c +33 -2
- package/deps/librdkafka/src/rdbase64.h +2 -0
- package/deps/librdkafka/src/rdendian.h +10 -9
- package/deps/librdkafka/src/rdhttp.c +418 -100
- package/deps/librdkafka/src/rdhttp.h +23 -5
- package/deps/librdkafka/src/rdkafka.c +299 -145
- package/deps/librdkafka/src/rdkafka.h +89 -6
- package/deps/librdkafka/src/rdkafka_admin.c +482 -105
- package/deps/librdkafka/src/rdkafka_admin.h +42 -0
- package/deps/librdkafka/src/rdkafka_broker.c +463 -312
- package/deps/librdkafka/src/rdkafka_broker.h +68 -10
- package/deps/librdkafka/src/rdkafka_buf.c +8 -5
- package/deps/librdkafka/src/rdkafka_buf.h +4 -3
- package/deps/librdkafka/src/rdkafka_cert.c +25 -1
- package/deps/librdkafka/src/rdkafka_cert.h +4 -3
- package/deps/librdkafka/src/rdkafka_cgrp.c +468 -143
- package/deps/librdkafka/src/rdkafka_cgrp.h +36 -2
- package/deps/librdkafka/src/rdkafka_conf.c +526 -102
- package/deps/librdkafka/src/rdkafka_conf.h +68 -4
- package/deps/librdkafka/src/rdkafka_feature.c +472 -35
- package/deps/librdkafka/src/rdkafka_feature.h +2 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +22 -2
- package/deps/librdkafka/src/rdkafka_fetcher.h +2 -2
- package/deps/librdkafka/src/rdkafka_int.h +84 -46
- package/deps/librdkafka/src/rdkafka_metadata.c +221 -136
- package/deps/librdkafka/src/rdkafka_metadata.h +15 -11
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +279 -73
- package/deps/librdkafka/src/rdkafka_mock.c +795 -19
- package/deps/librdkafka/src/rdkafka_mock.h +119 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1298 -132
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +345 -49
- package/deps/librdkafka/src/rdkafka_mock_int.h +180 -61
- package/deps/librdkafka/src/rdkafka_msg.c +35 -19
- package/deps/librdkafka/src/rdkafka_msg.h +3 -3
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +14 -10
- package/deps/librdkafka/src/rdkafka_offset.c +33 -5
- package/deps/librdkafka/src/rdkafka_op.c +1 -1
- package/deps/librdkafka/src/rdkafka_op.h +45 -21
- package/deps/librdkafka/src/rdkafka_partition.c +118 -23
- package/deps/librdkafka/src/rdkafka_partition.h +16 -7
- package/deps/librdkafka/src/rdkafka_proto.h +4 -1
- package/deps/librdkafka/src/rdkafka_protocol.h +1 -0
- package/deps/librdkafka/src/rdkafka_queue.c +125 -48
- package/deps/librdkafka/src/rdkafka_queue.h +19 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1 -1
- package/deps/librdkafka/src/rdkafka_request.c +336 -64
- package/deps/librdkafka/src/rdkafka_request.h +24 -1
- package/deps/librdkafka/src/rdkafka_sasl.c +5 -3
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +14 -10
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1166 -89
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +13 -3
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +3 -3
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +4 -3
- package/deps/librdkafka/src/rdkafka_ssl.c +306 -81
- package/deps/librdkafka/src/rdkafka_ssl.h +22 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +80 -23
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +5 -1
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +20 -20
- package/deps/librdkafka/src/rdkafka_topic.c +220 -137
- package/deps/librdkafka/src/rdkafka_topic.h +14 -8
- package/deps/librdkafka/src/rdkafka_transport.c +59 -47
- package/deps/librdkafka/src/rdkafka_transport.h +5 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +6 -1
- package/deps/librdkafka/src/rdmap.c +6 -1
- package/deps/librdkafka/src/rdrand.c +11 -1
- package/deps/librdkafka/src/rdtime.h +48 -17
- package/deps/librdkafka/src/rdunittest.c +42 -25
- package/deps/librdkafka/src/rdunittest.h +2 -0
- package/deps/librdkafka/src/rdwin32.h +1 -1
- package/deps/librdkafka/src/regexp.c +47 -42
- package/deps/librdkafka/src/tinycthread_extra.c +45 -21
- package/deps/librdkafka/src/tinycthread_extra.h +7 -3
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +28 -2
- package/deps/librdkafka/tests/0001-multiobj.c +4 -0
- package/deps/librdkafka/tests/0004-conf.c +103 -36
- package/deps/librdkafka/tests/0009-mock_cluster.c +1 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +2 -1
- package/deps/librdkafka/tests/0016-client_swname.c +18 -3
- package/deps/librdkafka/tests/0017-compression.c +6 -8
- package/deps/librdkafka/tests/0018-cgrp_term.c +8 -3
- package/deps/librdkafka/tests/0021-rkt_destroy.c +1 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +4 -1
- package/deps/librdkafka/tests/0026-consume_pause.c +12 -14
- package/deps/librdkafka/tests/0028-long_topicnames.c +1 -1
- package/deps/librdkafka/tests/0029-assign_offset.c +6 -8
- package/deps/librdkafka/tests/0030-offset_commit.c +2 -2
- package/deps/librdkafka/tests/0033-regex_subscribe.c +33 -17
- package/deps/librdkafka/tests/0034-offset_reset.c +25 -4
- package/deps/librdkafka/tests/0036-partial_fetch.c +1 -0
- package/deps/librdkafka/tests/0038-performance.c +1 -0
- package/deps/librdkafka/tests/0040-io_event.c +11 -5
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +1 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +3 -2
- package/deps/librdkafka/tests/0045-subscribe_update.c +284 -20
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +1 -0
- package/deps/librdkafka/tests/0048-partitioner.c +1 -1
- package/deps/librdkafka/tests/0050-subscribe_adds.c +1 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +1 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +22 -4
- package/deps/librdkafka/tests/0053-stats_cb.cpp +12 -20
- package/deps/librdkafka/tests/0055-producer_latency.c +176 -3
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +6 -2
- package/deps/librdkafka/tests/0058-log.cpp +3 -3
- package/deps/librdkafka/tests/0059-bsearch.cpp +8 -4
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +25 -5
- package/deps/librdkafka/tests/0067-empty_topic.cpp +3 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +21 -23
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +3 -7
- package/deps/librdkafka/tests/0075-retry.c +38 -1
- package/deps/librdkafka/tests/0076-produce_retry.c +2 -0
- package/deps/librdkafka/tests/0077-compaction.c +8 -2
- package/deps/librdkafka/tests/0080-admin_ut.c +34 -4
- package/deps/librdkafka/tests/0081-admin.c +455 -155
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +4 -0
- package/deps/librdkafka/tests/0083-cb_event.c +8 -3
- package/deps/librdkafka/tests/0084-destroy_flags.c +14 -18
- package/deps/librdkafka/tests/0085-headers.cpp +4 -0
- package/deps/librdkafka/tests/0086-purge.c +40 -7
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +1 -1
- package/deps/librdkafka/tests/0089-max_poll_interval.c +12 -7
- package/deps/librdkafka/tests/0090-idempotence.c +1 -2
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +5 -7
- package/deps/librdkafka/tests/0092-mixed_msgver.c +6 -0
- package/deps/librdkafka/tests/0093-holb.c +8 -5
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +1 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +262 -70
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +16 -16
- package/deps/librdkafka/tests/0099-commit_metadata.c +1 -1
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +1 -1
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +317 -16
- package/deps/librdkafka/tests/0103-transactions.c +7 -7
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +1 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +18 -11
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +35 -14
- package/deps/librdkafka/tests/0107-topic_recreate.c +2 -2
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +86 -26
- package/deps/librdkafka/tests/0110-batch_size.cpp +1 -2
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +3 -14
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +248 -104
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +3 -3
- package/deps/librdkafka/tests/0115-producer_auth.cpp +4 -1
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +7 -5
- package/deps/librdkafka/tests/0117-mock_errors.c +15 -5
- package/deps/librdkafka/tests/0118-commit_rebalance.c +41 -8
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +20 -1
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +8 -3
- package/deps/librdkafka/tests/0125-immediate_flush.c +1 -1
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +323 -8
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +1 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +12 -4
- package/deps/librdkafka/tests/0133-ssl_keys.c +28 -6
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +24 -14
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +510 -2
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +1 -1
- package/deps/librdkafka/tests/0142-reauthentication.c +37 -17
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +39 -40
- package/deps/librdkafka/tests/0146-metadata_mock.c +76 -15
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +9 -6
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/CMakeLists.txt +6 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +34 -9
- package/deps/librdkafka/tests/autotest.sh +0 -0
- package/deps/librdkafka/tests/broker_version_tests.py +0 -0
- package/deps/librdkafka/tests/buildbox.sh +0 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +0 -0
- package/deps/librdkafka/tests/cluster_testing.py +0 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +0 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +42 -101
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +41 -29
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +112 -37
- package/deps/librdkafka/tests/gen-ssl-certs.sh +0 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +0 -0
- package/deps/librdkafka/tests/java/Makefile +2 -1
- package/deps/librdkafka/tests/java/run-class.sh +0 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +0 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +0 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +0 -0
- package/deps/librdkafka/tests/performance_plot.py +0 -0
- package/deps/librdkafka/tests/requirements.txt +1 -1
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +0 -0
- package/deps/librdkafka/tests/sasl_test.py +0 -0
- package/deps/librdkafka/tests/test.c +478 -18
- package/deps/librdkafka/tests/test.h +62 -13
- package/deps/librdkafka/tests/testcpp.cpp +6 -1
- package/deps/librdkafka/tests/testcpp.h +30 -2
- package/deps/librdkafka/tests/testshared.h +16 -2
- package/deps/librdkafka/tests/tools/stats/graph.py +0 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +1 -1
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +0 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +1 -1
- package/deps/librdkafka/vcpkg.json +1 -1
- package/deps/librdkafka/win32/setup-msys2.ps1 +24 -8
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +28 -6
- package/deps/librdkafka/win32/tests/tests.vcxproj +6 -0
- package/deps/librdkafka/win32/wingetopt.h +5 -4
- package/errors.d.ts +27 -1
- package/lib/error.js +29 -3
- package/make_docs.sh +0 -0
- package/package.json +10 -11
- package/run_docker.sh +0 -0
- package/src/callbacks.cc +6 -9
- package/src/callbacks.h +1 -5
- package/test/kafka-consumer-worker.js +10 -7
- package/test/kafka-consumer.spec.js +32 -21
- package/deps/librdkafka/.semaphore/project.yml +0 -43
- package/deps/librdkafka/.semaphore/project_public.yml +0 -20
- package/deps/librdkafka/win32/install-openssl.ps1 +0 -33
|
@@ -56,24 +56,29 @@
|
|
|
56
56
|
#include <windows.h>
|
|
57
57
|
#endif
|
|
58
58
|
|
|
59
|
+
#ifdef WITH_OAUTHBEARER_OIDC
|
|
60
|
+
#include <curl/curl.h>
|
|
61
|
+
#endif
|
|
62
|
+
|
|
59
63
|
struct rd_kafka_property {
|
|
60
64
|
rd_kafka_conf_scope_t scope;
|
|
61
65
|
const char *name;
|
|
62
|
-
enum {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
enum {
|
|
67
|
+
_RK_C_STR,
|
|
68
|
+
_RK_C_INT,
|
|
69
|
+
_RK_C_DBL, /* Double */
|
|
70
|
+
_RK_C_S2I, /* String to Integer mapping.
|
|
71
|
+
* Supports limited canonical str->int mappings
|
|
72
|
+
* using s2i[] */
|
|
73
|
+
_RK_C_S2F, /* CSV String to Integer flag mapping (OR:ed) */
|
|
74
|
+
_RK_C_BOOL,
|
|
75
|
+
_RK_C_PTR, /* Only settable through special set functions */
|
|
76
|
+
_RK_C_PATLIST, /* Pattern list */
|
|
77
|
+
_RK_C_KSTR, /* Kafka string */
|
|
78
|
+
_RK_C_ALIAS, /* Alias: points to other property through .sdef */
|
|
79
|
+
_RK_C_INTERNAL, /* Internal, don't expose to application */
|
|
80
|
+
_RK_C_INVALID, /* Invalid property, used to catch known
|
|
81
|
+
* but unsupported Java properties. */
|
|
77
82
|
} type;
|
|
78
83
|
int offset;
|
|
79
84
|
const char *desc;
|
|
@@ -198,6 +203,15 @@ struct rd_kafka_property {
|
|
|
198
203
|
"available at build time"
|
|
199
204
|
#endif
|
|
200
205
|
|
|
206
|
+
#if WITH_OAUTHBEARER_OIDC
|
|
207
|
+
#define _UNSUPPORTED_HTTPS .unsupported = NULL
|
|
208
|
+
#else
|
|
209
|
+
#define _UNSUPPORTED_HTTPS \
|
|
210
|
+
.unsupported = \
|
|
211
|
+
"HTTPS calls depend on libcurl and OpenSSL which were not " \
|
|
212
|
+
"available at build time"
|
|
213
|
+
#endif
|
|
214
|
+
|
|
201
215
|
#ifdef _WIN32
|
|
202
216
|
#define _UNSUPPORTED_WIN32_GSSAPI \
|
|
203
217
|
.unsupported = \
|
|
@@ -437,6 +451,34 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
437
451
|
1, 1000000, 1000000},
|
|
438
452
|
{_RK_GLOBAL, "max.in.flight", _RK_C_ALIAS,
|
|
439
453
|
.sdef = "max.in.flight.requests.per.connection"},
|
|
454
|
+
{_RK_GLOBAL, "metadata.recovery.strategy", _RK_C_S2I,
|
|
455
|
+
_RK(metadata_recovery_strategy),
|
|
456
|
+
"Controls how the client recovers when none of the brokers known to it "
|
|
457
|
+
"is available. If set to `none`, the client doesn't re-bootstrap. "
|
|
458
|
+
"If set to `rebootstrap`, the client repeats the bootstrap process "
|
|
459
|
+
"using `bootstrap.servers` and brokers added through "
|
|
460
|
+
"`rd_kafka_brokers_add()`. Rebootstrapping is useful when a client "
|
|
461
|
+
"communicates with brokers so infrequently that the set of brokers "
|
|
462
|
+
"may change entirely before the client refreshes metadata. "
|
|
463
|
+
"Metadata recovery is triggered when all last-known brokers appear "
|
|
464
|
+
"unavailable simultaneously or the client cannot refresh metadata within "
|
|
465
|
+
"`metadata.recovery.rebootstrap.trigger.ms` or it's requested in a "
|
|
466
|
+
"metadata response.",
|
|
467
|
+
.vdef = RD_KAFKA_METADATA_RECOVERY_STRATEGY_REBOOTSTRAP,
|
|
468
|
+
.s2i = {{RD_KAFKA_METADATA_RECOVERY_STRATEGY_NONE, "none"},
|
|
469
|
+
{RD_KAFKA_METADATA_RECOVERY_STRATEGY_REBOOTSTRAP, "rebootstrap"},
|
|
470
|
+
{0, NULL}}},
|
|
471
|
+
{_RK_GLOBAL, "metadata.recovery.rebootstrap.trigger.ms", _RK_C_INT,
|
|
472
|
+
_RK(metadata_recovery_rebootstrap_trigger_ms),
|
|
473
|
+
"If a client configured to rebootstrap using "
|
|
474
|
+
"`metadata.recovery.strategy=rebootstrap` "
|
|
475
|
+
"is unable to obtain metadata from any "
|
|
476
|
+
"of the brokers for this interval, "
|
|
477
|
+
"client repeats the bootstrap process using "
|
|
478
|
+
"`bootstrap.servers` configuration "
|
|
479
|
+
"and brokers added through "
|
|
480
|
+
"`rd_kafka_brokers_add()`.",
|
|
481
|
+
0, INT_MAX, 300000},
|
|
440
482
|
{_RK_GLOBAL | _RK_DEPRECATED | _RK_HIDDEN, "metadata.request.timeout.ms",
|
|
441
483
|
_RK_C_INT, _RK(metadata_request_timeout_ms), "Not used.", 10, 900 * 1000,
|
|
442
484
|
10},
|
|
@@ -540,7 +582,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
540
582
|
#endif
|
|
541
583
|
},
|
|
542
584
|
{_RK_GLOBAL, "socket.nagle.disable", _RK_C_BOOL, _RK(socket_nagle_disable),
|
|
543
|
-
"Disable the Nagle algorithm (TCP_NODELAY) on broker sockets.", 0, 1,
|
|
585
|
+
"Disable the Nagle algorithm (TCP_NODELAY) on broker sockets.", 0, 1, 1
|
|
544
586
|
#ifndef TCP_NODELAY
|
|
545
587
|
,
|
|
546
588
|
.unsupported = "TCP_NODELAY not available at build time"
|
|
@@ -581,7 +623,10 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
581
623
|
"If this property is left at its default value some heuristics are "
|
|
582
624
|
"performed to determine a suitable default value, this is currently "
|
|
583
625
|
"limited to identifying brokers on Azure "
|
|
584
|
-
"(see librdkafka issue #3109 for more info)."
|
|
626
|
+
"(see librdkafka issue #3109 for more info). "
|
|
627
|
+
"Actual value can be lower, up to 2s lower, "
|
|
628
|
+
"only if `connections.max.idle.ms` >= 4s, "
|
|
629
|
+
"as jitter is added to avoid disconnecting all brokers at the same time.",
|
|
585
630
|
0, INT_MAX, 0},
|
|
586
631
|
{_RK_GLOBAL | _RK_MED | _RK_HIDDEN, "enable.sparse.connections", _RK_C_BOOL,
|
|
587
632
|
_RK(sparse_connections),
|
|
@@ -702,8 +747,10 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
702
747
|
"The application should mask this signal as an internal "
|
|
703
748
|
"signal handler is installed.",
|
|
704
749
|
0, 128, 0},
|
|
705
|
-
{_RK_GLOBAL | _RK_HIGH, "api.version.request", _RK_C_BOOL,
|
|
750
|
+
{_RK_GLOBAL | _RK_HIGH | _RK_DEPRECATED, "api.version.request", _RK_C_BOOL,
|
|
706
751
|
_RK(api_version_request),
|
|
752
|
+
"**Post-deprecation actions: remove this configuration property, "
|
|
753
|
+
"brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** "
|
|
707
754
|
"Request broker's supported API versions to adjust functionality to "
|
|
708
755
|
"available protocol features. If set to false, or the "
|
|
709
756
|
"ApiVersionRequest fails, the fallback version "
|
|
@@ -715,16 +762,20 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
715
762
|
{_RK_GLOBAL, "api.version.request.timeout.ms", _RK_C_INT,
|
|
716
763
|
_RK(api_version_request_timeout_ms),
|
|
717
764
|
"Timeout for broker API version requests.", 1, 5 * 60 * 1000, 10 * 1000},
|
|
718
|
-
{_RK_GLOBAL | _RK_MED, "api.version.fallback.ms",
|
|
719
|
-
_RK(api_version_fallback_ms),
|
|
765
|
+
{_RK_GLOBAL | _RK_MED | _RK_DEPRECATED, "api.version.fallback.ms",
|
|
766
|
+
_RK_C_INT, _RK(api_version_fallback_ms),
|
|
767
|
+
"**Post-deprecation actions: remove this configuration property, "
|
|
768
|
+
"brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** "
|
|
720
769
|
"Dictates how long the `broker.version.fallback` fallback is used "
|
|
721
770
|
"in the case the ApiVersionRequest fails. "
|
|
722
771
|
"**NOTE**: The ApiVersionRequest is only issued when a new connection "
|
|
723
772
|
"to the broker is made (such as after an upgrade).",
|
|
724
773
|
0, 86400 * 7 * 1000, 0},
|
|
725
774
|
|
|
726
|
-
{_RK_GLOBAL | _RK_MED, "broker.version.fallback",
|
|
727
|
-
_RK(broker_version_fallback),
|
|
775
|
+
{_RK_GLOBAL | _RK_MED | _RK_DEPRECATED, "broker.version.fallback",
|
|
776
|
+
_RK_C_STR, _RK(broker_version_fallback),
|
|
777
|
+
"**Post-deprecation actions: remove this configuration property, "
|
|
778
|
+
"brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** "
|
|
728
779
|
"Older broker versions (before 0.10.0) provide no way for a client to "
|
|
729
780
|
"query "
|
|
730
781
|
"for supported protocol features "
|
|
@@ -758,10 +809,10 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
758
809
|
_RK(security_protocol), "Protocol used to communicate with brokers.",
|
|
759
810
|
.vdef = RD_KAFKA_PROTO_PLAINTEXT,
|
|
760
811
|
.s2i = {{RD_KAFKA_PROTO_PLAINTEXT, "plaintext"},
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
812
|
+
{RD_KAFKA_PROTO_SSL, "ssl", _UNSUPPORTED_SSL},
|
|
813
|
+
{RD_KAFKA_PROTO_SASL_PLAINTEXT, "sasl_plaintext"},
|
|
814
|
+
{RD_KAFKA_PROTO_SASL_SSL, "sasl_ssl", _UNSUPPORTED_SSL},
|
|
815
|
+
{0, NULL}}},
|
|
765
816
|
|
|
766
817
|
{_RK_GLOBAL, "ssl.cipher.suites", _RK_C_STR, _RK(ssl.cipher_suites),
|
|
767
818
|
"A cipher suite is a named combination of authentication, "
|
|
@@ -825,6 +876,29 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
825
876
|
"If OpenSSL is dynamically linked the OpenSSL library's default "
|
|
826
877
|
"path will be used (see `OPENSSLDIR` in `openssl version -a`).",
|
|
827
878
|
_UNSUPPORTED_SSL},
|
|
879
|
+
{_RK_GLOBAL, "https.ca.location", _RK_C_STR, _RK(https.ca_location),
|
|
880
|
+
"File or directory path to CA certificate(s) for verifying "
|
|
881
|
+
"HTTPS endpoints, like `sasl.oauthbearer.token.endpoint.url` used for "
|
|
882
|
+
"OAUTHBEARER/OIDC authentication. "
|
|
883
|
+
"Mutually exclusive with `https.ca.pem`. "
|
|
884
|
+
"Defaults: "
|
|
885
|
+
"On Windows the system's CA certificates are automatically looked "
|
|
886
|
+
"up in the Windows Root certificate store. "
|
|
887
|
+
"On Mac OSX this configuration defaults to `probe`. "
|
|
888
|
+
"It is recommended to install openssl using Homebrew, "
|
|
889
|
+
"to provide CA certificates. "
|
|
890
|
+
"On Linux install the distribution's ca-certificates package. "
|
|
891
|
+
"If OpenSSL is statically linked or `https.ca.location` is set to "
|
|
892
|
+
"`probe` a list of standard paths will be probed and the first one "
|
|
893
|
+
"found will be used as the default CA certificate location path. "
|
|
894
|
+
"If OpenSSL is dynamically linked the OpenSSL library's default "
|
|
895
|
+
"path will be used (see `OPENSSLDIR` in `openssl version -a`).",
|
|
896
|
+
_UNSUPPORTED_HTTPS},
|
|
897
|
+
{_RK_GLOBAL, "https.ca.pem", _RK_C_STR, _RK(https.ca_pem),
|
|
898
|
+
"CA certificate string (PEM format) for verifying HTTPS endpoints. "
|
|
899
|
+
"Mutually exclusive with `https.ca.location`. "
|
|
900
|
+
"Optional: see `https.ca.location`.",
|
|
901
|
+
_UNSUPPORTED_HTTPS},
|
|
828
902
|
{_RK_GLOBAL | _RK_SENSITIVE, "ssl.ca.pem", _RK_C_STR, _RK(ssl.ca_pem),
|
|
829
903
|
"CA certificate string (PEM format) for verifying the broker's key.",
|
|
830
904
|
_UNSUPPORTED_SSL},
|
|
@@ -889,7 +963,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
889
963
|
"OpenSSL >= 1.0.2 required.",
|
|
890
964
|
.vdef = RD_KAFKA_SSL_ENDPOINT_ID_HTTPS,
|
|
891
965
|
.s2i = {{RD_KAFKA_SSL_ENDPOINT_ID_NONE, "none"},
|
|
892
|
-
|
|
966
|
+
{RD_KAFKA_SSL_ENDPOINT_ID_HTTPS, "https"}},
|
|
893
967
|
_UNSUPPORTED_OPENSSL_1_0_2},
|
|
894
968
|
{_RK_GLOBAL, "ssl.certificate.verify_cb", _RK_C_PTR,
|
|
895
969
|
_RK(ssl.cert_verify_cb),
|
|
@@ -1009,7 +1083,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1009
1083
|
"and `sasl.oauthbearer.token.endpoint.url`.",
|
|
1010
1084
|
.vdef = RD_KAFKA_SASL_OAUTHBEARER_METHOD_DEFAULT,
|
|
1011
1085
|
.s2i = {{RD_KAFKA_SASL_OAUTHBEARER_METHOD_DEFAULT, "default"},
|
|
1012
|
-
|
|
1086
|
+
{RD_KAFKA_SASL_OAUTHBEARER_METHOD_OIDC, "oidc"}},
|
|
1013
1087
|
_UNSUPPORTED_OIDC},
|
|
1014
1088
|
{_RK_GLOBAL, "sasl.oauthbearer.client.id", _RK_C_STR,
|
|
1015
1089
|
_RK(sasl.oauthbearer.client_id),
|
|
@@ -1018,7 +1092,11 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1018
1092
|
"authorization server handles. "
|
|
1019
1093
|
"Only used when `sasl.oauthbearer.method` is set to \"oidc\".",
|
|
1020
1094
|
_UNSUPPORTED_OIDC},
|
|
1021
|
-
{_RK_GLOBAL, "sasl.oauthbearer.client.
|
|
1095
|
+
{_RK_GLOBAL, "sasl.oauthbearer.client.credentials.client.id", _RK_C_ALIAS,
|
|
1096
|
+
.sdef = "sasl.oauthbearer.client.id"},
|
|
1097
|
+
{_RK_GLOBAL, "sasl.oauthbearer.client.credentials.client.secret",
|
|
1098
|
+
_RK_C_ALIAS, .sdef = "sasl.oauthbearer.client.secret"},
|
|
1099
|
+
{_RK_GLOBAL | _RK_SENSITIVE, "sasl.oauthbearer.client.secret", _RK_C_STR,
|
|
1022
1100
|
_RK(sasl.oauthbearer.client_secret),
|
|
1023
1101
|
"Client secret only known to the application and the "
|
|
1024
1102
|
"authorization server. This should be a sufficiently random string "
|
|
@@ -1043,6 +1121,113 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1043
1121
|
"OAuth/OIDC issuer token endpoint HTTP(S) URI used to retrieve token. "
|
|
1044
1122
|
"Only used when `sasl.oauthbearer.method` is set to \"oidc\".",
|
|
1045
1123
|
_UNSUPPORTED_OIDC},
|
|
1124
|
+
{
|
|
1125
|
+
_RK_GLOBAL,
|
|
1126
|
+
"sasl.oauthbearer.grant.type",
|
|
1127
|
+
_RK_C_S2I,
|
|
1128
|
+
_RK(sasl.oauthbearer.grant_type),
|
|
1129
|
+
"OAuth grant type to use when communicating with the identity "
|
|
1130
|
+
"provider.",
|
|
1131
|
+
_UNSUPPORTED_OIDC,
|
|
1132
|
+
.vdef = RD_KAFKA_SASL_OAUTHBEARER_GRANT_TYPE_CLIENT_CREDENTIALS,
|
|
1133
|
+
.s2i = {{RD_KAFKA_SASL_OAUTHBEARER_GRANT_TYPE_CLIENT_CREDENTIALS,
|
|
1134
|
+
"client_credentials"},
|
|
1135
|
+
{RD_KAFKA_SASL_OAUTHBEARER_GRANT_TYPE_JWT_BEARER,
|
|
1136
|
+
"urn:ietf:params:oauth:grant-type:jwt-bearer"}},
|
|
1137
|
+
},
|
|
1138
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.algorithm", _RK_C_S2I,
|
|
1139
|
+
_RK(sasl.oauthbearer.assertion.algorithm),
|
|
1140
|
+
"Algorithm the client should use to sign the assertion sent "
|
|
1141
|
+
"to the identity provider and in the OAuth alg header in the JWT "
|
|
1142
|
+
"assertion.",
|
|
1143
|
+
_UNSUPPORTED_OIDC,
|
|
1144
|
+
.vdef = RD_KAFKA_SASL_OAUTHBEARER_ASSERTION_ALGORITHM_RS256,
|
|
1145
|
+
.s2i = {{RD_KAFKA_SASL_OAUTHBEARER_ASSERTION_ALGORITHM_RS256, "RS256"},
|
|
1146
|
+
{RD_KAFKA_SASL_OAUTHBEARER_ASSERTION_ALGORITHM_ES256, "ES256"}}},
|
|
1147
|
+
{_RK_GLOBAL | _RK_SENSITIVE, "sasl.oauthbearer.assertion.private.key.file",
|
|
1148
|
+
_RK_C_STR, _RK(sasl.oauthbearer.assertion.private_key.file),
|
|
1149
|
+
"Path to client's private key (PEM) used for authentication "
|
|
1150
|
+
"when using the JWT assertion.",
|
|
1151
|
+
_UNSUPPORTED_OIDC},
|
|
1152
|
+
{_RK_GLOBAL | _RK_SENSITIVE,
|
|
1153
|
+
"sasl.oauthbearer.assertion.private.key.passphrase", _RK_C_STR,
|
|
1154
|
+
_RK(sasl.oauthbearer.assertion.private_key.passphrase),
|
|
1155
|
+
"Private key passphrase for `sasl.oauthbearer.assertion.private.key.file`"
|
|
1156
|
+
" or `sasl.oauthbearer.assertion.private.key.pem`.",
|
|
1157
|
+
_UNSUPPORTED_OIDC},
|
|
1158
|
+
{_RK_GLOBAL | _RK_SENSITIVE, "sasl.oauthbearer.assertion.private.key.pem",
|
|
1159
|
+
_RK_C_STR, _RK(sasl.oauthbearer.assertion.private_key.pem),
|
|
1160
|
+
"Client's private key (PEM) used for authentication "
|
|
1161
|
+
"when using the JWT assertion.",
|
|
1162
|
+
_UNSUPPORTED_OIDC},
|
|
1163
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.file", _RK_C_STR,
|
|
1164
|
+
_RK(sasl.oauthbearer.assertion.file),
|
|
1165
|
+
"Path to the assertion file. "
|
|
1166
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1167
|
+
"assertion is needed.",
|
|
1168
|
+
_UNSUPPORTED_OIDC},
|
|
1169
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.aud", _RK_C_STR,
|
|
1170
|
+
_RK(sasl.oauthbearer.assertion.claim.audience),
|
|
1171
|
+
"JWT audience claim. "
|
|
1172
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1173
|
+
"assertion is needed.",
|
|
1174
|
+
_UNSUPPORTED_OIDC},
|
|
1175
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.exp.seconds", _RK_C_INT,
|
|
1176
|
+
_RK(sasl.oauthbearer.assertion.claim.expiration_s),
|
|
1177
|
+
"Assertion expiration time in seconds. "
|
|
1178
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1179
|
+
"assertion is needed.",
|
|
1180
|
+
1, INT_MAX, 300, _UNSUPPORTED_OIDC},
|
|
1181
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.iss", _RK_C_STR,
|
|
1182
|
+
_RK(sasl.oauthbearer.assertion.claim.issuer),
|
|
1183
|
+
"JWT issuer claim. "
|
|
1184
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1185
|
+
"assertion is needed.",
|
|
1186
|
+
_UNSUPPORTED_OIDC},
|
|
1187
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.jti.include", _RK_C_BOOL,
|
|
1188
|
+
_RK(sasl.oauthbearer.assertion.claim.jti_include),
|
|
1189
|
+
"JWT ID claim. When set to `true`, a random UUID is generated. "
|
|
1190
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1191
|
+
"assertion is needed.",
|
|
1192
|
+
0, 1, 0, _UNSUPPORTED_OIDC},
|
|
1193
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.nbf.seconds", _RK_C_INT,
|
|
1194
|
+
_RK(sasl.oauthbearer.assertion.claim.not_before_s),
|
|
1195
|
+
"Assertion not before time in seconds. "
|
|
1196
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1197
|
+
"assertion is needed.",
|
|
1198
|
+
0, INT_MAX, 60, _UNSUPPORTED_OIDC},
|
|
1199
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.claim.sub", _RK_C_STR,
|
|
1200
|
+
_RK(sasl.oauthbearer.assertion.claim.subject),
|
|
1201
|
+
"JWT subject claim. "
|
|
1202
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1203
|
+
"assertion is needed.",
|
|
1204
|
+
_UNSUPPORTED_OIDC},
|
|
1205
|
+
{_RK_GLOBAL, "sasl.oauthbearer.assertion.jwt.template.file", _RK_C_STR,
|
|
1206
|
+
_RK(sasl.oauthbearer.assertion.jwt_template_file),
|
|
1207
|
+
"Path to the JWT template file. "
|
|
1208
|
+
"Only used when `sasl.oauthbearer.method` is set to \"oidc\" and JWT "
|
|
1209
|
+
"assertion is needed.",
|
|
1210
|
+
_UNSUPPORTED_OIDC},
|
|
1211
|
+
{
|
|
1212
|
+
_RK_GLOBAL,
|
|
1213
|
+
"sasl.oauthbearer.metadata.authentication.type",
|
|
1214
|
+
_RK_C_S2I,
|
|
1215
|
+
_RK(sasl.oauthbearer.metadata_authentication.type),
|
|
1216
|
+
"Type of metadata-based authentication to use for OAUTHBEARER/OIDC "
|
|
1217
|
+
"`azure_imds` authenticates using the Azure IMDS endpoint. "
|
|
1218
|
+
"Sets a default value for `sasl.oauthbearer.token.endpoint.url` if "
|
|
1219
|
+
"missing. "
|
|
1220
|
+
"Configuration values specific of chosen authentication type can be "
|
|
1221
|
+
"passed "
|
|
1222
|
+
"through `sasl.oauthbearer.config`.",
|
|
1223
|
+
_UNSUPPORTED_OIDC,
|
|
1224
|
+
.vdef = RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_NONE,
|
|
1225
|
+
.s2i =
|
|
1226
|
+
{{RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_NONE,
|
|
1227
|
+
"none"},
|
|
1228
|
+
{RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_AZURE_IMDS,
|
|
1229
|
+
"azure_imds"}},
|
|
1230
|
+
},
|
|
1046
1231
|
|
|
1047
1232
|
/* Plugins */
|
|
1048
1233
|
{_RK_GLOBAL, "plugin.library.paths", _RK_C_STR, _RK(plugin_paths),
|
|
@@ -1110,9 +1295,10 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1110
1295
|
"members of the group to assign partitions to group members. If "
|
|
1111
1296
|
"there is more than one eligible strategy, preference is "
|
|
1112
1297
|
"determined by the order of this list (strategies earlier in the "
|
|
1113
|
-
"list have higher priority). "
|
|
1114
|
-
"
|
|
1115
|
-
"
|
|
1298
|
+
"list have higher priority). Cooperative and non-cooperative (eager)"
|
|
1299
|
+
"strategies must not be mixed. `partition.assignment.strategy` is not "
|
|
1300
|
+
"supported for "
|
|
1301
|
+
"`group.protocol=consumer`. Use `group.remote.assignor` instead. "
|
|
1116
1302
|
"Available strategies: range, roundrobin, cooperative-sticky.",
|
|
1117
1303
|
.sdef = "range,roundrobin"},
|
|
1118
1304
|
{_RK_GLOBAL | _RK_CGRP | _RK_HIGH, "session.timeout.ms", _RK_C_INT,
|
|
@@ -1122,20 +1308,35 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1122
1308
|
"to indicate its liveness to the broker. If no hearts are "
|
|
1123
1309
|
"received by the broker for a group member within the "
|
|
1124
1310
|
"session timeout, the broker will remove the consumer from "
|
|
1125
|
-
"the group and trigger a rebalance. "
|
|
1126
|
-
"
|
|
1311
|
+
"the group and trigger a rebalance. The "
|
|
1312
|
+
"allowed range is configured with the **broker** configuration "
|
|
1127
1313
|
"properties `group.min.session.timeout.ms` and "
|
|
1128
|
-
"`group.max.session.timeout.ms`. "
|
|
1314
|
+
"`group.max.session.timeout.ms`. `session.timeout.ms` is not supported "
|
|
1315
|
+
"for `group.protocol=consumer`. It is set with the broker configuration "
|
|
1316
|
+
"property "
|
|
1317
|
+
"`group.consumer.session.timeout.ms` by default or can be configured "
|
|
1318
|
+
"through the AdminClient IncrementalAlterConfigs API. "
|
|
1319
|
+
"The allowed range is configured with the broker configuration "
|
|
1320
|
+
"properties `group.consumer.min.session.timeout.ms` and "
|
|
1321
|
+
"`group.consumer.max.session.timeout.ms`. "
|
|
1129
1322
|
"Also see `max.poll.interval.ms`.",
|
|
1130
1323
|
1, 3600 * 1000, 45 * 1000},
|
|
1131
1324
|
{_RK_GLOBAL | _RK_CGRP, "heartbeat.interval.ms", _RK_C_INT,
|
|
1132
1325
|
_RK(group_heartbeat_intvl_ms),
|
|
1133
|
-
"Group session keepalive heartbeat interval."
|
|
1326
|
+
"Group session keepalive heartbeat interval. "
|
|
1327
|
+
"`heartbeat.interval.ms` is not supported for `group.protocol=consumer`. "
|
|
1328
|
+
"It is set with the broker configuration property "
|
|
1329
|
+
"`group.consumer.heartbeat.interval.ms` by default or can be configured "
|
|
1330
|
+
"through the AdminClient IncrementalAlterConfigs API. The allowed range "
|
|
1331
|
+
"is configured with the broker configuration properties "
|
|
1332
|
+
"`group.consumer.min.heartbeat.interval.ms` and "
|
|
1333
|
+
"`group.consumer.max.heartbeat.interval.ms`.",
|
|
1334
|
+
1, 3600 * 1000, 3 * 1000},
|
|
1134
1335
|
{_RK_GLOBAL | _RK_CGRP, "group.protocol.type", _RK_C_KSTR,
|
|
1135
1336
|
_RK(group_protocol_type),
|
|
1136
1337
|
"Group protocol type for the `classic` group protocol. NOTE: Currently, "
|
|
1137
|
-
"the only supported group "
|
|
1138
|
-
"protocol
|
|
1338
|
+
"the only supported group protocol type is `consumer`. "
|
|
1339
|
+
"`group.protocol.type` is not supported for `group.protocol=consumer`",
|
|
1139
1340
|
.sdef = "consumer"},
|
|
1140
1341
|
{_RK_GLOBAL | _RK_CGRP | _RK_HIGH, "group.protocol", _RK_C_S2I,
|
|
1141
1342
|
_RK(group_protocol),
|
|
@@ -1146,7 +1347,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1146
1347
|
"but will change to `consumer` in next releases.",
|
|
1147
1348
|
.vdef = RD_KAFKA_GROUP_PROTOCOL_CLASSIC,
|
|
1148
1349
|
.s2i = {{RD_KAFKA_GROUP_PROTOCOL_CLASSIC, "classic"},
|
|
1149
|
-
|
|
1350
|
+
{RD_KAFKA_GROUP_PROTOCOL_CONSUMER, "consumer"}}},
|
|
1150
1351
|
{_RK_GLOBAL | _RK_CGRP | _RK_MED, "group.remote.assignor", _RK_C_STR,
|
|
1151
1352
|
_RK(group_remote_assignor),
|
|
1152
1353
|
"Server side assignor to use. Keep it null to make server select a "
|
|
@@ -1272,8 +1473,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1272
1473
|
"(requires Apache Kafka 0.8.2 or later on the broker).",
|
|
1273
1474
|
.vdef = RD_KAFKA_OFFSET_METHOD_BROKER,
|
|
1274
1475
|
.s2i = {{RD_KAFKA_OFFSET_METHOD_NONE, "none"},
|
|
1275
|
-
|
|
1276
|
-
|
|
1476
|
+
{RD_KAFKA_OFFSET_METHOD_FILE, "file"},
|
|
1477
|
+
{RD_KAFKA_OFFSET_METHOD_BROKER, "broker"}}},
|
|
1277
1478
|
{_RK_GLOBAL | _RK_CONSUMER | _RK_HIGH, "isolation.level", _RK_C_S2I,
|
|
1278
1479
|
_RK(isolation_level),
|
|
1279
1480
|
"Controls how to read messages written transactionally: "
|
|
@@ -1282,7 +1483,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1282
1483
|
"transactional messages which have been aborted.",
|
|
1283
1484
|
.vdef = RD_KAFKA_READ_COMMITTED,
|
|
1284
1485
|
.s2i = {{RD_KAFKA_READ_UNCOMMITTED, "read_uncommitted"},
|
|
1285
|
-
|
|
1486
|
+
{RD_KAFKA_READ_COMMITTED, "read_committed"}}},
|
|
1286
1487
|
{_RK_GLOBAL | _RK_CONSUMER, "consume_cb", _RK_C_PTR, _RK(consume_cb),
|
|
1287
1488
|
"Message consume callback (set with rd_kafka_conf_set_consume_cb())"},
|
|
1288
1489
|
{_RK_GLOBAL | _RK_CONSUMER, "rebalance_cb", _RK_C_PTR, _RK(rebalance_cb),
|
|
@@ -1365,7 +1566,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1365
1566
|
{_RK_GLOBAL | _RK_PRODUCER | _RK_HIGH, "queue.buffering.max.messages",
|
|
1366
1567
|
_RK_C_INT, _RK(queue_buffering_max_msgs),
|
|
1367
1568
|
"Maximum number of messages allowed on the producer queue. "
|
|
1368
|
-
"This queue is shared by all topics and partitions. A value of 0
|
|
1569
|
+
"This queue is shared by all topics and partitions. A value of 0 "
|
|
1570
|
+
"disables "
|
|
1369
1571
|
"this limit.",
|
|
1370
1572
|
0, INT_MAX, 100000},
|
|
1371
1573
|
{_RK_GLOBAL | _RK_PRODUCER | _RK_HIGH, "queue.buffering.max.kbytes",
|
|
@@ -1403,7 +1605,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1403
1605
|
|
|
1404
1606
|
{_RK_GLOBAL | _RK_MED, "retry.backoff.max.ms", _RK_C_INT,
|
|
1405
1607
|
_RK(retry_backoff_max_ms),
|
|
1406
|
-
"The max backoff time in milliseconds before retrying a protocol
|
|
1608
|
+
"The max backoff time in milliseconds before retrying a protocol "
|
|
1609
|
+
"request, "
|
|
1407
1610
|
"this is the atmost backoff allowed for exponentially backed off "
|
|
1408
1611
|
"requests.",
|
|
1409
1612
|
1, 300 * 1000, 1000},
|
|
@@ -1427,11 +1630,11 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1427
1630
|
"the topic configuration property `compression.codec`. ",
|
|
1428
1631
|
.vdef = RD_KAFKA_COMPRESSION_NONE,
|
|
1429
1632
|
.s2i = {{RD_KAFKA_COMPRESSION_NONE, "none"},
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1633
|
+
{RD_KAFKA_COMPRESSION_GZIP, "gzip", _UNSUPPORTED_ZLIB},
|
|
1634
|
+
{RD_KAFKA_COMPRESSION_SNAPPY, "snappy", _UNSUPPORTED_SNAPPY},
|
|
1635
|
+
{RD_KAFKA_COMPRESSION_LZ4, "lz4"},
|
|
1636
|
+
{RD_KAFKA_COMPRESSION_ZSTD, "zstd", _UNSUPPORTED_ZSTD},
|
|
1637
|
+
{0}}},
|
|
1435
1638
|
{_RK_GLOBAL | _RK_PRODUCER | _RK_MED, "compression.type", _RK_C_ALIAS,
|
|
1436
1639
|
.sdef = "compression.codec"},
|
|
1437
1640
|
{_RK_GLOBAL | _RK_PRODUCER | _RK_MED, "batch.num.messages", _RK_C_INT,
|
|
@@ -1472,7 +1675,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1472
1675
|
0, 900000, 10},
|
|
1473
1676
|
{_RK_GLOBAL, "client.dns.lookup", _RK_C_S2I, _RK(client_dns_lookup),
|
|
1474
1677
|
"Controls how the client uses DNS lookups. By default, when the lookup "
|
|
1475
|
-
"returns multiple IP addresses for a hostname, they will all be
|
|
1678
|
+
"returns multiple IP addresses for a hostname, they will all be "
|
|
1679
|
+
"attempted "
|
|
1476
1680
|
"for connection before the connection is considered failed. This applies "
|
|
1477
1681
|
"to both bootstrap and advertised servers. If the value is set to "
|
|
1478
1682
|
"`resolve_canonical_bootstrap_servers_only`, each entry will be resolved "
|
|
@@ -1485,8 +1689,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1485
1689
|
"hostname. ",
|
|
1486
1690
|
.vdef = RD_KAFKA_USE_ALL_DNS_IPS,
|
|
1487
1691
|
.s2i = {{RD_KAFKA_USE_ALL_DNS_IPS, "use_all_dns_ips"},
|
|
1488
|
-
|
|
1489
|
-
|
|
1692
|
+
{RD_KAFKA_RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY,
|
|
1693
|
+
"resolve_canonical_bootstrap_servers_only"}}},
|
|
1490
1694
|
{_RK_GLOBAL, "enable.metrics.push", _RK_C_BOOL, _RK(enable_metrics_push),
|
|
1491
1695
|
"Whether to enable pushing of client metrics to the cluster, if the "
|
|
1492
1696
|
"cluster has a client metrics subscription which matches this client",
|
|
@@ -1558,7 +1762,8 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1558
1762
|
"`murmur2_random` - Java Producer compatible Murmur2 hash of key "
|
|
1559
1763
|
"(NULL keys are randomly partitioned. This is functionally equivalent "
|
|
1560
1764
|
"to the default partitioner in the Java Producer.), "
|
|
1561
|
-
"`fnv1a` - FNV-1a hash of key (NULL keys are mapped to single
|
|
1765
|
+
"`fnv1a` - FNV-1a hash of key (NULL keys are mapped to single "
|
|
1766
|
+
"partition), "
|
|
1562
1767
|
"`fnv1a_random` - FNV-1a hash of key (NULL keys are randomly "
|
|
1563
1768
|
"partitioned).",
|
|
1564
1769
|
.sdef = "consistent_random",
|
|
@@ -1579,12 +1784,12 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1579
1784
|
"inherit = inherit global compression.codec configuration.",
|
|
1580
1785
|
.vdef = RD_KAFKA_COMPRESSION_INHERIT,
|
|
1581
1786
|
.s2i = {{RD_KAFKA_COMPRESSION_NONE, "none"},
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1787
|
+
{RD_KAFKA_COMPRESSION_GZIP, "gzip", _UNSUPPORTED_ZLIB},
|
|
1788
|
+
{RD_KAFKA_COMPRESSION_SNAPPY, "snappy", _UNSUPPORTED_SNAPPY},
|
|
1789
|
+
{RD_KAFKA_COMPRESSION_LZ4, "lz4"},
|
|
1790
|
+
{RD_KAFKA_COMPRESSION_ZSTD, "zstd", _UNSUPPORTED_ZSTD},
|
|
1791
|
+
{RD_KAFKA_COMPRESSION_INHERIT, "inherit"},
|
|
1792
|
+
{0}}},
|
|
1588
1793
|
{_RK_TOPIC | _RK_PRODUCER | _RK_HIGH, "compression.type", _RK_C_ALIAS,
|
|
1589
1794
|
.sdef = "compression.codec"},
|
|
1590
1795
|
{_RK_TOPIC | _RK_PRODUCER | _RK_MED, "compression.level", _RK_C_INT,
|
|
@@ -1668,7 +1873,7 @@ static const struct rd_kafka_property rd_kafka_properties[] = {
|
|
|
1668
1873
|
"Apache Kafka 0.8.2 or later on the broker.).",
|
|
1669
1874
|
.vdef = RD_KAFKA_OFFSET_METHOD_BROKER,
|
|
1670
1875
|
.s2i = {{RD_KAFKA_OFFSET_METHOD_FILE, "file"},
|
|
1671
|
-
|
|
1876
|
+
{RD_KAFKA_OFFSET_METHOD_BROKER, "broker"}}},
|
|
1672
1877
|
|
|
1673
1878
|
{_RK_TOPIC | _RK_CONSUMER, "consume.callback.max.messages", _RK_C_INT,
|
|
1674
1879
|
_RKT(consume_callback_max_msgs),
|
|
@@ -2328,7 +2533,7 @@ static int rd_kafka_anyconf_set(int scope,
|
|
|
2328
2533
|
const struct rd_kafka_property *_prop; \
|
|
2329
2534
|
rd_kafka_conf_res_t _res; \
|
|
2330
2535
|
_prop = rd_kafka_conf_prop_find(SCOPE, NAME); \
|
|
2331
|
-
rd_assert(_prop && *
|
|
2536
|
+
rd_assert(_prop && *"invalid property name"); \
|
|
2332
2537
|
_res = rd_kafka_anyconf_set_prop( \
|
|
2333
2538
|
SCOPE, CONF, _prop, (const void *)VALUE, \
|
|
2334
2539
|
1 /*allow-specifics*/, NULL, 0); \
|
|
@@ -3735,6 +3940,201 @@ char **rd_kafka_conf_kv_split(const char **input, size_t incnt, size_t *cntp) {
|
|
|
3735
3940
|
return out;
|
|
3736
3941
|
}
|
|
3737
3942
|
|
|
3943
|
+
/**
|
|
3944
|
+
* @brief Get value for the config param corresponding to \p key in
|
|
3945
|
+
* \p config, using \p pairs_sep for splitting it
|
|
3946
|
+
* into key-value pairs and '=' for splitting keys and values.
|
|
3947
|
+
*/
|
|
3948
|
+
char *rd_kafka_conf_kv_get(const char *config,
|
|
3949
|
+
const char *key,
|
|
3950
|
+
const char pairs_sep) {
|
|
3951
|
+
size_t i, config_pair_cnt, config_key_value_cnt;
|
|
3952
|
+
char *ret = NULL;
|
|
3953
|
+
char **config_key_values;
|
|
3954
|
+
if (!config)
|
|
3955
|
+
return NULL;
|
|
3956
|
+
|
|
3957
|
+
char **config_pairs =
|
|
3958
|
+
rd_string_split(config, pairs_sep, rd_true, &config_pair_cnt);
|
|
3959
|
+
|
|
3960
|
+
config_key_values =
|
|
3961
|
+
rd_kafka_conf_kv_split((const char **)config_pairs, config_pair_cnt,
|
|
3962
|
+
&config_key_value_cnt);
|
|
3963
|
+
for (i = 0; i < config_key_value_cnt / 2; i += 2) {
|
|
3964
|
+
char *config_key = config_key_values[i];
|
|
3965
|
+
if (!rd_strcmp(config_key, key)) {
|
|
3966
|
+
ret = rd_strdup(config_key_values[i + 1]);
|
|
3967
|
+
break;
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
rd_free(config_key_values);
|
|
3971
|
+
rd_free(config_pairs);
|
|
3972
|
+
return ret;
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
const char *
|
|
3976
|
+
rd_kafka_conf_finalize_oauthbearer_oidc_grant_type(rd_kafka_conf_t *conf) {
|
|
3977
|
+
switch (conf->sasl.oauthbearer.grant_type) {
|
|
3978
|
+
case RD_KAFKA_SASL_OAUTHBEARER_GRANT_TYPE_CLIENT_CREDENTIALS:
|
|
3979
|
+
if (!conf->sasl.oauthbearer.client_id)
|
|
3980
|
+
return "`sasl.oauthbearer.client.id` is "
|
|
3981
|
+
"mandatory when `sasl.oauthbearer.method=oidc` "
|
|
3982
|
+
"is set";
|
|
3983
|
+
|
|
3984
|
+
if (!conf->sasl.oauthbearer.client_secret) {
|
|
3985
|
+
return "`sasl.oauthbearer.client.secret` is "
|
|
3986
|
+
"mandatory when `sasl.oauthbearer.method=oidc` "
|
|
3987
|
+
"is set";
|
|
3988
|
+
}
|
|
3989
|
+
break;
|
|
3990
|
+
case RD_KAFKA_SASL_OAUTHBEARER_GRANT_TYPE_JWT_BEARER:
|
|
3991
|
+
if (conf->sasl.oauthbearer.assertion.file) {
|
|
3992
|
+
if (conf->sasl.oauthbearer.assertion.private_key.file)
|
|
3993
|
+
return "Mutually exclusive properties set. "
|
|
3994
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
3995
|
+
"`sasl.oauthbearer.assertion.private."
|
|
3996
|
+
"key.file` cannot both be set";
|
|
3997
|
+
|
|
3998
|
+
if (conf->sasl.oauthbearer.assertion.private_key.pem)
|
|
3999
|
+
return "Mutually exclusive properties set. "
|
|
4000
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4001
|
+
"`sasl.oauthbearer.assertion.private."
|
|
4002
|
+
"key.pem` cannot both be set";
|
|
4003
|
+
|
|
4004
|
+
if (conf->sasl.oauthbearer.assertion.private_key
|
|
4005
|
+
.passphrase)
|
|
4006
|
+
return "Mutually exclusive properties set. "
|
|
4007
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4008
|
+
"`sasl.oauthbearer.assertion.private."
|
|
4009
|
+
"key.passphrase` cannot both be set";
|
|
4010
|
+
|
|
4011
|
+
if (conf->sasl.oauthbearer.assertion.jwt_template_file)
|
|
4012
|
+
return "Mutually exclusive properties set. "
|
|
4013
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4014
|
+
"`sasl.oauthbearer.assertion."
|
|
4015
|
+
"jwt.template.file` cannot both be set";
|
|
4016
|
+
|
|
4017
|
+
if (conf->sasl.oauthbearer.assertion.claim.subject)
|
|
4018
|
+
return "Mutually exclusive properties set. "
|
|
4019
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4020
|
+
"`sasl.oauthbearer.assertion."
|
|
4021
|
+
"claim.sub` cannot both be set";
|
|
4022
|
+
|
|
4023
|
+
if (conf->sasl.oauthbearer.assertion.claim.audience)
|
|
4024
|
+
return "Mutually exclusive properties set. "
|
|
4025
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4026
|
+
"`sasl.oauthbearer.assertion."
|
|
4027
|
+
"claim.aud` cannot both be set";
|
|
4028
|
+
|
|
4029
|
+
if (conf->sasl.oauthbearer.assertion.claim.issuer)
|
|
4030
|
+
return "Mutually exclusive properties set. "
|
|
4031
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4032
|
+
"`sasl.oauthbearer.assertion."
|
|
4033
|
+
"claim.iss` cannot both be set";
|
|
4034
|
+
|
|
4035
|
+
if (rd_kafka_conf_is_modified(
|
|
4036
|
+
conf,
|
|
4037
|
+
"sasl.oauthbearer."
|
|
4038
|
+
"assertion.claim.jti.include"))
|
|
4039
|
+
return "Mutually exclusive properties set. "
|
|
4040
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4041
|
+
"`sasl.oauthbearer.assertion."
|
|
4042
|
+
"claim.jti.include` cannot both be set";
|
|
4043
|
+
|
|
4044
|
+
if (rd_kafka_conf_is_modified(
|
|
4045
|
+
conf,
|
|
4046
|
+
"sasl.oauthbearer."
|
|
4047
|
+
"assertion.claim.exp.seconds"))
|
|
4048
|
+
return "Mutually exclusive properties set. "
|
|
4049
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4050
|
+
"`sasl.oauthbearer.assertion."
|
|
4051
|
+
"claim.exp.seconds` cannot both be set";
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
if (rd_kafka_conf_is_modified(
|
|
4055
|
+
conf,
|
|
4056
|
+
"sasl.oauthbearer."
|
|
4057
|
+
"assertion.claim.nbf.seconds"))
|
|
4058
|
+
return "Mutually exclusive properties set. "
|
|
4059
|
+
"`sasl.oauthbearer.assertion.file` and "
|
|
4060
|
+
"`sasl.oauthbearer.assertion."
|
|
4061
|
+
"claim.nbf.seconds` cannot both be set";
|
|
4062
|
+
} else {
|
|
4063
|
+
if (conf->sasl.oauthbearer.assertion.private_key.file &&
|
|
4064
|
+
conf->sasl.oauthbearer.assertion.private_key.pem)
|
|
4065
|
+
return "Mutually exclusive properties set. "
|
|
4066
|
+
"`sasl.oauthbearer.assertion.private."
|
|
4067
|
+
"key.file` and "
|
|
4068
|
+
"`sasl.oauthbearer.assertion.private."
|
|
4069
|
+
"key.pem` cannot both be set";
|
|
4070
|
+
|
|
4071
|
+
if (!conf->sasl.oauthbearer.assertion.private_key
|
|
4072
|
+
.file &&
|
|
4073
|
+
!conf->sasl.oauthbearer.assertion.private_key.pem)
|
|
4074
|
+
return "`sasl.oauthbearer.assertion.private."
|
|
4075
|
+
"key.file` or "
|
|
4076
|
+
"`sasl.oauthbearer.assertion.private."
|
|
4077
|
+
"key.pem` is mandatory when "
|
|
4078
|
+
"`sasl.oauthbearer.grant.type` "
|
|
4079
|
+
"is set to "
|
|
4080
|
+
"`urn:ietf:params:oauth:grant-"
|
|
4081
|
+
"type:jwt-bearer`";
|
|
4082
|
+
}
|
|
4083
|
+
break;
|
|
4084
|
+
default:
|
|
4085
|
+
break;
|
|
4086
|
+
}
|
|
4087
|
+
return NULL;
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
const char *rd_kafka_conf_finalize_oauthbearer_oidc(rd_kafka_conf_t *conf) {
|
|
4091
|
+
const char *errstr;
|
|
4092
|
+
if (conf->sasl.oauthbearer.method !=
|
|
4093
|
+
RD_KAFKA_SASL_OAUTHBEARER_METHOD_OIDC)
|
|
4094
|
+
return NULL;
|
|
4095
|
+
|
|
4096
|
+
if (conf->sasl.enable_oauthbearer_unsecure_jwt)
|
|
4097
|
+
return "`enable.sasl.oauthbearer.unsecure.jwt` and "
|
|
4098
|
+
"`sasl.oauthbearer.method=oidc` are "
|
|
4099
|
+
"mutually exclusive";
|
|
4100
|
+
|
|
4101
|
+
if (!conf->sasl.oauthbearer.token_endpoint_url) {
|
|
4102
|
+
const char *errstr =
|
|
4103
|
+
"`sasl.oauthbearer.token.endpoint.url` "
|
|
4104
|
+
"is mandatory when "
|
|
4105
|
+
"`sasl.oauthbearer.method=oidc` is set";
|
|
4106
|
+
if (conf->sasl.oauthbearer.metadata_authentication.type ==
|
|
4107
|
+
RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_AZURE_IMDS) {
|
|
4108
|
+
char *query = rd_kafka_conf_kv_get(
|
|
4109
|
+
conf->sasl.oauthbearer_config, "query", ',');
|
|
4110
|
+
if (!query)
|
|
4111
|
+
return "`sasl.oauthbearer.token.endpoint.url` "
|
|
4112
|
+
"is mandatory for Azure IMDS "
|
|
4113
|
+
"authentication "
|
|
4114
|
+
"when `query` isn't set";
|
|
4115
|
+
rd_free(query);
|
|
4116
|
+
} else {
|
|
4117
|
+
return errstr;
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
if (conf->sasl.oauthbearer.metadata_authentication.type ==
|
|
4122
|
+
RD_KAFKA_SASL_OAUTHBEARER_METADATA_AUTHENTICATION_TYPE_NONE) {
|
|
4123
|
+
if ((errstr =
|
|
4124
|
+
rd_kafka_conf_finalize_oauthbearer_oidc_grant_type(
|
|
4125
|
+
conf))) {
|
|
4126
|
+
return errstr;
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
/* Enable background thread for the builtin OIDC handler,
|
|
4131
|
+
* unless a refresh callback has been set. */
|
|
4132
|
+
if (!conf->sasl.oauthbearer.token_refresh_cb) {
|
|
4133
|
+
conf->enabled_events |= RD_KAFKA_EVENT_BACKGROUND;
|
|
4134
|
+
conf->sasl.enable_callback_queue = 1;
|
|
4135
|
+
}
|
|
4136
|
+
return NULL;
|
|
4137
|
+
}
|
|
3738
4138
|
|
|
3739
4139
|
/**
|
|
3740
4140
|
* @brief Verify configuration \p conf is
|
|
@@ -3776,10 +4176,33 @@ const char *rd_kafka_conf_finalize(rd_kafka_type_t cltype,
|
|
|
3776
4176
|
if (conf->ssl.ca && (conf->ssl.ca_location || conf->ssl.ca_pem))
|
|
3777
4177
|
return "`ssl.ca.location` or `ssl.ca.pem`, and memory-based "
|
|
3778
4178
|
"set_ssl_cert(CERT_CA) are mutually exclusive.";
|
|
4179
|
+
|
|
4180
|
+
#if WITH_OAUTHBEARER_OIDC
|
|
4181
|
+
if (conf->https.ca_location && conf->https.ca_pem)
|
|
4182
|
+
return "`https.ca.location` and `https.ca.pem` "
|
|
4183
|
+
"are mutually exclusive";
|
|
4184
|
+
|
|
4185
|
+
if (conf->https.ca_location &&
|
|
4186
|
+
rd_strcmp(conf->https.ca_location, "probe") &&
|
|
4187
|
+
!rd_file_stat(conf->https.ca_location, NULL))
|
|
4188
|
+
return "`https.ca.location` must be "
|
|
4189
|
+
"an existing file or directory";
|
|
4190
|
+
|
|
4191
|
+
#if !CURL_AT_LEAST_VERSION(7, 77, 0)
|
|
4192
|
+
if (conf->https.ca_pem)
|
|
4193
|
+
return "`https.ca.pem` requires libcurl 7.77.0 or later";
|
|
4194
|
+
#endif
|
|
4195
|
+
#endif
|
|
4196
|
+
|
|
4197
|
+
|
|
3779
4198
|
#ifdef __APPLE__
|
|
3780
4199
|
else if (!conf->ssl.ca && !conf->ssl.ca_location && !conf->ssl.ca_pem)
|
|
3781
4200
|
/* Default ssl.ca.location to 'probe' on OSX */
|
|
3782
4201
|
rd_kafka_conf_set(conf, "ssl.ca.location", "probe", NULL, 0);
|
|
4202
|
+
|
|
4203
|
+
/* Default https.ca.location to 'probe' on OSX */
|
|
4204
|
+
if (!conf->https.ca_location && !conf->https.ca_pem)
|
|
4205
|
+
rd_kafka_conf_set(conf, "https.ca.location", "probe", NULL, 0);
|
|
3783
4206
|
#endif
|
|
3784
4207
|
#endif
|
|
3785
4208
|
|
|
@@ -3791,46 +4214,51 @@ const char *rd_kafka_conf_finalize(rd_kafka_type_t cltype,
|
|
|
3791
4214
|
"`oauthbearer_token_refresh_cb` are "
|
|
3792
4215
|
"mutually exclusive";
|
|
3793
4216
|
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
"`sasl.oauthbearer.method=oidc` are "
|
|
3799
|
-
"mutually exclusive";
|
|
4217
|
+
errstr = rd_kafka_conf_finalize_oauthbearer_oidc(conf);
|
|
4218
|
+
if (errstr)
|
|
4219
|
+
return errstr;
|
|
4220
|
+
}
|
|
3800
4221
|
|
|
3801
|
-
|
|
3802
|
-
RD_KAFKA_SASL_OAUTHBEARER_METHOD_OIDC) {
|
|
3803
|
-
if (!conf->sasl.oauthbearer.client_id)
|
|
3804
|
-
return "`sasl.oauthbearer.client.id` is "
|
|
3805
|
-
"mandatory when "
|
|
3806
|
-
"`sasl.oauthbearer.method=oidc` is set";
|
|
3807
|
-
|
|
3808
|
-
if (!conf->sasl.oauthbearer.client_secret) {
|
|
3809
|
-
return "`sasl.oauthbearer.client.secret` is "
|
|
3810
|
-
"mandatory when "
|
|
3811
|
-
"`sasl.oauthbearer.method=oidc` is set";
|
|
3812
|
-
}
|
|
4222
|
+
#endif
|
|
3813
4223
|
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
4224
|
+
if (cltype == RD_KAFKA_CONSUMER) {
|
|
4225
|
+
|
|
4226
|
+
if (conf->group_protocol == RD_KAFKA_GROUP_PROTOCOL_CLASSIC) {
|
|
4227
|
+
if (conf->max_poll_interval_ms <
|
|
4228
|
+
conf->group_session_timeout_ms)
|
|
4229
|
+
return "`max.poll.interval.ms`must be >= "
|
|
4230
|
+
"`session.timeout.ms`";
|
|
4231
|
+
} else {
|
|
4232
|
+
|
|
4233
|
+
if (rd_kafka_conf_is_modified(conf,
|
|
4234
|
+
"session.timeout.ms")) {
|
|
4235
|
+
return "`session.timeout.ms` is not supported "
|
|
4236
|
+
"for `group.protocol=consumer`. It is "
|
|
4237
|
+
"defined broker side";
|
|
3818
4238
|
}
|
|
3819
|
-
}
|
|
3820
4239
|
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
}
|
|
3829
|
-
}
|
|
4240
|
+
if (rd_kafka_conf_is_modified(
|
|
4241
|
+
conf, "partition.assignment.strategy")) {
|
|
4242
|
+
return "`partition.assignment.strategy` is not "
|
|
4243
|
+
"supported for "
|
|
4244
|
+
"`group.protocol=consumer`. Use "
|
|
4245
|
+
"`group.remote.assignor` instead";
|
|
4246
|
+
}
|
|
3830
4247
|
|
|
3831
|
-
|
|
4248
|
+
if (rd_kafka_conf_is_modified(conf,
|
|
4249
|
+
"group.protocol.type")) {
|
|
4250
|
+
return "`group.protocol.type` is not supported "
|
|
4251
|
+
"for `group.protocol=consumer`";
|
|
4252
|
+
}
|
|
3832
4253
|
|
|
3833
|
-
|
|
4254
|
+
if (rd_kafka_conf_is_modified(
|
|
4255
|
+
conf, "heartbeat.interval.ms")) {
|
|
4256
|
+
return "`heartbeat.interval.ms` is not "
|
|
4257
|
+
"supported "
|
|
4258
|
+
"for `group.protocol=consumer`. It is "
|
|
4259
|
+
"defined broker side";
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
3834
4262
|
|
|
3835
4263
|
/* Automatically adjust `fetch.max.bytes` to be >=
|
|
3836
4264
|
* `message.max.bytes` and <= `queued.max.message.kbytes`
|
|
@@ -3862,10 +4290,6 @@ const char *rd_kafka_conf_finalize(rd_kafka_type_t cltype,
|
|
|
3862
4290
|
conf->fetch_max_bytes + 512);
|
|
3863
4291
|
}
|
|
3864
4292
|
|
|
3865
|
-
if (conf->max_poll_interval_ms < conf->group_session_timeout_ms)
|
|
3866
|
-
return "`max.poll.interval.ms`must be >= "
|
|
3867
|
-
"`session.timeout.ms`";
|
|
3868
|
-
|
|
3869
4293
|
/* Simplifies rd_kafka_is_idempotent() which is producer-only */
|
|
3870
4294
|
conf->eos.idempotence = 0;
|
|
3871
4295
|
|
|
@@ -3960,7 +4384,7 @@ const char *rd_kafka_conf_finalize(rd_kafka_type_t cltype,
|
|
|
3960
4384
|
|
|
3961
4385
|
if (conf->reconnect_backoff_max_ms < conf->reconnect_backoff_ms)
|
|
3962
4386
|
return "`reconnect.backoff.max.ms` must be >= "
|
|
3963
|
-
"`reconnect.
|
|
4387
|
+
"`reconnect.backoff.ms`";
|
|
3964
4388
|
|
|
3965
4389
|
if (conf->sparse_connections) {
|
|
3966
4390
|
/* Set sparse connection random selection interval to
|
|
@@ -4423,7 +4847,7 @@ int unittest_conf(void) {
|
|
|
4423
4847
|
/* Verify that software.client.* string-safing works */
|
|
4424
4848
|
conf = rd_kafka_conf_new();
|
|
4425
4849
|
res = rd_kafka_conf_set(conf, "client.software.name",
|
|
4426
|
-
|
|
4850
|
+
" .~aba. va! !.~~", NULL, 0);
|
|
4427
4851
|
RD_UT_ASSERT(res == RD_KAFKA_CONF_OK, "%d", res);
|
|
4428
4852
|
res = rd_kafka_conf_set(conf, "client.software.version",
|
|
4429
4853
|
"!1.2.3.4.5!!! a", NULL, 0);
|
|
@@ -4442,7 +4866,7 @@ int unittest_conf(void) {
|
|
|
4442
4866
|
|
|
4443
4867
|
readlen = sizeof(readval);
|
|
4444
4868
|
res2 = rd_kafka_conf_get(conf, "client.software.version", readval,
|
|
4445
|
-
|
|
4869
|
+
&readlen);
|
|
4446
4870
|
RD_UT_ASSERT(res2 == RD_KAFKA_CONF_OK, "%d", res2);
|
|
4447
4871
|
RD_UT_ASSERT(!strcmp(readval, "1.2.3.4.5----a"),
|
|
4448
4872
|
"client.software.* safification failed: \"%s\"", readval);
|