Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KVV2 datasource upon retrieval of soft deleted secrets #1760

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

vinay-gopalan
Copy link
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