From acce7d8206ff06e70a29fc5cf2bdba7b4747c944 Mon Sep 17 00:00:00 2001 From: okJiang <819421878@qq.com> Date: Fri, 10 Feb 2023 15:20:15 +0800 Subject: [PATCH 1/3] use ****** in secret key --- br/pkg/storage/parse_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/br/pkg/storage/parse_test.go b/br/pkg/storage/parse_test.go index 3d86ccef1c38d..0645cc3fc17b0 100644 --- a/br/pkg/storage/parse_test.go +++ b/br/pkg/storage/parse_test.go @@ -69,15 +69,15 @@ func TestCreateStorage(t *testing.T) { require.Equal(t, "TestKey", s3.SseKmsKeyId) // special character in access keys - s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=NXN7IPIOSAAKDEEOLMAF&secret-access-key=nREY/7Dt+PaIbYKrKlEEMMF/ExCiJEX=XMLPUANw&session-token=FQoDYXdzEPP//////////wEaDPv5GPAhRW8pw6/nsiKsAZu7sZDCXPtEBEurxmvyV1r+nWy1I4VPbdIJV+iDnotwS3PKIyj+yDnOeigMf2yp9y2Dg9D7r51vWUyUQQfceZi9/8Ghy38RcOnWImhNdVP5zl1zh85FHz6ytePo+puHZwfTkuAQHj38gy6VF/14GU17qDcPTfjhbETGqEmh8QX6xfmWlO0ZrTmsAo4ZHav8yzbbl3oYdCLICOjMhOO1oY+B/DiURk3ZLPjaXyoo2Iql2QU=`, nil) + s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=NXN7*******LMAF&secret-access-key=nREY**********XMLPUANw&session-token=FQoD*********PjaXyoo2Iql2QU=`, nil) require.NoError(t, err) s3 = s.GetS3() require.NotNil(t, s3) require.Equal(t, "bucket4", s3.Bucket) require.Equal(t, "prefix/path", s3.Prefix) - require.Equal(t, "NXN7IPIOSAAKDEEOLMAF", s3.AccessKey) - require.Equal(t, "nREY/7Dt+PaIbYKrKlEEMMF/ExCiJEX=XMLPUANw", s3.SecretAccessKey) - require.Equal(t, "FQoDYXdzEPP//////////wEaDPv5GPAhRW8pw6/nsiKsAZu7sZDCXPtEBEurxmvyV1r+nWy1I4VPbdIJV+iDnotwS3PKIyj+yDnOeigMf2yp9y2Dg9D7r51vWUyUQQfceZi9/8Ghy38RcOnWImhNdVP5zl1zh85FHz6ytePo+puHZwfTkuAQHj38gy6VF/14GU17qDcPTfjhbETGqEmh8QX6xfmWlO0ZrTmsAo4ZHav8yzbbl3oYdCLICOjMhOO1oY+B/DiURk3ZLPjaXyoo2Iql2QU=", s3.SessionToken) + require.Equal(t, "NXN7*******LMAF", s3.AccessKey) + require.Equal(t, "nREY**********XMLPUANw", s3.SecretAccessKey) + require.Equal(t, "FQoD*********PjaXyoo2Iql2QU=", s3.SessionToken) require.True(t, s3.ForcePathStyle) // parse role ARN and external ID From f38657f7ea0ab2263ca7d33a468f619bd1f1a796 Mon Sep 17 00:00:00 2001 From: okJiang <819421878@qq.com> Date: Fri, 10 Feb 2023 16:43:30 +0800 Subject: [PATCH 2/3] use ****** --- br/pkg/storage/parse_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/br/pkg/storage/parse_test.go b/br/pkg/storage/parse_test.go index 0645cc3fc17b0..59eb466f29d9a 100644 --- a/br/pkg/storage/parse_test.go +++ b/br/pkg/storage/parse_test.go @@ -69,15 +69,15 @@ func TestCreateStorage(t *testing.T) { require.Equal(t, "TestKey", s3.SseKmsKeyId) // special character in access keys - s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=NXN7*******LMAF&secret-access-key=nREY**********XMLPUANw&session-token=FQoD*********PjaXyoo2Iql2QU=`, nil) + s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=******&secret-access-key=******&session-token=******`, nil) require.NoError(t, err) s3 = s.GetS3() require.NotNil(t, s3) require.Equal(t, "bucket4", s3.Bucket) require.Equal(t, "prefix/path", s3.Prefix) - require.Equal(t, "NXN7*******LMAF", s3.AccessKey) - require.Equal(t, "nREY**********XMLPUANw", s3.SecretAccessKey) - require.Equal(t, "FQoD*********PjaXyoo2Iql2QU=", s3.SessionToken) + require.Equal(t, "******", s3.AccessKey) + require.Equal(t, "******", s3.SecretAccessKey) + require.Equal(t, "******", s3.SessionToken) require.True(t, s3.ForcePathStyle) // parse role ARN and external ID From fce24cc7946767f1965fd633d69c4f605cf6027d Mon Sep 17 00:00:00 2001 From: okJiang <819421878@qq.com> Date: Fri, 10 Feb 2023 17:24:27 +0800 Subject: [PATCH 3/3] add + --- br/pkg/storage/parse_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/br/pkg/storage/parse_test.go b/br/pkg/storage/parse_test.go index 59eb466f29d9a..2dbeaabcb4386 100644 --- a/br/pkg/storage/parse_test.go +++ b/br/pkg/storage/parse_test.go @@ -69,14 +69,14 @@ func TestCreateStorage(t *testing.T) { require.Equal(t, "TestKey", s3.SseKmsKeyId) // special character in access keys - s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=******&secret-access-key=******&session-token=******`, nil) + s, err = ParseBackend(`s3://bucket4/prefix/path?access-key=******&secret-access-key=******+&session-token=******`, nil) require.NoError(t, err) s3 = s.GetS3() require.NotNil(t, s3) require.Equal(t, "bucket4", s3.Bucket) require.Equal(t, "prefix/path", s3.Prefix) require.Equal(t, "******", s3.AccessKey) - require.Equal(t, "******", s3.SecretAccessKey) + require.Equal(t, "******+", s3.SecretAccessKey) require.Equal(t, "******", s3.SessionToken) require.True(t, s3.ForcePathStyle)