[ 
https://issues.apache.org/jira/browse/CAMEL-26255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-26255:
--------------------------------
    Description: 
Found while adding the catalog body types of hashicorp-vault (CAMEL-24961, PR 
#28404).

h4. 1. cloud=true without a namespace

{{HashicorpVaultProducer.getSecret}} (main 2a465aa4814c, lines 72-79) and 
{{listSecrets}} (lines 101-110) only build the path when {{namespace}} is set 
in cloud mode. Without it getSecret reads the path "" and fails "Path must not 
be empty", and listSecrets returns an empty list without an error. Checked on 
4.24.0-SNAPSHOT with a Vault dev server (test-infra).

Proposed: use the non-namespaced path when no namespace is set, or fail at 
endpoint start when cloud=true needs one.

h4. 2. A stream body fails, and no body writes an empty version

{{createSecret}} (line 62) passes the body as it is to {{keyValue.put}}: an 
{{InputStream}} body fails in Jackson serialization, and a null body writes a 
new, empty version of the secret. Checked on 4.24.0-SNAPSHOT with the dev 
server.

Proposed: convert stream/bytes/JSON text to a Map, and reject a null body.

h4. 3. The secret version is not encoded

{{HashicorpVaultProducer}} (main 2a465aa4814c, lines 68-81) appends the 
{{CamelHashicorpVaultSecretVersion}} header to the read path as {{"?version=" + 
secretVersion}} without encoding.

Proposed: URL-encode it (or check that it is a number).

_Claude Code on behalf of davsclaus_

  was:
Found while adding the catalog body types of hashicorp-vault (CAMEL-24961, PR 
#28404).

h4. 1. cloud=true without a namespace

{{HashicorpVaultProducer.getSecret}} (main 2a465aa4814c, lines 72-79) and 
{{listSecrets}} (lines 101-110) only build the path when {{namespace}} is set 
in cloud mode. Without it getSecret reads the path "" and fails "Path must not 
be empty", and listSecrets returns an empty list without an error. Checked on 
4.24.0-SNAPSHOT with a Vault dev server (test-infra).

Proposed: use the non-namespaced path when no namespace is set, or fail at 
endpoint start when cloud=true needs one.

h4. 2. A stream body fails, and no body writes an empty version

{{createSecret}} (line 62) passes the body as it is to {{keyValue.put}}: an 
{{InputStream}} body fails in Jackson serialization, and a null body writes a 
new, empty version of the secret. Checked on 4.24.0-SNAPSHOT with the dev 
server.

Proposed: convert stream/bytes/JSON text to a Map, and reject a null body.

_Claude Code on behalf of davsclaus_


> camel-hashicorp-vault - with cloud=true and no namespace, getSecret fails 
> with Path must not be empty and listSecrets returns an empty list
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26255
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26255
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-hashicorp-vault
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of hashicorp-vault (CAMEL-24961, PR 
> #28404).
> h4. 1. cloud=true without a namespace
> {{HashicorpVaultProducer.getSecret}} (main 2a465aa4814c, lines 72-79) and 
> {{listSecrets}} (lines 101-110) only build the path when {{namespace}} is set 
> in cloud mode. Without it getSecret reads the path "" and fails "Path must 
> not be empty", and listSecrets returns an empty list without an error. 
> Checked on 4.24.0-SNAPSHOT with a Vault dev server (test-infra).
> Proposed: use the non-namespaced path when no namespace is set, or fail at 
> endpoint start when cloud=true needs one.
> h4. 2. A stream body fails, and no body writes an empty version
> {{createSecret}} (line 62) passes the body as it is to {{keyValue.put}}: an 
> {{InputStream}} body fails in Jackson serialization, and a null body writes a 
> new, empty version of the secret. Checked on 4.24.0-SNAPSHOT with the dev 
> server.
> Proposed: convert stream/bytes/JSON text to a Map, and reject a null body.
> h4. 3. The secret version is not encoded
> {{HashicorpVaultProducer}} (main 2a465aa4814c, lines 68-81) appends the 
> {{CamelHashicorpVaultSecretVersion}} header to the read path as {{"?version=" 
> + secretVersion}} without encoding.
> Proposed: URL-encode it (or check that it is a number).
> _Claude Code on behalf of davsclaus_



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

Reply via email to