oscerd commented on code in PR #27679:
URL: https://github.com/apache/camel/pull/27679#discussion_r4246186725


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc:
##########
@@ -1021,6 +1021,18 @@ short by that count, so it now fails the record `length` 
check (unless `ignoreMi
 read with shifted fields. A system that reads these records by counting UTF-16 
chars must count code points (or
 graphemes) instead.
 
+=== camel-hashicorp-vault - properties without engine use the `secret` engine

Review Comment:
   `camel-4.23.0` was tagged on 2026-10-11, and its history leaves main at 
`197e70656a41` (CAMEL-25490), before this PR. So this change ships in 4.24.0, 
which matches the Jira fixVersion and the PR milestone. In the 4.23 guide, the 
note would tell users the change is already in 4.23.0.
   
   Could you move this section to `camel-4x-upgrade-guide-4_24.adoc`, under `== 
Upgrading Camel 4.23 to 4.24`? That file isn't on main yet. #27681 and #27714 
both create it, along with the index entry in `camel-4x-upgrade-guide.adoc`. 
Rebasing on whichever of those merges first saves a third add/add conflict.
   
   Optional, while moving it: `{{hashicorp:mysecret@2}}` changed too. It now 
reads version 2 of `mysecret` in the `secret` engine. Before, the `@2` stayed 
part of the secret name.



##########
components/camel-hashicorp-vault/src/main/docs/hashicorp-vault-component.adoc:
##########
@@ -363,6 +363,10 @@ YAML::
 
 Where route will be the name of the secret stored in the HashiCorp Vault 
instance, in the 'secret' engine.
 
+NOTE: The engine is the part before the first `:`. When the property has no 
engine, such as `{{hashicorp:route}}`
+or `{{hashicorp:database#username}}`, the secret is read from the 'secret' 
engine. A default value always needs the
+engine, as in `{{hashicorp:secret:route:default}}`: in 
`{{hashicorp:route:default}}` the engine would be `route`.

Review Comment:
   With a field, a default value works without an engine. 
`{{hashicorp:database#username:admin}}` reads `secret/data/database` and falls 
back to `admin`. I checked this on the PR head with a fake `VaultTemplate`, 
like the one in `HashicorpVaultPropertiesFunctionTest`. The first sentence 
doesn't hold for that form either, since the part before its first `:` is 
`database#username`. A possible wording:
   
   ```suggestion
   NOTE: The engine is the part before the first `:`; for a property with a 
field, only the part before the `#` counts.
   When the property has no engine, such as `{{hashicorp:route}}` or 
`{{hashicorp:database#username}}`, the secret is read
   from the 'secret' engine. Without a field, a default value needs the engine, 
as in `{{hashicorp:secret:route:default}}`:
   in `{{hashicorp:route:default}}` the engine would be `route`. With a field 
it does not, as in
   `{{hashicorp:database#username:admin}}`.
   ```
   
   The same change is needed in the generated catalog copy (suggestion there 
too).



##########
catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/hashicorp-vault-component.adoc:
##########
@@ -363,6 +363,10 @@ YAML::
 
 Where route will be the name of the secret stored in the HashiCorp Vault 
instance, in the 'secret' engine.
 
+NOTE: The engine is the part before the first `:`. When the property has no 
engine, such as `{{hashicorp:route}}`
+or `{{hashicorp:database#username}}`, the secret is read from the 'secret' 
engine. A default value always needs the
+engine, as in `{{hashicorp:secret:route:default}}`: in 
`{{hashicorp:route:default}}` the engine would be `route`.

Review Comment:
   Same wording for the generated catalog copy, so the two files stay identical:
   
   ```suggestion
   NOTE: The engine is the part before the first `:`; for a property with a 
field, only the part before the `#` counts.
   When the property has no engine, such as `{{hashicorp:route}}` or 
`{{hashicorp:database#username}}`, the secret is read
   from the 'secret' engine. Without a field, a default value needs the engine, 
as in `{{hashicorp:secret:route:default}}`:
   in `{{hashicorp:route:default}}` the engine would be `route`. With a field 
it does not, as in
   `{{hashicorp:database#username:admin}}`.
   ```



##########
components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultPropertiesFunction.java:
##########
@@ -62,7 +62,8 @@
  * This implementation is to return the secret value associated with a key. 
The properties related to this kind of
  * Properties Function are all prefixed with <tt>hashicorp:</tt>. For example 
asking for
  * <tt>hashicorp:engine:token</tt>, will return the secret value associated to 
the secret named token on Hashicorp Vault
- * instance on the engine 'engine'.
+ * instance on the engine 'engine'. When no engine is given, such as 
<tt>hashicorp:token</tt>, the 'secret' engine is
+ * used.
  *
  * Another way of retrieving a secret value is using the following notation 
<tt>hashicorp:engine:database/username</tt>:

Review Comment:
   Minor, since this javadoc is being updated anyway: this paragraph still 
shows the field with `/` (`hashicorp:engine:database/username`, and 
`hashicorp:engine:database/username:admin` a few lines down). The separator has 
been `#` since CAMEL-21179, so `hashicorp:engine:database/username` now reads 
the secret at path `database/username`. Changing them to 
`hashicorp:engine:database#username` and 
`hashicorp:engine:database#username:admin` would match `apply()` and the docs.



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