Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git authentication secrets documentation issue #5703

Open
pcuriel opened this issue Feb 4, 2025 · 0 comments
Open

Git authentication secrets documentation issue #5703

pcuriel opened this issue Feb 4, 2025 · 0 comments

Comments

@pcuriel
Copy link

pcuriel commented Feb 4, 2025

Hi!

I have found that the documentation regarding the usage of Git authentication secrets is not correct.

On the one hand, it says that "By default, Git authentication over HTTP uses the Bearer authentication scheme". But actually:

On the other hand, the examples using GIT_AUTH_HEADER are wrong. According to the docs, it seems that both GIT_AUTH_TOKEN and GIT_AUTH_HEADER must be provided. The former with the username and password value, and the latter with a fixed "basic" value.

$ export GIT_AUTH_TOKEN=$(cat gitlab-token.txt)
$ export GIT_AUTH_HEADER=basic
$ docker build \
  --secret id=GIT_AUTH_TOKEN \
  --secret id=GIT_AUTH_HEADER \
  https://gitlab.com/example/todo-app.git

However, looking at the code, either one of GIT_AUTH_TOKEN or GIT_AUTH_HEADER must be provided.


In summary, it would be really helpful if, in addition to fixing the instructions, docs really stated what is happening behind the scenes:

  • If GIT_AUTH_TOKEN is used, the value provided is sent as follows: Authorization: basic x-access-token:<PROVIDED VALUE>(base64 encoded)
  • If GIT_AUTH_HEADER is used, the value provided is sent as follows: Authorization: <PROVIDED VALUE>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants