Skip to content

Add KV v2 destroySecretVersions command#293

Merged
aviadhahami merged 3 commits intomasterfrom
copilot/add-support-for-kv-v2-destroy-command
Mar 21, 2026
Merged

Add KV v2 destroySecretVersions command#293
aviadhahami merged 3 commits intomasterfrom
copilot/add-support-for-kv-v2-destroy-command

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

Adds the missing KV v2 Destroy Secret Versions endpoint (POST /:mount/destroy/:path).

  • src/commands.js — New destroySecretVersions command with configurable mount_point (defaults to secret) and schema-validated versions array
  • index.d.ts — TypeScript declaration
  • test/unit.js — Tests for default and custom mount point
  • features.md — Regenerated
// Permanently destroy versions 1 and 2
await vault.destroySecretVersions({ path: 'my-secret', versions: [1, 2] });

// Custom mount point
await vault.destroySecretVersions({ mount_point: 'custom-kv', path: 'my-secret', versions: [3] });
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for KV v2 "destroy" command</issue_title>
<issue_description>https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2#destroy-secret-versions

from what I saw in the commands, it's not available.
https://github.com/nodevault/node-vault/blob/master/src/commands.js</issue_description>

<agent_instructions>do the required research and implement</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@aviadhahami @intelline if you could PR this that'd be great :)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Add the destroySecretVersions command to support the HashiCorp Vault
KV v2 "Destroy Secret Versions" API endpoint (POST /secret/destroy/:path).

- Add command in src/commands.js with configurable mount_point (defaults to "secret")
- Add schema validation requiring versions array with minItems: 1
- Add TypeScript declaration in index.d.ts
- Add unit tests for default and custom mount point usage
- Regenerate features.md

Co-authored-by: aviadhahami <7353632+aviadhahami@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nodevault/node-vault/sessions/6b90d6f5-1e0a-484c-8a8a-e3b3cb5b1ffa
Copilot AI changed the title [WIP] Add support for KV v2 destroy command Add KV v2 destroySecretVersions command Mar 21, 2026
Copilot AI requested a review from aviadhahami March 21, 2026 22:30
@aviadhahami aviadhahami marked this pull request as ready for review March 21, 2026 23:11
@aviadhahami aviadhahami enabled auto-merge March 21, 2026 23:11
@aviadhahami aviadhahami disabled auto-merge March 21, 2026 23:14
@aviadhahami aviadhahami merged commit 8952580 into master Mar 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for KV v2 "destroy" command

2 participants