| @@ -64,15 +64,16 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result |
| 64 | | 64 | |
| 65 | // Process results. | 65 | // Process results. |
| 66 | for token := range tokens { | 66 | for token := range tokens { |
| 67 | −removed: s1 := detectors.Result{ | | |
| 68 | −removed: DetectorType: s.Type(), | | |
| 69 | −removed: Raw: []byte(token), | | |
| 70 | −removed: SecretParts: map[string]string{"pat": token}, | | |
| 71 | −removed: } | | |
| 72 | −removed: | | |
| 73 | for username := range usernames { | 67 | for username := range usernames { |
| 74 | −removed: s1.RawV2 = []byte(fmt.Sprintf("%s:%s", username, token)) | 68 | +added: s1 := detectors.Result{ |
| 75 | −removed: s1.SecretParts["username"] = username | 69 | +added: DetectorType: s.Type(), |
| | 70 | +added: Raw: []byte(token), |
| | 71 | +added: RawV2: []byte(fmt.Sprintf("%s:%s", username, token)), |
| | 72 | +added: SecretParts: map[string]string{ |
| | 73 | +added: "pat": token, |
| | 74 | +added: "username": username, |
| | 75 | +added: }, |
| | 76 | +added: } |
| 76 | | 77 | |
| 77 | if verify { | 78 | if verify { |
| 78 | if s.client == nil { | 79 | if s.client == nil { |
| @@ -94,7 +95,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result |
| 94 | | 95 | |
| 95 | // PAT matches without usernames cannot be verified but might still be useful. | 96 | // PAT matches without usernames cannot be verified but might still be useful. |
| 96 | if len(usernames) == 0 { | 97 | if len(usernames) == 0 { |
| 97 | −removed: results = append(results, s1) | 98 | +added: results = append(results, detectors.Result{ |
| | 99 | +added: DetectorType: s.Type(), |
| | 100 | +added: Raw: []byte(token), |
| | 101 | +added: SecretParts: map[string]string{"pat": token}, |
| | 102 | +added: }) |
| 98 | } | 103 | } |
| 99 | } | 104 | } |
| 100 | return | 105 | return |