[codex] Fix schema registry auth for direct StreamNative catalogs#390
Open
xylaaaaa wants to merge 1 commit into
Open
[codex] Fix schema registry auth for direct StreamNative catalogs#390xylaaaaa wants to merge 1 commit into
xylaaaaa wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Confluent Schema Registry configuration and integration to (a) normalize registry URLs as HTTPS by default and (b) improve schema registry client property handling (notably basic auth propagation).
Changes:
- Switch schema registry URL config from
Set<HostAddress>toList<String>and normalize host:port entries tohttps://... - Add subject-mapping config coverage and URL normalization tests
- Refactor auth wiring and introduce
buildSchemaRegistryClientProperties(...)to merge provider properties and fill in confluent/basic-auth keys
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentSchemaRegistryConfig.java | Normalize registry URLs to HTTPS and change URL type to list of strings |
| plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentModule.java | Conditional auth binding refactor; property merge/build helper added |
| plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentSchemaRegistryConfig.java | Add tests for URL normalization and subject-mapping parsing; update defaults/mappings |
| plugin/trino-kafka/src/test/java/io/trino/plugin/kafka/schema/confluent/TestConfluentModule.java | New test validating merged schema-registry basic auth properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+114
to
+121
| configBinder(binder).bindConfig(BasicAuthConfig.class); | ||
| install(conditionalModule( | ||
| ConfluentSchemaRegistryConfig.class, | ||
| schemaRegistryConfig -> schemaRegistryConfig.getConfluentSchemaRegistryAuthType() == BASIC_AUTH, | ||
| authBinder -> authBinder.bind(SchemaRegistryClientPropertiesProvider.class) | ||
| .to(ConfluentSchemaRegistryBasicAuth.class) | ||
| .in(Scopes.SINGLETON), | ||
| authBinder -> authBinder.bind(SchemaRegistryClientPropertiesProvider.class) |
Comment on lines
+153
to
+160
| Map<String, Object> schemaRegistryClientProperties = propertiesProviders.stream() | ||
| .map(SchemaRegistryClientPropertiesProvider::getSchemaRegistryClientProperties) | ||
| .flatMap(properties -> properties.entrySet().stream()) | ||
| .collect(java.util.stream.Collectors.toMap( | ||
| Map.Entry::getKey, | ||
| entry -> (Object) entry.getValue(), | ||
| (left, right) -> right, | ||
| HashMap::new)); |
| return stream(splitter.split(nodes)) | ||
| .map(ConfluentSchemaRegistryConfig::toHostAddress) | ||
| .collect(toImmutableSet()); | ||
| .map(ConfluentSchemaRegistryConfig::normalizeUrl) |
Comment on lines
+43
to
+44
| .setConfluentSubjectsCacheRefreshInterval(new Duration(1, SECONDS)) | ||
| .setConfluentSchemaRegistrySubjectMapping(null)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
host:portinputs tohttps://host:portCachedSchemaRegistryClientWhy
Apache Doris was able to reach StreamNative Kafka through Routine Load and Kafka Connect, but Kafka Catalog failed in the Confluent schema-registry path. The failure had two parts:
This patch fixes the direct StreamNative path used by Kafka Catalog.
Validation
mvn -pl plugin/trino-kafka -Dtest=TestConfluentSchemaRegistryConfig,TestConfluentModule -DfailIfNoTests=false testSHOW DATABASES FROM sn_kafka_sr_fixedSHOW TABLESafterSWITCH sn_kafka_sr_fixed; USE \default``SELECT * FROM doris_schema_avro LIMIT 5Notes