restored Node.Sanitize() for RPC endpoints

multiple other updates from code review
This commit is contained in:
Chris Baker
2021-03-26 17:03:15 +00:00
parent c5731ebecc
commit a52f32dedc
23 changed files with 121 additions and 99 deletions

View File

@@ -155,13 +155,12 @@ func TestEventStream_PayloadValue(t *testing.T) {
require.NotEmpty(t, n.ID)
// perform a raw decoding and look for:
// - "ID", to make sure that raw decoding is correct
// - "SecretID", to make sure it's not present
// - "ID" to make sure that raw decoding is working correctly
// - "SecretID" to make sure it's not present
raw := make(map[string]map[string]interface{}, 0)
cfg := &mapstructure.DecoderConfig{
Result: &raw,
}
dec, err := mapstructure.NewDecoder(cfg)
require.NoError(t, err)
require.NoError(t, dec.Decode(e.Payload))

View File

@@ -202,7 +202,9 @@ func TestNodes_NoSecretID(t *testing.T) {
t.Fatalf("err: %s", err)
})
// Query the node, ensure that .SecretID was not returned by the HTTP server
// perform a raw http call and make sure that:
// - "ID" to make sure that raw decoding is working correctly
// - "SecretID" to make sure it's not present
resp := make(map[string]interface{})
_, err := c.query("/v1/node/"+nodeID, &resp, nil)
require.NoError(t, err)