Fjord-Account hosts: git clone/push not routed through the gateway (API-only parity gap) #222

Open
opened 2026-07-21 16:13:42 +00:00 by stephen · 1 comment
Owner

Summary

For a Fjord-Account host, fj drives the forge at the API level through the gateway, but git operations (clone/push/fetch) do not flow through the gateway. This is the one remaining parity gap between a Fjord-Account host and a PAT host.

Evidence (HEAD 1251c71)

  • fj auth setup-git explicitly refuses for Fjord hosts (src/cli/auth_setup_git.rs:18):

    "fj auth setup-git is for Forgejo PAT hosts. Fjord Account git credential helpers are not yet implemented (git pushes don't currently flow through the gateway)."

  • web_base_url for a FjordAccount host (src/client/resolve.rs:100) resolves git URLs against the instance's cached default_instance_public_url (the raw forge origin), and there is no fj credential helper installed for that host. So git clone / git push / git fetch target the forge directly with no fj-provided credential.
  • For a linked external instance this is especially stuck: the PAT that would authorize git is held server-side by the platform and never reaches the device.

By contrast, all REST/API ops route correctly through gateway_base_url(platform, default_instance_id) with Authorization: Bearer <jwt> (src/client/mod.rs:66-82; integration test fjord_client_routes_through_gateway_with_bearer).

Impact

Any fj workflow that shells out to git against a Fjord-selected instance (pr checkout, repo clone, develop, stack push) has no working credential. API-only flows are unaffected.

Possible directions (not a decision)

  • Route git-over-HTTPS for Fjord hosts through the gateway (a git-gateway-style path), or
  • Mint a short-lived, instance-scoped credential and install a Fjord-aware git credential helper (lift the setup-git refusal).

Origin

Surfaced by the Fjord-account login spike (managed + external forge control via fj instances + the gateway). API-level control is complete and code-proven; this git seam is the delta to full parity.

## Summary For a Fjord-Account host, fj drives the forge at the **API level** through the gateway, but **git operations (clone/push/fetch) do not flow through the gateway**. This is the one remaining parity gap between a Fjord-Account host and a PAT host. ## Evidence (HEAD `1251c71`) - `fj auth setup-git` explicitly refuses for Fjord hosts (`src/cli/auth_setup_git.rs:18`): > "`fj auth setup-git` is for Forgejo PAT hosts. Fjord Account git credential helpers are not yet implemented (git pushes don't currently flow through the gateway)." - `web_base_url` for a `FjordAccount` host (`src/client/resolve.rs:100`) resolves git URLs against the instance's cached `default_instance_public_url` (the raw forge origin), and there is no fj credential helper installed for that host. So `git clone` / `git push` / `git fetch` target the forge directly with no fj-provided credential. - For a **linked external** instance this is especially stuck: the PAT that would authorize git is held server-side by the platform and never reaches the device. By contrast, all REST/API ops route correctly through `gateway_base_url(platform, default_instance_id)` with `Authorization: Bearer <jwt>` (`src/client/mod.rs:66-82`; integration test `fjord_client_routes_through_gateway_with_bearer`). ## Impact Any fj workflow that shells out to git against a Fjord-selected instance (`pr checkout`, `repo clone`, `develop`, stack push) has no working credential. API-only flows are unaffected. ## Possible directions (not a decision) - Route git-over-HTTPS for Fjord hosts through the gateway (a `git-gateway`-style path), or - Mint a short-lived, instance-scoped credential and install a Fjord-aware git credential helper (lift the `setup-git` refusal). ## Origin Surfaced by the Fjord-account login spike (managed + external forge control via `fj instances` + the gateway). API-level control is complete and code-proven; this git seam is the delta to full parity.
Author
Owner

Direction chosen: route git through the gateway (option B), not a device-held forge token. A device never holds a forge credential for a Fjord Account host, and for a linked external forge it cannot, so a credential helper that mints one is out.

The gateway side (serve git smart HTTP at {platform}/api/v1/forge-gateway/{instance}/{owner}/{repo}.git with the same Bearer token the API calls use) is platform work, tracked as PLAT-888 on the platform side. fj's half (gateway clone URL plus a per-invocation Bearer header for fj-driven git) follows once that route exists.

In the meantime #327 stops fj-driven git from hanging on a Fjord Account host: git runs with its credential prompts off and a failed clone, fetch or push says what to do (use an SSH remote, or give git its own credential for the instance). This issue stays open for the real fix.

Direction chosen: route git through the gateway (option B), not a device-held forge token. A device never holds a forge credential for a Fjord Account host, and for a linked external forge it cannot, so a credential helper that mints one is out. The gateway side (serve git smart HTTP at `{platform}/api/v1/forge-gateway/{instance}/{owner}/{repo}.git` with the same Bearer token the API calls use) is platform work, tracked as PLAT-888 on the platform side. fj's half (gateway clone URL plus a per-invocation Bearer header for fj-driven git) follows once that route exists. In the meantime #327 stops fj-driven git from hanging on a Fjord Account host: git runs with its credential prompts off and a failed clone, fetch or push says what to do (use an SSH remote, or give git its own credential for the instance). This issue stays open for the real fix.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rasterstate/fj#222
No description provided.