Skip to content

FF_GIT_URLS_WITHOUT_TOKENS defaults to true

What does this MR do?

Starting in GitLab 18.0 FF_GIT_URLS_WITHOUT_TOKENS defaults to true.

FF_GIT_URLS_WITHOUT_TOKENS behaviour
on
  • URLs in the repo's git config, command line calls, and other configs do not include the token, e.g. they look like https://gitlab.com/project/repo.git
  • For authentication, gitlab-runner sets up a custom git credential helper, which pulls the credentials from the environment
off
  • URLs in the repo's git config, command line calls, and other configs do include the token, e.g. they look like https://user:<TOKEN>@gitlab.com/project/repo.git

Users that install and configure GitLab Runner can set the value to false to opt out.

While working on this MR, we've found additional issues:

  • Issues with command line arguments when setting up the cred helper with powershell/pwsh

    Different versions of powershell handle arguments to external commands differently. Also there is an experimental feature for pwsh 7.2.x for argument handling. The exact version and experimental features can only be discovered at runtime. Thus the whole cred helper setup has been pushed to the shell writer and those specifics are handled there.

  • Issue with git stragety "clone" and FF_USE_GIT_NATIVE_CLONE

    This was recently merged, but was not implemented with the git cred helper in mind. This was back-filled and tests for native clone have been added.

Why was this MR needed?

To limit the potential of token leakage

What's the best way to test this MR?

  • run a job without changing this FF (ie. have it enabled)
  • use a private repo
  • potentially test variations:
    • test with private submodules
    • test with different executors, different shells, different OSs
    • test with powershell variations
  • see that the repo can be pulled in

In case we find a combination of executor/shell/OS/config where this does not work, the previous behavior can be restored by explicitly setting this FF to false.

What are the relevant issue numbers?

Some history related to this FF:

closes the following issues:

Edited by Hannes Hörl

Merge request reports

Loading