Adds a unit test to make sure the status endpoint doesn't ever show anything

with "token" in the name.
pull/2594/head
James Phillips 8 years ago
parent d51303b998
commit 34da7ccd64
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11

@ -1,6 +1,7 @@
package agent
import (
"bytes"
"errors"
"fmt"
"io"
@ -117,6 +118,15 @@ func TestHTTPAgentSelf(t *testing.T) {
if val.Coord != nil {
t.Fatalf("should have been nil: %v", val.Coord)
}
// Make sure there's nothing called "token" that's leaked.
raw, err := srv.marshalJSON(req, obj)
if err != nil {
t.Fatalf("err: %v", err)
}
if bytes.Contains(bytes.ToLower(raw), []byte("token")) {
t.Fatalf("bad: %s", raw)
}
}
func TestHTTPAgentReload(t *testing.T) {

Loading…
Cancel
Save