From 109b8bef5fbaf21a2cd09619c9ba01226fa9e5f9 Mon Sep 17 00:00:00 2001 From: ankushgoel27 Date: Sun, 29 Oct 2023 20:36:16 +0530 Subject: [PATCH] adding 'token' keyword to regex --- pkg/detectors/github_old/github_old.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/detectors/github_old/github_old.go b/pkg/detectors/github_old/github_old.go index 57dbeae7a613..4fd0577b25a1 100644 --- a/pkg/detectors/github_old/github_old.go +++ b/pkg/detectors/github_old/github_old.go @@ -25,7 +25,7 @@ func (Scanner) DefaultEndpoint() string { return "https://api.github.com" } var ( // Oauth token // https://developer.github.com/v3/#oauth2-token-sent-in-a-header - keyPat = regexp.MustCompile(`(?i)(?:github|gh|pat)[^\.].{0,40}[ =:'"]+([a-f0-9]{40})\b`) + keyPat = regexp.MustCompile(`(?i)(?:github|gh|pat|token)[^\.].{0,40}[ =:'"]+([a-f0-9]{40})\b`) // TODO: Oauth2 client_id and client_secret // https://developer.github.com/v3/#oauth2-keysecret