Skip to content

Alexeypilyugin/kafka consumer gcp iam auth#23906

Draft
alexeypilyugin wants to merge 4 commits into
masterfrom
alexeypilyugin/kafka-consumer-gcp-iam-auth
Draft

Alexeypilyugin/kafka consumer gcp iam auth#23906
alexeypilyugin wants to merge 4 commits into
masterfrom
alexeypilyugin/kafka-consumer-gcp-iam-auth

Conversation

@alexeypilyugin
Copy link
Copy Markdown
Contributor

What does this PR do?

Motivation

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

piochelepiotr and others added 3 commits June 2, 2026 10:01
Add support for Google Cloud Managed Kafka using SASL_SSL with
OAUTHBEARER mechanism, where tokens are GCP IAM access tokens.
This follows the same pattern as the existing AWS MSK IAM support.

Users can configure it with:
  sasl_mechanism: OAUTHBEARER
  sasl_oauth_token_provider:
    method: gcp_cloud_managed_kafka
    gcp_credentials_file: /path/to/sa.json  # optional, uses ADC if omitted

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ity check, add changelog

- Fix AWS branding: "AWS MSK IAM" -> "Amazon MSK IAM" in spec.yaml and conf.yaml.example
- Fix GCP description: "Google Cloud Managed Kafka" -> "Google Cloud managed Kafka",
  "GCP IAM access tokens" -> "Google Cloud IAM access tokens"
- Update gcp_credentials_file description to match reviewer suggestions; remove
  misleading default path example (no default -- application default credentials are used)
- Restore SECURE_FIELD_NAMES and check_field_trusted_provider security check in
  instance.py that was accidentally removed in the initial commit
- Add changelog entry for the GCP IAM authentication feature

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Managed Kafka's OAUTHBEARER validator expects a three-part dot-separated
token (header.claims.raw_access_token), not the raw google-auth access
token. Returning the raw token caused every authentication attempt to
fail with "invalid credentials". Reference:
https://github.com/googleapis/managedkafka/blob/main/kafka-auth-local-server/kafka_gcp_credentials_server.py

Verified end-to-end against a real Managed Kafka cluster in
datadog-sandbox (us-central1) with the compute VM service account
holding roles/managedkafka.client.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@datadog-official
Copy link
Copy Markdown
Contributor

datadog-official Bot commented Jun 2, 2026

Pipelines  Tests  Code Coverage

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

Check PR | run / Check PR changelog   View in Datadog   GitHub Actions

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. Changelog entry has the wrong PR number. Run 'mv kafka_consumer/changelog.d/23146.added kafka_consumer/changelog.d/23906.added' to fix.

Validate repository | Run Validations / Validate   View in Datadog   GitHub Actions

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. PR #23906 is missing an Agent-release QA decision label.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 87.36%
Overall Coverage: 87.80% (-0.13%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ba5b10d | Docs | Datadog PR Page | Give us feedback!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aba6fcfd8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"exp": expiry.timestamp(),
"iss": "Google",
"iat": now.timestamp(),
"sub": getattr(credentials, "service_account_email", "user"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require a real GCP principal in the token subject

When ADC resolves to user or workload-identity credentials that do not expose service_account_email, this silently emits sub: "user" even though Managed Kafka validates the token against the actual IAM principal email. The new example explicitly advertises gcloud auth application-default login, but that path will build a syntactically valid token with the wrong subject and the broker rejects authentication; this should either read an explicit principal (for example the Google helper uses GOOGLE_MANAGED_KAFKA_AUTH_PRINCIPAL) or fail fast instead of defaulting to "user".

Useful? React with 👍 / 👎.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 2, 2026

Validation Report

Validation Description Status
qa-label Validate the pull request declares whether it needs QA for the next Agent release

Run ddev validate all changed --fix to attempt to auto-fix supported validations.

Passed validations (20)
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants