fix: diagnose refreshed GitHub/GitLab identity versus target access #16
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/external-auth-target-diagnostics"
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?
New GitHub/GitLab credentials still produce a Git credential challenge at the fixed target. That result and anonymous repository 404 do not establish whether authentication or target access is the cause. Add a manual, single-platform, GET-only diagnosis of fixed identity/token-self and target repository endpoints; no external writes. Gitee and Codeberg are excluded from this workflow.
The executing public main/SHA/origin is checked before authentication. Only the selected platform secret is injected, in-memory headers only, no redirect/proxy or retries. Emit fixed enums/status codes and bounded booleans; discard profile/token metadata and arbitrary bodies/errors. GitLab REST 401/403 explicitly does not determine Git token validity. GitHub /user requires no fine-grained permissions; GitLab write_repository is Git-only, so no scope expansion is requested.
Validation: host and Node24 Bookworm 74 external safety tests PASS, including a real authenticated HTTP Git fixture with fake credentials; Node24 pnpm10.28.2 frozen install, lint, typecheck, build, 22 files/348 product tests PASS. New safety suite is included in PR CI. Initial Docker fixture failure came from the mounted worktree gitdir; the fixture now executes in its own temporary directory and real Docker test PASS. No real external credentials used in local tests, no service permission/secret changes, no deployment.
Author self-review: fixed target URLs, GET-only/no create/push, source checks before authenticated HTTP, selected secret only, bounded response reads, redirect/transport refusal and sanitization checked. This adds diagnosis, not publication or write proof. Canonical scope: docs#293 C4; repository AGENTS.md and infra branch/review/readiness rules. References: https://docs.github.com/en/rest/users/users#get-the-authenticated-user ; https://docs.gitlab.com/api/personal_access_tokens/ ; https://docs.gitlab.com/security/tokens/access_token_scopes/ .
Exact HEAD:
d111b0a0b2Exact base:
43db7d15f2EXTERNAL-REFRESHED-GH-GL-AUTH-DIAGNOSIS-20261019 — independent non-author formal APPROVED on exact HEAD
d111b0a0b2, base43db7d15f2, author codex. Inspected actual four-file PR diff: .forgejo/workflows/external-auth-diagnostic.yml, .forgejo/workflows/ci.yml, release/external_auth_diagnostic.py, and eleven case test_external_auth_diagnostic.py. Dispatch is manual and restricted to public xtrape-project/linux-ops-widget-nodejs main, with platform choice only github/gitlab. Each selected job receives only its OWN existing secret, pinned checkout persist-credentials:false, and shared target-platform concurrency; Codeberg/Gitee cannot be selected. Before any token-bearing HTTP, require exact GITHUB_REPOSITORY/GITHUB_REF, source SHA equaling checkout HEAD, and canonical or trusted github.server_url issuer-bound origin. Fixed GET endpoints only: GitHub /user and exact /repos/xtrape-project/linux-ops-widget-nodejs via Bearer; GitLab /api/v4/personal_access_tokens/self and fixed project via PRIVATE-TOKEN. No arbitrary endpoint, proxy, redirect or retry; 20s timeout and 1MiB read bound. Identity responses validate ID positive int; output GH identity acceptance only, or GitLab active/revoked/git_write_scope booleans (api or write_repository); profile/login/secret/length/token metadata never printed. Exact target metadata match only reports readable, explicitly WRITE_UNPROVEN; 404 reports NOT_FOUND_OR_NOT_VISIBLE, not absence. GitLab REST 401/403 explicitly emits NOT_DETERMINED_BY_REST_REJECTION for Git credential validity, not false invalid-token inference. Errors return fixed HTTP status/service/challenge/transport enums, close HTTPError, never raw body/headers/error text. Real local Git-over-HTTP dummy Basic header wire fixture is a test of prior Git header delivery, not live external authentication. New eleven tests cover selected platform isolation, source-first refusal, token/report sanitization, malformed/oversize/redirect, GitLab scope booleans, 401 interpretation and ResourceWarning cleanup; CI adds explicit diagnostic unittest gate. Bounded nuance: diagnose() intentionally exits 0 with READ_ONLY_DIAGNOSIS_COMPLETED even when inner GET status is rejected; reports must be inspected per endpoint, not construed as auth PASS or write permission. Author-reported 74 external and 348 product tests PASS are local evidence not independently rerun and not live PR CI success. Historical GitHub/GitLab Git credential challenges 11796/11797 remain until controlled real diagnostic/transport probes; no external write or token validity claim. New exact HEAD CI/merge gates still required. No merge, dispatch, secret reads/modifications, rights changes, Gitee testing, publication or Host2 deployment.Author Merge Readiness Confirmation — codex. Exact HEAD
d111b0a0b2/ base43db7d15f2. Formal non-author chatgpt review5419 APPROVED, official, current, not stale/dismissed, explicitly bound to both revisions. All five actual required PR contexts SUCCESS; no unresolved review blocker or blocker label, main/base unchanged, mergeable true. Branch protection read back; no protection bypass. Scope fixed single-platform GET-only authentication diagnosis, source checks before credentials, no external writes/permission changes/Gitee execution/host2. Author local validation74 external host+Node24 and348 product tests PASS, author self-review in PR. Owner authorized gated merge and bounded public CI diagnostics. Proceed only guarded merge bound to this HEAD; actual endpoint result must be inspected separately from diagnostic job success.