petems / petems-hiera_vault

A hiera backend for access to secrets being stored in HashiCorp Vault
Apache License 2.0
44 stars 45 forks source link

Lookup-error in strict_mode in case of not found secret #96

Open andreas689 opened 1 year ago

andreas689 commented 1 year ago

Hello, we use hiera_vault v2.0.0 and we have had recently issues with our vault-server, because vault-server has answered some requests with HTTP 500 errors. HTTP 500 errors have been caught from hiera_vault in version v2.0.0 without special handling and we have had some consequential error. Anyway, in a current project I have seen promising new flag strict_mode with following description: “When enabled, the lookup function fail in case of http errors when looking up a secret.” I tested strict_mode with HTTP-errors and behaviour is exact what I am looking for, but I do not understand the lookup-error if hiera_vault does not find values. Below please find the relevant source-code: raise Puppet::DataBinding::LookupError, "[hiera-vault] Could not find secret #{key}" if answer.nil? and strict_mode This behaviour does not reflect above mentioned description of strict_mode and I query why is this relevant for strict_mode at all? Everyone can decide with puppet-lookup if lookup should fail without value, right? Or have I missed something? Cheers, Andreas