davsclaus opened a new pull request, #3243:
URL: https://github.com/apache/camel-kamelets/pull/3243
Fixes #3242.
A password, key or token that a Kamelet places into the address of the
endpoint it calls is parsed as part of the URI. Without `RAW()`, a value with
`&`, `+` or `=` is cut into another parameter or changed: a password
`p&ss+w=rd` logs in as `p`, and `http-sink` then sends `ss+w=rd` as the query
of the request. A Base64 `serviceAccountKey` with a `+` is changed the same way.
## Changes
- Every option with `format: password` that goes into an endpoint address,
as a URI query parameter or a `parameters` entry, is wrapped in `RAW()` (31
Kamelets): `http-sink`/`http-source` (`authPassword`, `oauth2ClientId`,
`oauth2ClientSecret`), `mail-sink`, `cassandra-sink`,
`infinispan-sink`/`-source`, the Google Kamelets (`serviceAccountKey`,
`clientId`), the Azure Storage Kamelets (`tenantId`, `clientId`), the Kafka
Apicurio Kamelets, `nats-sink`/`-source` (`servers`), `slack-sink`
(`webhookUrl`), `ceph-event-based-source` and `azure-functions-sink` (`key`;
#3241 moves that key out of the address altogether).
- An optional option that is not set is still left out of the address:
`RAW({{?name}})` is dropped like `{{?name}}`.
## Tests
- `KameletsSecretsRawTest`: checks every Kamelet; an option with `format:
password` in an endpoint address without `RAW()` fails the build.
- `HttpSinkSecretTest`: `http-sink` with Basic login and the password
`p&ss+w=rd` against a local server sends the whole password and no query. It
fails on `main` (the server gets `query=ss+w=rd` and the login of `user:p`).
- `./mvnw clean install` passes.
_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]