Skip to content

feat(config): Support SASL/OAUTHBEARER with an OIDC token endpoint - #832

Draft
enochtangg wants to merge 1 commit into
mainfrom
enoch/gmk-oauthbearer-test
Draft

enochtangg wants to merge 1 commit into
mainfrom
enoch/gmk-oauthbearer-test

Conversation

@enochtangg

Copy link
Copy Markdown
Contributor

Lets taskbroker log in to Google Managed Kafka (GMK) with OAUTHBEARER, for the managed Kafka evaluation. Draft: this is here to scope the work, not to merge yet.

GMK doesn't support SCRAM. Its recommended login is OAUTHBEARER with short-lived Google tokens from Workload Identity, so no Kafka password is stored. For non-Java clients, Google provides a small local auth server that runs as a sidecar, and librdkafka fetches tokens from it on its own. taskbroker just needs to pass the settings through.

  • src/config/kafka.rs: four new optional kafka_clusters settings (sasl_oauthbearer_method, sasl_oauthbearer_token_endpoint_url, sasl_oauthbearer_client_id, sasl_oauthbearer_client_secret), passed to librdkafka with the other SASL settings.
  • src/config/mod.rs: hides the client secret in the config log, and sets the new fields to None for the deprecated flat kafka_* config, which doesn't get them.
  • Cargo.toml, Dockerfile: librdkafka needs libcurl to fetch tokens over HTTP, so this turns on rdkafka's curl feature and adds libcurl to the image.
  • README.md: the new settings in the kafka_clusters example.

Tested in the streaming sandbox against GMK: taskbroker with the auth server sidecar consumed and committed 1,000/1,000 tasks. The stock image ignores these settings and times out on startup. Results: GMK Auth Test.

Adds sasl_oauthbearer_method, sasl_oauthbearer_token_endpoint_url,
sasl_oauthbearer_client_id and sasl_oauthbearer_client_secret to
kafka_clusters and passes them to librdkafka. This lets taskbroker log in to
Google Managed Kafka through Google's local auth server, which hands out
Workload Identity tokens, so no Kafka password is stored.

librdkafka needs libcurl to fetch tokens over HTTP, so this turns on
rdkafka's curl feature and adds libcurl to the image.

Only the kafka_clusters format gets the new settings, not the deprecated
flat kafka_* fields.
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.

1 participant