mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
connect/ca: use weak type decoding in the Vault config parsing
This commit is contained in:
parent
b4ef7bb64d
commit
8c2c9705d9
@ -285,7 +285,18 @@ func (v *VaultProvider) Cleanup() error {
|
|||||||
func ParseVaultCAConfig(raw map[string]interface{}) (*structs.VaultCAProviderConfig, error) {
|
func ParseVaultCAConfig(raw map[string]interface{}) (*structs.VaultCAProviderConfig, error) {
|
||||||
var config structs.VaultCAProviderConfig
|
var config structs.VaultCAProviderConfig
|
||||||
|
|
||||||
if err := mapstructure.Decode(raw, &config); err != nil {
|
decodeConf := &mapstructure.DecoderConfig{
|
||||||
|
ErrorUnused: true,
|
||||||
|
Result: &config,
|
||||||
|
WeaklyTypedInput: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
decoder, err := mapstructure.NewDecoder(decodeConf)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := decoder.Decode(raw); err != nil {
|
||||||
return nil, fmt.Errorf("error decoding config: %s", err)
|
return nil, fmt.Errorf("error decoding config: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user