feat: expose the repository clone URL and its auth headers - #135
Conversation
A provider without archive downloads answers supportsRepositoryArchives() with false, but gave consumers nothing to clone with - the authenticated URL lived inside generateCloneCommand() only. getRepositoryCloneUrl() and getRepositoryCloneHeaders() hand out the pieces separately, credentials on a header rather than the URL, for consumers that clone through infrastructure of their own (the orchestrator's clone artifact). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThe PR adds a provider-level contract for retrieving a credential-free repository clone URL and separate authentication headers, with an Origin implementation using HTTP Basic authentication.
Confidence Score: 4/5The PR appears safe to merge, with the non-blocking recommendation to add focused coverage for the new clone URL and authentication-header contract. The implementation preserves Origin's existing clone target while moving credentials into a Basic Authorization header; no current functional failure was established, but the new public authentication behavior is untested and the Origin integration suite is skipped. Files Needing Attention: src/VCS/Adapter/Git/Origin.php Important Files Changed
Prompt To Fix All With AI### Issue 1
src/VCS/Adapter/Git/Origin.php:1714-1732
**Clone authentication contract lacks coverage**
These new public methods define security-sensitive URL and authentication behavior, but no focused test verifies that credentials stay out of the URL, path components are encoded, and the installation token produces the expected Basic header. Since Origin's live integration suite is skipped, regressions can cause private clones to fail or expose credentials without being detected.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat: expose the repository clone URL an..." | Re-trigger Greptile |
Deployments::createFromVcs() owns the choice every call site used to spell out: providers with archive downloads keep handing the sidecar a presigned tarball URL, and a provider without them (the upcoming Origin) is cloned by the sidecar itself over Git HTTPS, through the orchestrator's new clone artifact. Credentials ride a header via the adapter's new clone surface, never the URL. Depends on open-runtimes/orchestrator (clone artifact), open-runtimes/sdk-for-php#12 and utopia-php/vcs#135; composer pins the two library branches until they are tagged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What does this PR do?
A provider without archive downloads reports
supportsRepositoryArchives() === false, but the library gave consumers nothing to clone with — the authenticated URL existed only insidegenerateCloneCommand(), as an embedded-credential string in a shell command.This adds two methods next to the capability:
getRepositoryCloneUrl($owner, $repositoryName)— the Git HTTPS URL, without credentials. BaseGitthrows (mirroringgetRepositoryPresignedUrl()); Origin overrides.getRepositoryCloneHeaders()— the headers that authenticate a fetch of that URL (Origin:Authorization: Basic x-access-token:<installation token>), empty when none are needed.Credentials ride a header rather than URL userinfo so tokens never surface in the errors and logs that echo URLs verbatim.
First consumer: Appwrite's deployment pipeline hands these to the orchestrator's new
cloneartifact for providers that serve content over Git HTTPS only (Origin).Test Plan
authenticatedCloneUrl(), which the skipped suite covers.🤖 Generated with Claude Code