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

   _Claude Code on behalf of Claus Ibsen_
   
   This is item 7 from #3384, left out of #3385 until Camel had the options.
   
   ### Changes
   `elasticsearch-index-sink`, `elasticsearch-search-action`, 
`opensearch-index-sink` and `opensearch-search-action` get a new option, 
`apiKey` (credential: `format: password`, `urn:camel:group:credentials`). It is 
set on the Kamelet's local component bean, next to `user` and `password`.
   - **Elasticsearch:** the `encoded` value of the key, or `id:api_key`. This 
uses CAMEL-27479 (apache/camel#30684).
   - **OpenSearch 3.7 or later:** the `os_…` API token. This uses CAMEL-27480 
(apache/camel#30686).
   - The key is sent in `Authorization: ApiKey …`, only to the nodes of the 
cluster. Set either `apiKey` or `user`, not both.
   - The search actions' "log in as a user that can read only the index" 
sentence now mentions an API key too.
   
   ### Needs CAMEL-27497 (apache/camel#30706, merged)
   An optional Kamelet property that is not set, such as `{{?user}}`, resolves 
from the OS environment variable of the same name (`USER`). The components then 
saw both `apiKey` and `user` and failed at startup. CAMEL-27497 makes them fail 
only when `password` is set too, with empty values counting as not set. The 
general environment fallback is CAMEL-27498 (4.25.0).
   
   ### Tests
   The index-sink tests (security on, plain HTTP) now also log in with a key:
   - **Elasticsearch 9.1.0:** `POST /_security/api_key` as `elastic`; the 
`encoded` value is read from the response, and `order-2` is indexed with only 
`apiKey`.
   - **OpenSearch 3.9.0:** 
`plugins.security.unsupported.restapi.allow_securityconfig_modification=true`. 
Then `PATCH /_plugins/_security/api/securityconfig` turns on `api_tokens`, and 
`POST /_plugins/_security/api/apitokens` creates a token with 
`cluster_monitor`, `indices:data/write/bulk` and `indices_all` on `orders*`. 
`order-2` is indexed with only `apiKey`.
   
   `SearchIT` passes 6/6 locally against a Camel build that includes 
CAMEL-27497. `./mvnw clean install` passes.
   
   CI checks the Kamelets against the Apache Camel snapshot. It needs a 
snapshot from after CAMEL-27497 (e23e92169ea5); until then the tests that log 
in with a key will fail.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
   


-- 
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