sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.28k forks source link

Define a custom error type to guarantee that secrets are redacted from clone URLs #27793

Closed jplahn closed 8 months ago

jplahn commented 2 years ago

We recently fixed an issue in COREAPP-74: Tokens are being logged in gitserver error messagesDONE where we were logging secrets in clone URLs. We have fixed the issue but this does not guarantee that it does not happen again or is already not happening in another place of the codebase.

We need to audit all existing places where we might be dumping the clone URL with the secret token.

And we need to implement a new Error type which takes care of redacting the secrets from the clone URL. The following methods should be implemented:

This error type should be used for all git operations where the clone URL is used and an error is being logged or returned. Paired with Joe Chen to spec this issue out.

github-actions[bot] commented 2 years ago

Heads up @jplahn @dan-mckean - the "team/repo-management" label was applied to this issue.