Support multiple-account auth in fj (per-invocation account/credential override) #157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
fjauthenticates against rasterhub.com via a single git-credential helper tied to one account (here, the human operatorstephen). Our agent fleet needs to post PR comments and formal reviews as a separate QA account (gerri) so agent activity is attributable and distinct from the operator, and so reviews on agent-authored PRs aren't blocked by "can't review your own pull." Today everyfjaction attributes to the default account, so we work around it by calling the Forgejo API directly with a PAT (e.g.POST /repos/{o}/{r}/pulls/{n}/reviewswithAuthorization: token <gerri-PAT>), bypassingfjentirely.Request
Let
fjselect the account/credential per invocation, e.g.:FJ_TOKEN/FJ_ACCOUNT) and/or a--token/--accountflag, and/orfj auth login --account gerri;fj --account gerri pr review ...).Default behavior unchanged when no override is given.
Must be flexible for BOTH account types (operator requirement)
The account model must not assume a single forge or a fjord-managed identity. Profiles must be keyed per (host, account), covering both:
stephen,gerri), andSo an agent can act on a customer's independent Forgejo instance under that instance's own account, with credentials scoped to that
(host, account)pair, while rasterhub.com fjord identities continue to work side by side. Selection (env/flag/profile) resolves the right token for the target host + chosen account.Acceptance
fj pr review/fj pr comment/fj issue createcan post as a specified non-default account given that account's token.Use case
Multi-agent fleet on usw-dev-01: lanes post QA reviews as
gerri, the lead/operator act asstephen. Agents may also need to act on a customer's independent Forgejo instance under its own standalone account. Filed by gerri to dogfood the need.