fj/cmd
sid 155ddb97ba
Some checks are pending
CI / lint (push) Waiting to run
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / functional (push) Blocked by required conditions
fix(api): validate same-origin before forwarding auth on --paginate
Codex flagged: the --paginate loop rebuilt the next request from the raw
`Link: rel="next"` URL and reattached the bearer token without checking
that the next URL was on the same host. Forgejo emits same-origin next-
links in practice, but a buggy or malicious upstream could redirect us
to a foreign host, at which point the token would leak.

Now the loop:
- url.Parse the Link target.
- Resolve relative URLs against the original base (https://<host>/api/v1).
- Refuse to proceed if the resolved URL's scheme isn't https or its host
  doesn't match `host.Hostname`. The error names both the foreign URL
  and the expected origin so the user can tell why pagination stopped.

Verified: same-origin pagination still works (`--paginate` against
forgejo.zerova.net commits returns 44 across 22 pages).
2026-05-02 15:48:59 -06:00
..
actions.go rename fgj to fj 2026-04-26 08:16:52 -06:00
actions_test.go feat: implement workflow list/view/run 2026-01-16 10:52:15 +01:00
aliases.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
api.go fix(api): validate same-origin before forwarding auth on --paginate 2026-05-02 15:48:59 -06:00
auth.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
completion.go rename fgj to fj 2026-04-26 08:16:52 -06:00
errors.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
ios_init.go rename fgj to fj 2026-04-26 08:16:52 -06:00
issue.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
json.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
label.go rename fgj to fj 2026-04-26 08:16:52 -06:00
manpages.go complete fgj → fj rename: env vars, config migration, docs 2026-04-26 08:23:48 -06:00
milestone.go rename fgj to fj 2026-04-26 08:16:52 -06:00
paginate.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
pr.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
pr_checks.go rename fgj to fj 2026-04-26 08:16:52 -06:00
pr_diff.go rename fgj to fj 2026-04-26 08:16:52 -06:00
pr_review.go rename fgj to fj 2026-04-26 08:16:52 -06:00
release.go rename fgj to fj 2026-04-26 08:16:52 -06:00
repo.go feat(cmd): pagination unification + fj api --paginate 2026-05-02 15:46:22 -06:00
repo_create_test.go feat: implement repo create command 2026-03-13 17:44:44 +01:00
root.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00
wiki.go fix(cmd): correctness + audit hardening across cmd/ + internal/ 2026-05-02 15:41:48 -06:00