Reach the Commons through the gateway, with no PAT #252
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/me-commons"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the recommendation in fleet's
docs/DESIGN-fj-fjord-operated-forge-auth.md(fleet#410).fjread only/me/forge-instances, which by design excludes the Commons, so there was no instance id and no gateway route to construct. The phone apps have called/me/commonssince beforefjexisted; this isfjcatching up, not a new mechanism.Verified live
No PAT involved. That is the addressing problem closed.
What I ran versus reasoned about, since it matters:
fj instancesfj api repos/…against Commonsfj instances use commons, which writesdefault_instance_idinto the sharedhosts.tomlon this box. The brief said not to disturb the stored session other lanes depend on, so I stopped.fj pr createThe two unrun ones share one prerequisite and one verification:
fj instancesproves discovery and the gateway id;fj apiproves routing. They are separable and only the first is done.The revocation condition
fjcannot extend the window, because it never holds anything minted. The gateway mints the per-user forge token server-side and attaches it to the proxied call; nothing minted reaches a client.fjstores only the platform bearer it already had before this change, and the Commons response is fetched on every invocation and never persisted, since a cachedjoinedwould offer an instance the account may since have lost.The minted-token lifetime is not observable from
fj, and I have not invented a number. The mint happens inside the platform, between it and Paragon; the responsefjsees is the proxied Forgejo payload, which carries nothing about the token's expiry. The revocation window is therefore still exactly what the design said it was, the minted-token lifetime plus the gateway cache TTL, both of which live in fjord-platform and Paragon and remain unmeasured. That measurement is still open, and this change neither improves nor worsens it.Where
fjdiffers from fjord-androidOne place, deliberately. The app silently omits a Commons the account has not joined.
fjwithholds the instance identically, but keeps theCommonsInfoso it can say why:fj instancesprints a dimmed line, andfj instances use commonsreports "has not joined" or "this platform does not advertise a Commons" instead of "no instance matches". A CLI has no join button to notice, so silence reads as "no such forge".Not a divergence but worth noting: both platform calls run concurrently under one
try_join!and share a single refresh, since they use the same bearer and a 401 from either means the same expired session.Not regressed
resolve_fjordstill errors first on a PAT-only host, so that message is unchanged.--hostwith a PAT still routes directly to the forge, which is the path the three queued assay branches use today; nothing here touches it.Checks
cargo buildclean,cargo clippy --all-targetsclean,cargo fmtapplied, 772 tests pass including 7 new ones: joined, not joined, missing gateway id, 404,{"commons": null}, 401 mapping to theSessionExpiredmarker, and the gateway path built for the Commons being the ordinary one.No token or bearer appears in this PR, in the code, or in any test fixture.
hosts.tomlon this box was compared before and after and is byte-identical.Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#252ae06ee506654sha256:2c0326c767cbcc050ce2e2318b6551a83df9dd6c7cf10074a2b933787eca76f7openai:gpt-5.5+anthropic:claude-haiku-4-5-202510010067050 in / 11735 out(32306from cache) ≈$0.4177GITHUB_TOKENd79aaa8d3891Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#252ae06ee506654sha256:2c0326c767cbcc050ce2e2318b6551a83df9dd6c7cf10074a2b933787eca76f7openai:gpt-5.5+anthropic:claude-haiku-4-5-202510010067050 in / 11735 out(32306from cache) ≈$0.4177GITHUB_TOKENd79aaa8d3891Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#2520caf5330fa30sha256:95063ad9253244491f0b11f4f17d3c0cd50de7643913494f79f2ac6402562e1copenai:gpt-5.5+anthropic:claude-haiku-4-5-202510010067809 in / 7549 out(32306from cache) ≈$0.2912GITHUB_TOKENdaf75cfeba3bForseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#2520caf5330fa30sha256:95063ad9253244491f0b11f4f17d3c0cd50de7643913494f79f2ac6402562e1copenai:gpt-5.5+anthropic:claude-haiku-4-5-202510010067809 in / 7549 out(32306from cache) ≈$0.2912GITHUB_TOKENdaf75cfeba3b