node-vault icon indicating copy to clipboard operation
node-vault copied to clipboard

Update a secret path and not overwrite it

Open skeletonz28 opened this issue 5 months ago • 0 comments

Unsure if this is a thing or not

I have implemented the .write to write new secrets to our vault path However, I intend to use the same path and just update/PATCH/PUT the new keys in there, which of course means updating the list etc, with each new version means the list is growing

I do instead see that when I use .write, it overwrites the keys present in the path, and the new version only has the one new kvp

I have attempted this

const writeResponse = await vaultClient.write(clientPath,
                        {
                            data: {
                                [clientKey]: secret
                            }
                        }, {
                        method: 'PATCH',
                        apiversion: 'v2'
                    });

But this does not just add the new secret to the list, it overwrites The app-role I'm using is only set up for writing, so me doing a read, and adding that to the method is not an option at this point

So is there a way to PATCH the secrets using .write? Did I misread the docs?

skeletonz28 avatar Sep 12 '25 08:09 skeletonz28