Claus Ibsen created CAMEL-27256:
-----------------------------------

             Summary: camel-kafka - log in to the schema registry with 
schemaRegistryVendor (basic auth and OAuth2 for confluent and apicurio)
                 Key: CAMEL-27256
                 URL: https://issues.apache.org/jira/browse/CAMEL-27256
             Project: Camel
          Issue Type: Improvement
          Components: camel-kafka
            Reporter: Claus Ibsen


{{schemaRegistryVendor}} (CAMEL-27130) sets the registry URL of each vendor, 
but nothing to log in with. With {{confluent}} and {{apicurio}}, a registry 
that requires a login, such as Confluent Cloud or a secured Apicurio Registry, 
can only be reached by setting the vendor's own properties through 
{{additionalProperties}}. That is the knowledge {{schemaRegistryVendor}} was 
meant to hide, and the Kafka Kamelets of camel-kamelets cannot pass 
{{additionalProperties}} at all.

{{azure}} and {{aws-glue}} already log in with the credentials of the 
environment ({{use.azure.credential=true}} with the Azure 
{{DefaultAzureCredential}}, and the AWS default credentials chain), so they 
need no new options.

h3. Proposal
New options, with the secrets marked as secret, that Camel maps to the 
properties of the vendor:

||Option||confluent||apicurio (3.x)||
|{{schemaRegistryUsername}}, {{schemaRegistryPassword}} (basic 
auth)|{{basic.auth.credentials.source=USER_INFO}}, 
{{basic.auth.user.info=<username>:<password>}}|{{apicurio.registry.auth.username}},
 {{apicurio.registry.auth.password}}|
|{{schemaRegistryOauthTokenEndpoint}}, {{schemaRegistryOauthClientId}}, 
{{schemaRegistryOauthClientSecret}}, {{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}}|

As with the URL, what the user sets in {{additionalProperties}} takes 
precedence.

The property names were checked in kafka-schema-registry-client 8.3.3 
({{SchemaRegistryClientConfig}}) and apicurio-registry-schema-resolver 3.3.4. 
Confluent's default {{basic.auth.credentials.source}} is {{URL}}, so today 
credentials only work when embedded in {{schemaRegistryURL}}, which is not a 
secret option.

h3. Documentation
The schema registry section of the kafka component documentation should say how 
to log in for each vendor:
* {{confluent}} and {{apicurio}}: with the new options;
* {{azure}}: with {{DefaultAzureCredential}}, such as the {{AZURE_CLIENT_ID}}, 
{{AZURE_TENANT_ID}} and {{AZURE_CLIENT_SECRET}} environment variables, or a 
managed identity;
* {{aws-glue}}: with the AWS default credentials chain, such as the 
{{AWS_ACCESS_KEY_ID}} and {{AWS_SECRET_ACCESS_KEY}} environment variables, a 
profile, or an instance role.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to