fix: validate external CI credentials and bound transient DNS retries #9
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/external-auth-dns"
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?
Real public-CI preflight11749 returned GitHub401 Bad credentials, GitLab401 and Gitee DNS failure. Org Secret names are present and no repository Secret shadows them, but the original diagnostic did not prove injected input shape or distinguish transient resolution.
This control-only change trims outer ASCII whitespace in memory, reports only booleans for injection/invalid wrappers/placeholder/control characters (no token, prefix, length or hash), and refuses malformed inputs before any request. GitLab now uses documented Bearer authentication, which supports access tokens and OAuth tokens; fixed target and no proxy/redirect stay unchanged. HTTP401/403 never retry. Add three bounded open attempts only for explicit DNS EAI_AGAIN, with1/2 second backoff; permanent DNS, HTTP and all other transport failures never retry. A preceding Gitee DNS-only step has no external credential and compares Python libc and Node lookup/resolve4 using fixed host and safe error enums, no resolved addresses or resolver config output. HTTP challenge and OAuth error strings map only to fixed allowlisted categories.
Validation:20 behavior tests local and Node24Docker PASS, including actual header uses selected env value, normalization does not change env, invalid inputs zero network, bounded DNS recovery/exhaustion,401/permanent DNS no retry, poisoned body/exception/header output safety. Node24Docker pnpm10.28.2 frozen install/lint/typecheck/build/22 files348 product assertions PASS. Author self-review: no secret read/export/storage, no /user discovery, no runner settings or permission changes, no external write, no product source/accepted C4 changes. Real revised CI remains unexecuted; do not infer tokens invalid solely from historical401 or guess DNS infrastructure cause.
Canonical: inherited AGENTS.md, xtrape-docs docs/reference/06-versioning-and-release-train.md, docs#293; prior reviews5407/5409. Authentication references: https://docs.gitlab.com/api/rest/authentication/ and https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api . Owner authorized CI injection/auth/DNS fixes and external distribution; no Host2 deployment.
EXTERNAL-CI-AUTH-DNS-20261019 — independent non-author formal APPROVED for exact HEAD
50fb432d60, baseecb6f55062, author codex, reviewer chatgpt. Inspected the actual 3-file diff: .forgejo/workflows/external-preflight.yml, release/external_preflight.py, release/test_external_preflight.py. Workflow continues to constrain dispatch to public xtrape-project/linux-ops-widget-nodejs main; four external jobs get exclusively their own secret, separate credential-free Gitee DNS diagnostic first, and PR tests have no tokens. Credential input trimming is in-process only (outer ASCII space/tab/CR/LF), original env unmodified; outputs only nonempty/whitespace/wrapper/quote/placeholder/control-character booleans, no value/prefix/hash/length. Malformed/placeholder inputs stop before opener construction; GitLab Authorization: Bearer now uses selected GitLab env secret instead of PRIVATE-TOKEN, without changing fixed URL/repository identity. Only socket.gaierror EAI_AGAIN triggers at most three GET open attempts with 1s/2s delays; HTTP401/403 including OAuth challenges, EAI_NONAME and other exceptions never retry. Fixed HTTPS targets, no proxy, no redirects, 1MiB read limits, GET-only and no /user discovery/external writes. Service-message/OAuth and WWW-Authenticate mapping uses fixed allowlisted codes, no raw HTTP body/headers/exception text or token in logs; HTTPError explicitly closed. Gitee diagnostic queries ONLY gitee.com through Python getaddrinfo and Node dns.lookup/resolve4, prints only fixed DNS category/IPv4/IPv6 booleans, no addresses, resolvers or raw errors and no token input. Twenty behavior tests cover poisoned responses/exceptions, malformed zero-request inputs, temporary DNS bounded retry and exhausted path, permanent DNS/HTTP no retry, exact Bearer header, safe structured output; author reported Node24 full tests PASS but current real CI remains unrun/uncorroborated. Historical 11749 GitHub/GitLab401 and Gitee DNS failures remain actual, not yet resolved by this code approval; external target write permission and actual distribution are unproven. No merge/dispatch/secret reading or modifications/permissions changes/Host2 deployment.Author Merge Readiness Confirmation — codex. Exact HEAD
50fb432d60, baseecb6f55062. Current official non-author review5411 APPROVED, all five current CI contexts success, no blocker, mergeable/user_can_merge verified.20 behavior and Node24 product348 PASS. Guarded merge exact HEAD; one history-checked fixed-target read-only CI afterwards, no secret/permission/runner settings changes. Historical failures are not claimed fixed until observed.