davsclaus opened a new pull request, #30437:
URL: https://github.com/apache/camel/pull/30437

   [CAMEL-27256](https://issues.apache.org/jira/browse/CAMEL-27256): 
`schemaRegistryVendor` (CAMEL-27130) sets the registry URL of each vendor, but 
nothing to log in with. New options log in to the registry and are mapped to 
the properties of the vendor, as `schemaRegistryURL` is.
   
   | Option | `confluent` | `apicurio` (3.x) |
   |---|---|---|
   | `schemaRegistryUsername`, `schemaRegistryPassword` (secret): basic auth | 
`basic.auth.credentials.source=USER_INFO`, 
`basic.auth.user.info=<username>:<password>`. For Confluent Cloud, the API key 
and secret | `apicurio.registry.auth.username`, 
`apicurio.registry.auth.password` |
   | `schemaRegistryOauthTokenEndpoint`, `schemaRegistryOauthClientId`, 
`schemaRegistryOauthClientSecret` (secret), `schemaRegistryOauthScope`: OAuth2 
client credentials | `bearer.auth.credentials.source=OAUTHBEARER`, 
`bearer.auth.issuer.endpoint.url`, `bearer.auth.client.id`, 
`bearer.auth.client.secret`, `bearer.auth.scope` | 
`apicurio.registry.auth.service.token.endpoint`, 
`apicurio.registry.auth.client.id`, `apicurio.registry.auth.client.secret`, 
`apicurio.registry.auth.client.scope` (such as a Keycloak client) |
   
   - **`azure` and `aws-glue`** log in with the credentials of the environment: 
the Azure `DefaultAzureCredential` (Camel already sets 
`use.azure.credential=true`), and the AWS default credentials chain. A login 
option set for one of them fails when the producer or consumer starts, with a 
message that says so, instead of being ignored.
   - **Without a vendor**, the options set nothing.
   - **`additionalProperties` take precedence**, as for the rest of the vendor 
setup. For example, `basic.auth.credentials.source=SASL_INHERIT` uses the SASL 
login of the Kafka connection.
   - **Checked property names:** in `kafka-schema-registry-client` 8.3.3 
(`SchemaRegistryClientConfig`) and `apicurio-registry-schema-resolver` 3.3.4 
(the `AUTH_*` constants). Before this change, Confluent's default 
`basic.auth.credentials.source` is `URL`, so a login only worked with the 
credentials embedded in `schemaRegistryURL`, which is not a secret option.
   - **Sensitive keys:** `schemaRegistryPassword` and 
`schemaRegistryOauthClientSecret` are added, so Camel masks them.
   
   ### Documentation
   The "Schema registry" section of the kafka component documentation has a new 
"Logging in to the schema registry" part:
   - a table of how each of the four vendors logs in: `confluent` and 
`apicurio` with the new options; `aws-glue` with the AWS default credentials 
chain (environment variables, profile, or the role of the EC2 instance, ECS 
task or EKS service account); `azure` with `DefaultAzureCredential` (the 
`AZURE_*` variables of a service principal, or a managed, workload or CLI 
identity);
   - examples for Confluent Cloud, in Java and YAML, and for Apicurio Registry 
with a Keycloak client.
   
   ### Tests
   `KafkaSchemaRegistryVendorTest` has 7 new tests, and passes 50 of 50:
   - basic auth and OAuth2 for both vendors, on the producer and on the 
consumer;
   - a password with `&`, `+`, `=` and `/` given in `RAW()` on an endpoint URI;
   - `additionalProperties` winning;
   - nothing set without a vendor;
   - the startup failure for `azure` and `aws-glue`.
   
   camel-kafka-share passes its tests. The configurers, the component and 
endpoint DSLs and the catalog are regenerated.
   
   ### Next
   The Kafka Kamelets of camel-kamelets will expose these options 
(apache/camel-kamelets#3279).
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to