Remove sensitive fields when reading config data (#4216)

* Remove sensitive fields when reading config data

* Do not use structs; build and return map explicitly

* Revert tag in postgresql

* Fix tests
This commit is contained in:
Calvin Leung Huang
2018-03-30 10:17:39 -04:00
committed by GitHub
parent 08770c6366
commit 938b748914
14 changed files with 65 additions and 43 deletions

View File

@@ -209,10 +209,8 @@ func TestBackend_config_connection(t *testing.T) {
}
expected := map[string]interface{}{
"plugin_name": "postgresql-database-plugin",
"connection_details": map[string]interface{}{
"connection_url": "sample_connection_url",
},
"plugin_name": "postgresql-database-plugin",
"connection_details": map[string]interface{}{},
"allowed_roles": []string{"*"},
"root_credentials_rotate_statements": []string{},
}
@@ -519,10 +517,8 @@ func TestBackend_connectionCrud(t *testing.T) {
// Read connection
expected := map[string]interface{}{
"plugin_name": "postgresql-database-plugin",
"connection_details": map[string]interface{}{
"connection_url": connURL,
},
"plugin_name": "postgresql-database-plugin",
"connection_details": map[string]interface{}{},
"allowed_roles": []string{"plugin-role-test"},
"root_credentials_rotate_statements": []string{},
}