MCPcopy Create free account
hub / github.com/prometheus/common / TestHideHTTPClientConfigSecrets

Function TestHideHTTPClientConfigSecrets

config/http_config_test.go:1358–1365  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1356}
1357
1358func TestHideHTTPClientConfigSecrets(t *testing.T) {
1359 c, _, err := LoadHTTPConfigFile("testdata/http.conf.good.yml")
1360 require.NoErrorf(t, err, "Error parsing %s: %s", "testdata/http.conf.good.yml", err)
1361
1362 // String method must not reveal authentication credentials.
1363 s := c.String()
1364 require.NotContainsf(t, s, "mysecret", "http client config's String method reveals authentication credentials.")
1365}
1366
1367func TestDefaultFollowRedirect(t *testing.T) {
1368 cfg, _, err := LoadHTTPConfigFile("testdata/http.conf.good.yml")

Callers

nothing calls this directly

Calls 2

LoadHTTPConfigFileFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…