chore(auth): wire gitea credential-safety wrapper into claude-code template #130
Reference in New Issue
Block a user
Delete Branch "chore/wire-gitea-credential-safety"
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?
Summary
Vendors and wires the molecule-ci Gitea credential-safety wrapper into the claude-code workspace template.
Changes
scripts/setup-gitea-netrc.sh+bin/gitea-curlvendored frommolecule-ci.Dockerfileinstalls both to/usr/local/bin/.entrypoint.shinvokessetup-gitea-netrc.shat agent startup, writing~/.netrc(mode 0600, atomically) from the projectedGIT_HTTP_USERNAME/GIT_HTTP_PASSWORDenv vars.gitea-curlis on PATH; it forcescurl --netrcand rejects inline-u/--userorAuthorizationheaders.Why
Closes the #34 gap: tokens were reachable on the command line / in activity logs via
curl -uor inline headers. With~/.netrc+ the argv-scan wrapper, Gitea API calls authenticate without exposing credentials in argv.Scope note
This PR targets the claude-code template first. The same pattern should be applied to
codex,hermes, andopenclawruntime templates as a follow-up.Safe to merge
GIT_HTTP_USERNAME/GIT_HTTP_PASSWORDare absent,setup-gitea-netrc.shwarns and exits 0 (fail-open for auth-less environments).APPROVED on head
369813f1.Security-infra review focused on the #34 credential-safety enforcement path:
No blocker found.
APPROVE on head
369813f1.Verified the vendored
gitea-curlkeeps the hardened #34 structural argv scan: local probes reject split/glued/equal-attached Authorization forms, mixed-case--HEADER=AUTHORIZATION, Proxy-Authorization, and-u/-U/--user/--proxy-userbefore reaching curl.setup-gitea-netrc.shcreates a temp file,chmod 600s it before_write_netrc, then atomicallymvs into~/.netrc; Dockerfile installs both wrappers executable. Entrypoint runs netrc setup as theagentuser beforemolecule-runtime, so startup ordering is correct. Exact-head CI aggregate is green.