Skip to content

Debug output exposes access tokens in certain error cases #96

@Megan-Wright

Description

@Megan-Wright

Expected behaviour

Once I have set my access token using export GITHUB_TOKEN=foo I should not every see my access token displayed while running promote commands

Actual behaviour

Access tokens are displayed within github urls in errors when using the --debug flag, e.g:

(base) Megans-MacBook-Pro:github.com [email protected]$ ./services/services promote --from promote-demo --to https://github.com/Megan-Wright/gitops-example.git --service promote-demo --debug --commit-name=Megan-Wright [email protected]
2020/06/02 16:03:48 DEBUG: Cloning into 'gitops-example'...
remote: Repository not found.
fatal: repository 'https://promotion:<my access token>@github.com/Megan-Wright/gitops-example.git/' not found

Steps to Reproduce

Run a promote command which will fail with --debug set.
There are two cases I have noticed the access token being surfaced:

  • The access token is invalid/doesn't have the correct permissions
  • The repository you are trying to push to doesn't exist (as above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions