Repository navigation
Don't print env-supplied secrets in flag usage - #1004
Conversation
|
Welcome @locker95! |
--repo, --credential, and --askpass-url take defaults from environment variables. pflag echoes DefValue on --help and parse errors, so a token in those variables shows up in the sidecar log. Replace the displayed default when the env var is set; the value that is parsed stays put. Signed-off-by: Dean Chen <862469039@qq.com>
9d64365 to
1d31866
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: locker95, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
--repo, --credential, and --askpass-url take their defaults from the environment. pflag then prints that default in --help and when flag parsing fails, so a token in GITSYNC_REPO or GITSYNC_CREDENTIAL lands in the sidecar log.
The startup line already redacts these. This only changes the text pflag shows for the default, and only when the env var is actually set. An empty --credential still prints
[]. The value that gets parsed is unchanged.Fixes #1001