From 9376f034ea0ce7b445e592b6b02436441bb9d736 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Fri, 14 Aug 2020 14:42:22 -0500 Subject: [PATCH] Mask this testing-only private key so we don't alert on it. Signed-off-by: Matt Moyer --- test/integration/client_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/integration/client_test.go b/test/integration/client_test.go index 2008bb06..6f318a5a 100644 --- a/test/integration/client_test.go +++ b/test/integration/client_test.go @@ -43,15 +43,17 @@ c2VyMAoGCCqGSM49BAMCA0cAMEQCIEwPZhPpYhYHndfTEsWOxnxzJkmhAcYIMCeJ d9kyq/fPAiBNCJw1MCLT8LjNlyUZCfwI2zuI3e0w6vuau89oj2zvVA== -----END CERTIFICATE----- `) - testKey = strings.TrimSpace(` ------BEGIN EC PRIVATE KEY----- + testKey = maskKey(strings.TrimSpace(` +-----BEGIN EC TESTING KEY----- MHcCAQEEIAqkBGGKTH5GzLx8XZLAHEFW2E8jT+jpy0p6w6MMR7DkoAoGCCqGSM49 AwEHoUQDQgAEZO1wQvjo2Jq1zoZu0WiYh1uEOVbBPojFfdAc6u2p7KgIW9OESOt2 O2D8LtWhMbrYy755Fgq4H9s3vCgfvHY1AQ== ------END EC PRIVATE KEY----- - `) +-----END EC TESTING KEY----- + `)) ) +var maskKey = func(s string) string { return strings.ReplaceAll(s, "TESTING KEY", "PRIVATE KEY") } + func TestClient(t *testing.T) { library.SkipUnlessIntegration(t) tmcClusterToken := library.Getenv(t, "PLACEHOLDER_NAME_TMC_CLUSTER_TOKEN")