@@ -26,13 +26,13 @@ var (
26
26
// https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/, as well as for other general cases.
27
27
28
28
// Covers 'username:appPassword' pattern
29
- usernamePat1 = regexp .MustCompile (`\b([A-Za-z0-9-_]{1,30}):ATBB[A-Za-z0-9_=.-]+[A-Z0-9]{8}\b` )
29
+ credentialPairPattern = regexp .MustCompile (`\b([A-Za-z0-9-_]{1,30}):ATBB[A-Za-z0-9_=.-]+[A-Z0-9]{8}\b` )
30
30
// Covers assignment of username to variable
31
- usernamePat2 = regexp .MustCompile (`(?im)(?:user|usr)\S{0,40}?[:=\s]{1,3}[ '"=]?([a-zA-Z0-9-_]{1,30})\b` )
31
+ usernameAssignmentPattern = regexp .MustCompile (`(?im)(?:user|usr)\S{0,40}?[:=\s]{1,3}[ '"=]?([a-zA-Z0-9-_]{1,30})\b` )
32
32
// Covers 'https://[email protected] ' pattern
33
- usernamePat3 = regexp .MustCompile (`https://([a-zA-Z0-9-_]{1,30})@bitbucket.org` )
33
+ usernameUrlPattern = regexp .MustCompile (`https://([a-zA-Z0-9-_]{1,30})@bitbucket.org` )
34
34
// Covers '("username", "password")' pattern, used for HTTP Basic Auth
35
- usernamePat4 = regexp .MustCompile (`"([a-zA-Z0-9-_]{1,30})",(?: )?"ATBB[A-Za-z0-9_=.-]+[A-Z0-9]{8}"` )
35
+ httpBasicAuthPattern = regexp .MustCompile (`"([a-zA-Z0-9-_]{1,30})",(?: )?"ATBB[A-Za-z0-9_=.-]+[A-Z0-9]{8}"` )
36
36
37
37
usernamePatterns = []* regexp.Regexp {usernamePat1 , usernamePat2 , usernamePat3 , usernamePat4 }
38
38
@@ -69,7 +69,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
69
69
}
70
70
71
71
if verify {
72
- req , err := http .NewRequestWithContext (ctx , "GET" , "https://api.bitbucket.org/2.0/user" , nil )
72
+ req , err := http .NewRequestWithContext (ctx , http . MethodGet , "https://api.bitbucket.org/2.0/user" , nil )
73
73
if err != nil {
74
74
continue
75
75
}
0 commit comments