hashicorp / vault-plugin-secrets-openldap

OpenLDAP secret engine for Vault
Mozilla Public License 2.0
18 stars 7 forks source link

Fixes decoding of prior WAL entries with missing password_policy field #57

Closed austingebauer closed 1 year ago

austingebauer commented 1 year ago

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