DGS-23437: Enable client omit Confluent-Identity-Pool-Id #2182
DGS-23437: Enable client omit Confluent-Identity-Pool-Id #2182tobiogunbi wants to merge 11 commits intomasterfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
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_poolparameter optional (defaults toNone) in OAuth and static field providers - Updated header handling to conditionally include
Confluent-Identity-Pool-Idonly when identity pool is provided - Removed
bearer.auth.identity.pool.idfrom 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))) | ||
|
|
There was a problem hiding this comment.
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.
| # 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. |
src/confluent_kafka/schema_registry/_sync/schema_registry_client.py
Outdated
Show resolved
Hide resolved
|


What
Checklist
References
JIRA:
Test & Review
Open questions / Follow-ups