Git LFS with a token doesn't work with GitHub Enterprise Server without subdomain isolation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
We have found an issue regarding GitHub checkout action v2, Git LFS and GitHub Enterprise Server (on Azure).
We have a very simply workflow which doesn't work:
- uses: actions/checkout@v2
with:
lfs: 'true'
All git lfs request will be rejected with following error: HTTP/1.1 400 Bad Request
By enabling GIT_TRACE=1 and GIT_CURL_VERBOSE=1 we see following:
> GET /storage/lfs/3/objects/d5c5871801d62c64f453462558c3a4697ac162730e49d48461ce87bafa83684c HTTP/1.1
> Host: ***.westeurope.cloudapp.azure.com
> Authorization: RemoteAuth AAAAAF72C****
> Authorization: Basic * * * * *
> User-Agent: git-lfs/2.12.1 (GitHub; windows amd64; go 1.14.10; git 85b28e06)
....
> HTTP/1.1 400 Bad Request
> Content-Length: 150
> Content-Type: text/html
> Date: Thu, 17 Dec 2020 10:25:15 GMT
> Server: GitHub.com
My current understanding:
The GitHub checkout action is using the extraheader option with basic authorization in the local git config.
So for each request this basic authorization header will be used.
In additional a remoteAuth authorization header will be added as result of the git lfs batch api reponse /info/lfs/objects/batch:
{
"objects": [
{
"oid": "fcc622faad3b44962e9211cc2fd478e7c0480d516098fab011ccdb1d29fbde81",
"size": 4612119,
"actions": {
"download": {
"href": "...",
"header": {
"Authorization": "RemoteAuth AAAAAMHDN3KJWR****"
}
}
}
}
]
}
Now we have two authorization headers.
In this comment https://github.com/git-lfs/git-lfs/issues/4031#issuecomment-589254543 one of the git lfs maintainer mentions that the git lfs server only allows request with one authorization header.
So all requests with two authorization headers will be rejected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the actions/checkout@v2 workflow using lfs: 'true' on GitHub Enterprise Server without subdomain isolation, and inspect the local Git extraheader behavior alongside the Git LFS /info/lfs/objects/batch response. Reproduce the failing request with GIT_TRACE=1 and GIT_CURL_VERBOSE=1; done means Git LFS requests no longer send conflicting authorization headers and the checkout succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100