Skip to content

Commit

Permalink
gcp cred not set (#3535)
Browse files Browse the repository at this point in the history
* stopgap i guess

* slightly smarter
  • Loading branch information
zricethezav authored Oct 30, 2024
1 parent b6ace9d commit 4d355d4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_GCPApplicationDefaultCredentials,
Raw: []byte(detectedClientID),
RawV2: []byte(detectedClientID + creds.RefreshToken),
Redacted: creds.RefreshToken[:3] + "..." + creds.RefreshToken[min(len(creds.RefreshToken)-1, 47):], // censor the refresh token
}

if len(creds.RefreshToken) > 3 {
s1.Redacted = creds.RefreshToken[:3] + "..." + creds.RefreshToken[min(len(creds.RefreshToken)-1, 47):]
}

if verify {
Expand Down

0 comments on commit 4d355d4

Please sign in to comment.