Closed austingebauer closed 1 year ago
This PR fixes a potential panic introduced by https://github.com/hashicorp/vault-plugin-secrets-openldap/pull/56. The problem is that WAL entries that exist prior to a plugin upgrade might contain missing key/value pairs that the code expected to find in the map.
To make this more robust to future changes to the WAL data, I've changed it to use mapstructure. This is a common pattern (example in database/rollback.go).
The test that I wrote panics before the changes introduced by this PR.
Overview
This PR fixes a potential panic introduced by https://github.com/hashicorp/vault-plugin-secrets-openldap/pull/56. The problem is that WAL entries that exist prior to a plugin upgrade might contain missing key/value pairs that the code expected to find in the map.
To make this more robust to future changes to the WAL data, I've changed it to use mapstructure. This is a common pattern (example in database/rollback.go).
The test that I wrote panics before the changes introduced by this PR.
Related Issues/Pull Requests
Contributor Checklist