Skip to content

DGS-23437: Enable client omit Confluent-Identity-Pool-Id #2182

Open
tobiogunbi wants to merge 11 commits intomasterfrom
DGS-23437
Open

DGS-23437: Enable client omit Confluent-Identity-Pool-Id #2182
tobiogunbi wants to merge 11 commits intomasterfrom
DGS-23437

Conversation

@tobiogunbi
Copy link
Member

What

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@tobiogunbi tobiogunbi requested a review from MSeal as a code owner February 2, 2026 21:51
Copilot AI review requested due to automatic review settings February 2, 2026 21:51
@tobiogunbi tobiogunbi requested review from a team as code owners February 2, 2026 21:51
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the Confluent-Identity-Pool-Id header optional in bearer authentication for Schema Registry clients, allowing clients to omit the identity pool configuration. This supports scenarios where auto pool mapping is enabled on the server, and extends support for comma-separated pool IDs for union-of-pools configurations.

Changes:

  • Made identity_pool parameter optional (defaults to None) in OAuth and static field providers
  • Updated header handling to conditionally include Confluent-Identity-Pool-Id only when identity pool is provided
  • Removed bearer.auth.identity.pool.id from required configuration validation

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/confluent_kafka/schema_registry/common/schema_registry_client.py Made identity_pool optional in both sync and async static field providers
src/confluent_kafka/schema_registry/_sync/schema_registry_client.py Updated OAuth client and validation to make identity_pool optional; conditionally add header
src/confluent_kafka/schema_registry/_async/schema_registry_client.py Updated async OAuth client and validation to make identity_pool optional; conditionally add header
tests/schema_registry/_sync/test_bearer_field_provider.py Updated test cases to reflect new optional identity_pool parameter order
tests/schema_registry/_async/test_bearer_field_provider.py Updated test cases and added comprehensive tests for optional and comma-separated pool scenarios
examples/oauth_schema_registry.py Added example configurations demonstrating union-of-pools and auto pool mapping usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

logical_cluster = conf_copy.pop('bearer.auth.logical.cluster')
if not isinstance(logical_cluster, str):
raise TypeError("logical cluster must be a str, not " + str(type(logical_cluster)))

Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The comment on lines 297-299 describes identity pool as supporting comma-separated values for union-of-pools, but the type check only validates it as a string. Consider adding a comment explaining that comma-separated values are passed as a single string to clarify the expected format.

Suggested change
# Note: identity_pool is always provided and validated as a single
# string. For union-of-pools use cases, multiple identity pool
# IDs should be encoded as a comma-separated list within this
# string. No additional parsing or validation of the individual
# comma-separated values is performed here.

Copilot uses AI. Check for mistakes.
@sonarqube-confluent
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
71.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

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