99)
1010
1111func TestMaskStringWithNothingRegistered (t * testing.T ) {
12+ t .Parallel ()
1213 m := NewMasker ()
1314
1415 if got := m .String ("hello world" ); got != "hello world" {
@@ -17,6 +18,7 @@ func TestMaskStringWithNothingRegistered(t *testing.T) {
1718}
1819
1920func TestMaskStringReplacesAllOccurrences (t * testing.T ) {
21+ t .Parallel ()
2022 m := NewMasker ("secret" )
2123
2224 got := m .String ("a secret and another secret" )
@@ -27,6 +29,7 @@ func TestMaskStringReplacesAllOccurrences(t *testing.T) {
2729}
2830
2931func TestMaskStringEmptyEntriesSkipped (t * testing.T ) {
32+ t .Parallel ()
3033 m := NewMasker ("" , "tok" )
3134
3235 got := m .String ("xtoky" )
@@ -40,6 +43,7 @@ func TestMaskStringEmptyEntriesSkipped(t *testing.T) {
4043}
4144
4245func TestMaskStringLongerBeforeShorter (t * testing.T ) {
46+ t .Parallel ()
4347 // "ab" is a substring of "abcdef"; the longer one must be masked first
4448 // so we don't see "***cdef" instead of a single "***".
4549 m := NewMasker ("ab" , "abcdef" )
@@ -51,6 +55,7 @@ func TestMaskStringLongerBeforeShorter(t *testing.T) {
5155}
5256
5357func TestMaskerSetDeduplicates (t * testing.T ) {
58+ t .Parallel ()
5459 m := NewMasker ("a" , "a" , "b" )
5560
5661 values := m .Values ()
@@ -84,6 +89,7 @@ func TestMaskersAreIndependent(t *testing.T) {
8489}
8590
8691func TestMaskerAddAppendsKeepingExisting (t * testing.T ) {
92+ t .Parallel ()
8793 m := NewMasker ("first" )
8894
8995 m .Add ("second" )
@@ -95,6 +101,7 @@ func TestMaskerAddAppendsKeepingExisting(t *testing.T) {
95101}
96102
97103func TestMaskerAddDeduplicatesAgainstExisting (t * testing.T ) {
104+ t .Parallel ()
98105 m := NewMasker ("tok" )
99106
100107 m .Add ("tok" , "" , "tok" )
@@ -111,6 +118,7 @@ func TestMaskerAddDeduplicatesAgainstExisting(t *testing.T) {
111118}
112119
113120func TestMaskerAddKeepsLengthDescOrder (t * testing.T ) {
121+ t .Parallel ()
114122 // "ab" registered first; adding the longer "abcdef" must still mask the
115123 // longer match first so a substring secret does not leak its remainder.
116124 m := NewMasker ("ab" )
@@ -123,6 +131,7 @@ func TestMaskerAddKeepsLengthDescOrder(t *testing.T) {
123131}
124132
125133func TestMaskerAddOnEmptyRegistry (t * testing.T ) {
134+ t .Parallel ()
126135 m := NewMasker ()
127136
128137 m .Add ("late" )
@@ -133,6 +142,7 @@ func TestMaskerAddOnEmptyRegistry(t *testing.T) {
133142}
134143
135144func TestMaskerAddNoValuesIsNoop (t * testing.T ) {
145+ t .Parallel ()
136146 m := NewMasker ("keep" )
137147
138148 m .Add ()
@@ -147,6 +157,7 @@ func TestMaskerAddNoValuesIsNoop(t *testing.T) {
147157// docket builds text - the `(item=<value>)` loop suffix on a task name - and
148158// masking is literal substring replacement, so both spellings must register.
149159func TestMaskerSetRegistersTrimmedSpelling (t * testing.T ) {
160+ t .Parallel ()
150161 m := NewMasker (" padded " )
151162
152163 if got := m .String ("deploy (item=padded)" ); got != "deploy (item=***)" {
@@ -161,6 +172,7 @@ func TestMaskerSetRegistersTrimmedSpelling(t *testing.T) {
161172// late-registration path, which is how a task-declared secret joins the
162173// registry - after the recipe has parsed and already named its expansions.
163174func TestMaskerAddRegistersTrimmedSpelling (t * testing.T ) {
175+ t .Parallel ()
164176 m := NewMasker ()
165177
166178 m .Add ("\t late\n " )
@@ -175,6 +187,7 @@ func TestMaskerAddRegistersTrimmedSpelling(t *testing.T) {
175187// replaced first, so text holding the full value masks to a single `***`
176188// rather than leaving the padding behind around an inner match.
177189func TestSensitiveTrimmedSpellingSortsAfterLiteral (t * testing.T ) {
190+ t .Parallel ()
178191 m := NewMasker (" tok " )
179192
180193 values := m .Values ()
@@ -193,6 +206,7 @@ func TestSensitiveTrimmedSpellingSortsAfterLiteral(t *testing.T) {
193206// reintroducing the empty entry the masker drops: an all-whitespace
194207// value trims to "", which would otherwise match every position in a string.
195208func TestSensitiveWhitespaceOnlyValueIsDropped (t * testing.T ) {
209+ t .Parallel ()
196210 m := NewMasker (" " )
197211
198212 if got := m .Values (); len (got ) != 1 || got [0 ] != " " {
@@ -206,6 +220,7 @@ func TestSensitiveWhitespaceOnlyValueIsDropped(t *testing.T) {
206220// TestSensitiveUnpaddedValueRegistersOnce keeps the common case free of a
207221// duplicate entry: a value that is already trimmed contributes one spelling.
208222func TestSensitiveUnpaddedValueRegistersOnce (t * testing.T ) {
223+ t .Parallel ()
209224 m := NewMasker ("plain" )
210225
211226 if got := m .Values (); len (got ) != 1 || got [0 ] != "plain" {
@@ -218,6 +233,7 @@ func TestSensitiveUnpaddedValueRegistersOnce(t *testing.T) {
218233// not parse back, which escapes the double quote the value carries, so the
219234// registered literal no longer matches inside the address it produced.
220235func TestMaskerSetRegistersEscapedSpelling (t * testing.T ) {
236+ t .Parallel ()
221237 m := NewMasker (`quo"ted` )
222238
223239 if got := m .String (`dokku_stub[key="quo\"ted"]` ); got != `dokku_stub[key="***"]` {
@@ -232,6 +248,7 @@ func TestMaskerSetRegistersEscapedSpelling(t *testing.T) {
232248// late-registration path, which is how a task-declared secret joins the
233249// registry - after the recipe has parsed and already named its tasks.
234250func TestMaskerAddRegistersEscapedSpelling (t * testing.T ) {
251+ t .Parallel ()
235252 m := NewMasker ()
236253
237254 m .Add (`la"te` )
@@ -246,6 +263,7 @@ func TestMaskerAddRegistersEscapedSpelling(t *testing.T) {
246263// longer one, so it is replaced first; the reverse order would leave the
247264// escaping backslash stranded next to a `***`.
248265func TestSensitiveEscapedSpellingSortsBeforeLiteral (t * testing.T ) {
266+ t .Parallel ()
249267 m := NewMasker (`a"b` )
250268
251269 values := m .Values ()
@@ -265,6 +283,7 @@ func TestSensitiveEscapedSpellingSortsBeforeLiteral(t *testing.T) {
265283// own, so it reaches an address escaped only when the value also carries a
266284// comma, a bracket, or a quote. Both spellings register either way.
267285func TestSensitiveBackslashValueRegistersEscapedSpelling (t * testing.T ) {
286+ t .Parallel ()
268287 m := NewMasker (`a,b\c` )
269288
270289 if got := m .String (`dokku_stub[key="a,b\\c"]` ); got != `dokku_stub[key="***"]` {
@@ -280,6 +299,7 @@ func TestSensitiveBackslashValueRegistersEscapedSpelling(t *testing.T) {
280299// escaping inside those quotes, so the literal still matches there and the
281300// registry stays at one entry.
282301func TestSensitiveCommaValueRegistersOnce (t * testing.T ) {
302+ t .Parallel ()
283303 m := NewMasker ("a,b" )
284304
285305 if got := m .Values (); len (got ) != 1 || got [0 ] != "a,b" {
@@ -294,6 +314,7 @@ func TestSensitiveCommaValueRegistersOnce(t *testing.T) {
294314// derivations compose. A value that is both padded and escape-bearing is
295315// printed four ways, and every one of them masks.
296316func TestSensitivePaddedEscapedValueRegistersEverySpelling (t * testing.T ) {
317+ t .Parallel ()
297318 m := NewMasker (` p"q ` )
298319
299320 values := m .Values ()
@@ -312,6 +333,7 @@ func TestSensitivePaddedEscapedValueRegistersEverySpelling(t *testing.T) {
312333// registering the escaped spelling must not widen masking to a value that
313334// merely shares a prefix with a secret.
314335func TestSensitiveEscapedSpellingLeavesLookalikesAlone (t * testing.T ) {
336+ t .Parallel ()
315337 m := NewMasker (`a"b` )
316338
317339 if got := m .String (`dokku_stub[key=keepzzz]` ); got != `dokku_stub[key=keepzzz]` {
@@ -320,6 +342,7 @@ func TestSensitiveEscapedSpellingLeavesLookalikesAlone(t *testing.T) {
320342}
321343
322344func TestMaskStringConcurrent (t * testing.T ) {
345+ t .Parallel ()
323346 m := NewMasker ("secret" )
324347
325348 var wg sync.WaitGroup
@@ -343,6 +366,7 @@ func TestMaskStringConcurrent(t *testing.T) {
343366}
344367
345368func TestMaskerValuesReturnsCopy (t * testing.T ) {
369+ t .Parallel ()
346370 m := NewMasker ("a" )
347371
348372 values := m .Values ()
@@ -358,6 +382,7 @@ func TestMaskerValuesReturnsCopy(t *testing.T) {
358382// `loop:` can resolve to a scalar, a list, or a mapping, so a secret can sit
359383// at any depth and on either side of a map entry.
360384func TestMaskValue (t * testing.T ) {
385+ t .Parallel ()
361386 m := NewMasker ("sekret" )
362387
363388 cases := []struct {
@@ -416,6 +441,7 @@ func TestMaskValue(t *testing.T) {
416441// when nothing is registered, so the listing renders identically for a recipe
417442// that declares no secrets.
418443func TestMaskValueWithNothingRegistered (t * testing.T ) {
444+ t .Parallel ()
419445 m := NewMasker ()
420446
421447 in := map [string ]interface {}{"user" : "alice" , "ports" : []interface {}{80 , "443" }}
0 commit comments