Add verified per-invocation account overrides (#157) #307
Loading…
Reference in a new issue
No description provided.
Delete branch "fj-157-account-override"
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?
Step 1 of #157: run a single command as a named account without touching stored credentials.
fj --account <login>(orFJ_ACCOUNT) pairs with a personal access token from the environment (FJ_TOKEN, or a host-scoped variable, which wins over the generic one). The login is verified against/userbefore any other request goes out, so a token that belongs to a different account stops the command instead of acting as someone else. Nothing is written to the keychain, config or token files.With an override active,
fjrefuses every other way a request could pick its identity: stored-token, anonymous and web-session fallbacks, customAuthorizationor forwarded-auth headers,Sudo(header or query),tokenandaccess_tokenin the URL, the query list or a form-encoded body (Forgejo reads those before the header), and non-PAT hosts. Errors and debug output never include the account or any supplied credential. Multipart uploads (pr attach, release assets) run the same verification before sending anything.Stored profiles and an
auth login --accountflow are step 2, as a separate change. Existing behavior without--accountis unchanged. Usage and scope are indocs/account-override.md.Automated Codex review (read-only) of head
6652e2cb5a.No confirmed correctness, security, or failure-path problems found against STANDARDS.md. Reviewed API requests, multipart uploads, host resolution, direct HTTP helpers, and web fallbacks. Tests were inspected but not run in the read-only sandbox.
BLOCKING: 0
Reviewed head
6652e2cb5aat 2026-11-10T15:37:03Z by codex exec (read-only sandbox).