Skip to content

Fix KVV2 datasource upon retrieval of soft deleted secrets - #1760

Merged
vinay-gopalan merged 1 commit into
mainfrom
VAULT-12745/kvv2-soft-deleted-secret-read
Feb 16, 2023
Merged

vinay-gopalan merged 1 commit into
mainfrom
VAULT-12745/kvv2-soft-deleted-secret-read

Conversation

@vinay-gopalan

Copy link
Copy Markdown
Contributor

This PR adds a type cast check for the data returned on reading a KV V2 secret from Vault. The current implementation panics when trying to retrieve a secret that has been soft deleted (the secret still exists, but the data attribute is nil). The PR also adds a test for this use-case and confirms that the fix works as expected.

Fixes #1731

$ make testacc TESTARGS='-v -run TestDataSourceKVV2Secret_deletedSecret'
=== RUN   TestDataSourceKVV2Secret_deletedSecret
--- PASS: TestDataSourceKVV2Secret_deletedSecret (0.98s)
PASS

@vinay-gopalan
vinay-gopalan requested review from a team and fairclothjm February 15, 2023 23:10
@vinay-gopalan vinay-gopalan added this to the 3.13.0 milestone Feb 15, 2023
@vinay-gopalan
vinay-gopalan merged commit 38a7250 into main Feb 16, 2023
@vinay-gopalan
vinay-gopalan deleted the VAULT-12745/kvv2-soft-deleted-secret-read branch February 16, 2023 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault provider crashes when it attempts to retrieve vault kvv2 secret data resource

2 participants