Skip to content

fix(bitbucket): report that the archive url carries no credential - #129

Merged
HarshMN2345 merged 2 commits into
mainfrom
fix/bitbucket-archive-auth
Aug 7, 2026
Merged

fix(bitbucket): report that the archive url carries no credential#129
HarshMN2345 merged 2 commits into
mainfrom
fix/bitbucket-archive-auth

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

A Bitbucket site deployment on Cloud never builds. It sits at Waiting with Size 0 B, no build logs, and nothing in the queue.

Cause

getRepositoryPresignedUrl() puts the token in the url as basic userinfo. Bitbucket's archive host does not take a credential that way — it answers a redirect to a login page, so the fetch lands empty and the build is never queued. Nothing errors.

Measured against production, with the real stored token:

request result
x-token-auth:<oauth>@bitbucket.org/…/get/main.tar.gz 302, 0 bytes
same url, no auth 200, 161267 bytes
?access_token=<oauth> 403
Authorization: Bearer <oauth> 200, 161267 bytes
git ls-remote https://x-token-auth:<oauth>@…git exit 0

Only a header authenticates that host, and the caller fetching the url sends none. The same token is accepted by the git endpoint.

Change

Adapters report whether their archive url stands on its own. Bitbucket reports false, so a caller clones what it cannot download; every other adapter is unchanged and keeps its default.

The alternative — carrying an auth header to the archive fetch — reaches past the caller into the service that performs it, for a url that works without one anyway.

Follow-up

Appwrite routes a provider reporting false down the clone path it already owns for template pushes.

A caller that can only fetch a url reaches a private repository through the
credential the url carries. Bitbucket's archive host takes none from the
url -- a token offered as basic userinfo is answered with a redirect to a
login page, so what comes back is a login rather than an archive, and the
fetch lands empty with nothing to say why.

Adapters report whether their archive url stands on its own, so a caller can
clone what it cannot download. Bitbucket's git endpoint accepts the token the
archive host refuses.
@HarshMN2345
HarshMN2345 merged commit 4a7d183 into main Aug 7, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant