Skip to content

Update a secret path and not overwrite it #260

@skeletonz28

Description

@skeletonz28

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions