Skip to content

Redact GitLab access token from error log message

Created by: beyang

t=2020-01-27T20:53:04+0000 lvl=warn msg="error cloning repo" repo=REDACTED err="error cloning repo: repo REDACTED (https://git:[email protected]) not cloneable: exit status 128 (output follows)\n\nremote: You are not allowed to download code from this project.\nfatal: unable to access 'https://REDACTED.git/': The requested URL returned error: 403\n"

When the GitLab token is unauthorized to download repository contents, an error message is printed to the logs that contains the clone URL, which can contain the access token. The access token should be redacted from logs.