Repository navigation
feat(repository): support self-hosted servers via repository URLs - #148
Merged
Merged
Conversation
This was referenced Oct 10, 2026
server attribute
roxblnfk
force-pushed
the
feat/repository-server
branch
from
October 12, 2026 08:18
e11d9bc to
39235b4
Compare
fix(repository): send the GitLab token only to the GitLab server feat(repository): read tokens from `DLOAD_TOKEN_<HOST>`, ahead of `GITHUB_TOKEN` and `GITLAB_TOKEN` The server comes from the URL in `uri` rather than a separate attribute: `uri` already accepted a URL and dropped its host, so `https://ghe.corp.com/org/repo` silently downloaded `org/repo` from github.com. A value without a scheme never names a server. The token variable is derived from the server address so that only the user's environment, never a config file, decides which host receives a token; the encoding is injective, so `ghe-example.com` cannot read the token of `ghe.example.com`. Closes #143 Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Symfony HttpClient strips only `Authorization` and `Cookie` when a redirect changes the host, so a GitLab release link pointing elsewhere received `PRIVATE-TOKEN`. DLoad follows redirects itself, which keeps the rule independent of header names and Symfony versions. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
roxblnfk
force-pushed
the
feat/repository-server
branch
from
October 12, 2026 08:21
39235b4 to
940021f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
uriwith a scheme points a repository at GitHub Enterprise Server, a self-hosted GitLab or a local fake API:https://ghe.example.com/owner/repo,https://gitlab.example.com:8443/group/sub/project,http://127.0.0.1:8080/owner/repo. The API is{server}/api/v3(GitHub) /{server}/api/v4(GitLab).owner/repoandhttps://github.com/owner/repowork as before.github.com/owner/repoandgitlab.com/…still read as the public hosts. For GitHub, a scheme-less value with a foreign host (ghe.example.com/org/repo) is an error: it used to downloadorg/repofrom github.com silently.owner/repo, GitLab a project path with subgroups; a trailing/and.gitare tolerated, anything pointing inside a repository (/releases,/-/…) is an error. GitLab under a relative URL root is not supported.DLOAD_TOKEN_<HOST>: a dot becomes_, a hyphen__, a port follows after___, an IPv6 address starts with_and lists all eight groups (DLOAD_TOKEN_GHE_EXAMPLE_COM,DLOAD_TOKEN_MY__GHE_CORP___8443), so different servers never share a variable.DLOAD_TOKEN_GITHUB_COM/DLOAD_TOKEN_GITLAB_COMwin overGITHUB_TOKEN/GITLAB_TOKEN, which never leave the public hosts. A token goes only to the exact scheme, host and port of its server, and over plainhttponly to loopback.Authorization,PRIVATE-TOKEN,JOB-TOKENandCookiewhen a redirect leaves the scheme, host and port of the request. Symfony HttpClient stripped onlyAuthorizationandCookie, so a GitLab release link to another host receivedPRIVATE-TOKEN— on gitlab.com too.github@ghe.example.com/owner/repo); paths and records of the public hosts are unchanged, so existing registries stay valid.Repository::getId()gives the downloader that key.Why?
Unblocks roadrunner-php/cli#49, whose
rr getacceptance tests run against a local fake API. The design started in #143 (comment) with a separateserverattribute; it was replaced by the URL inuribefore release (see the follow-up comment in #143).Merge note
Three commits, ready for a rebase merge:
chore: Add AGENTS.md, the feature, andfix(repository): keep API tokens on their server across redirects— a fix of its own, since the GitLab token followed redirects on gitlab.com before this PR too.Checklist
🤖 Generated with Claude Code