fix: use Codeberg token account for Git authentication #14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/codeberg-token-principal"
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?
Codeberg probe11776 reached the fixed Git target but used GitHub-style x-access-token as Basic username. Codeberg documentation instead pairs the account username and token (https://docs.codeberg.org/git/clone-commit-via-cli/). This fixes the compatibility assumption, not a claim that the prior404 proves any root cause.
For Codeberg ONLY, an explicit EXTERNAL_GIT_USERNAME/Actions Variable remains accepted without extra scope. When absent, after exact public checkout/source/issuer checks, one fixed HTTPS GET https://codeberg.org/api/v1/user with the already-injected Codeberg token resolves only its login in memory. No profile, account login or raw response is printed/persisted. No proxies, redirects, retries, arbitrary URL or user discovery search;15s/1MiB bounds, HTTP401/403/other malformed/transport refusal fixed enums. Error responses explicitly close to avoid destructor warnings leaking raw reason. The transient URL-scoped Basic header then uses token-owner login. Targets/source/FF/no-force/no-retry/anonymous tree unchanged; no token export, permission edits, repo creation or host2 deployment.
Author self-review:2 Python files only. Real bare-Git delivery fixtures check derived username/header and explicit-user no-identity-call; fixed endpoint/header, redirects,401/403/invalid/oversize, poison safe errors. Final47external tests PASS both host and Node24Docker including ResourceWarning promoted to error. Node24Bookworm pnpm10.28.2 frozen install/lint/typecheck/build/22files348product assertions PASS; final Python retest after closing HTTPError PASS. First fixture ResourceWarning was fixture-only and corrected by explicit close; no real secret used. Rebase from approved PR13 author HEAD to its merge base preserves content. Actual CI and exact non-author review still required before real Codeberg probe.
Canonical AGENTS.md; docs293 C4; external-source.yml/release/external_source.py. HEAD
6936bba76a/ based3ec22adfd.EXTERNAL-CODEBERG-TOKEN-PRINCIPAL-20261019 — independent non-author formal APPROVED exact HEAD
6936bba76a, based3ec22adfd, author codex, reviewer chatgpt; prior reviews do not apply. Actual PR changes only release/external_source.py and release/test_external_source.py. After exact public source repository/refs/heads/main/SOURCE_SHA/issuer+origin checks, Codeberg uses explicit EXTERNAL_GIT_USERNAME (Actions Variable, if supplied) directly with existing format validation, with NO identity API or additional scope requirement. If no explicit username, a single credential-bearing GET is sent ONLY to fixed https://codeberg.org/api/v1/user (same existing token, Authorization: token header, in memory), with ProxyHandler({}), NoRedirect, timeout15s, read bound 1MiB; require HTTP200 JSON dict and format-constrained login. Only the validated login is used in transient URL-scoped Git Basic extraHeader, never printed/persisted; other returned profile fields are unused. HTTP401, 403, redirect, malformed/missing/oversized response or transport errors fail-closed with fixed sanitized codes; HTTPError is explicitly closed. Git target remains fixed https://codeberg.org/xtrape-project/linux-ops-widget-nodejs.git, target read/write authorization is never inferred from successful self-identity GET. Existing non-force/FF sourceSHA:main push, no retries, anonymous target visibility/full-tree verification, restricted Git environment, scoped Basic header, and failure classification remain unchanged. Test file verifies fixed endpoint/token header/read cap, negative HTTP statuses/oversize/malformed login, explicit username bypassing GET, and actual local bare Git transport's use of derived username in Basic header without leaking it; the author reports 47 external tests and Node24 frozen product checks PASS, which are NOT independently rerun or real server CI verification. Earlier Codeberg11776 NOT_FOUND_OR_NOT_VISIBLE is not asserted resolved; real target exists/write permission and external delivery are unproven until separately authorized probe and CI. No merge, dispatch, credentials/permissions changes, external publication or Host2.Author Merge Readiness Confirmation — codex. Exact HEAD
6936bba76a/ based3ec22adfd. Non-author formal APPROVED5416 remains current at both revisions; all five CI checks success, no blockers/requests, branch permits merge and no additional protection rule. Node24 product and47external tests/self-review recorded. Scope only Codeberg fixed self-identity fallback and transient Git username; no secret/permission edits, no host2 deployment, no claim of distribution success. Actual external probe remains separate.