Closed rvben closed 4 years ago
Describe the bug If a vault is used with nested dictionaries, a crash is the consequence.
To Reproduce Steps to reproduce the behavior:
MULTI: LAYERED: YAML: multi
$ go test --- FAIL: TestGetVaultKey (0.36s) --- FAIL: TestGetVaultKey/should_handle_invalid_yaml (0.03s) vault_test.go:273: getVaultKey(`../../examples/ansible/invalid_yaml_test.yaml`, `api_key`) = (``, yaml: unmarshal errors: line 3: cannot unmarshal !!str `I'm not...` into map[string]string), want (``, yaml: unmarshal errors: line 3: cannot unmarshal !!str `I'm not...` into map[string]interface {}) --- FAIL: TestGetVaultKey/should_handle_multi-line_vault_file (0.03s) vault_test.go:273: getVaultKey(`../../examples/ansible/complex_vault_test.yaml`, `API_SECRET`) = (``, yaml: unmarshal errors: line 8: cannot unmarshal !!map into string), want (`password`, <nil>) --- FAIL: TestGetVaultKey/should_handle_multi-line_vault_value (0.03s) vault_test.go:273: getVaultKey(`../../examples/ansible/complex_vault_test.yaml`, `MULTILINE_token`) = (``, yaml: unmarshal errors: line 8: cannot unmarshal !!map into string), want (`foo bar`, <nil>) --- FAIL: TestGetVaultKey/should_handle_error_on_not_found_key (0.03s) vault_test.go:273: getVaultKey(`../../examples/ansible/complex_vault_test.yaml`, `KEY_NOT_FOUND`) = (``, yaml: unmarshal errors: line 8: cannot unmarshal !!map into string), want (``, key not found) FAIL
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):
Describe the bug If a vault is used with nested dictionaries, a crash is the consequence.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):