7c0836ea69
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 11s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 14s
E2E API Smoke Test / detect-changes (pull_request) Successful in 11s
E2E Chat / detect-changes (pull_request) Successful in 13s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 5s
publish-runtime-autobump / pr-validate (pull_request) Successful in 30s
publish-runtime-autobump / bump-and-tag (pull_request) Has been skipped
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 10s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
gate-check-v3 / gate-check (pull_request) Successful in 6s
qa-review / approved (pull_request) Failing after 4s
security-review / approved (pull_request) Failing after 4s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 5s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m12s
sop-tier-check / tier-check (pull_request) Successful in 6s
CI / Canvas (Next.js) (pull_request) Successful in 4m9s
CI / Platform (Go) (pull_request) Successful in 4m22s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Failing after 32s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
Harness Replays / Harness Replays (pull_request) Successful in 3s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 33s
E2E Chat / E2E Chat (pull_request) Failing after 57s
CI / Python Lint & Test (pull_request) Successful in 7m4s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 6m49s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 55s
Wire container-side `git` HTTPS authentication to the persona credentials
that already arrive via workspace_secrets (GITEA_USER / GITEA_TOKEN,
GIT_HTTP_USERNAME / GIT_HTTP_PASSWORD) without mutating ~/.gitconfig or
~/.git-credentials inside the container.
Mechanism:
1. New generic GIT_ASKPASS helper baked into the workspace runtime
image at /usr/local/bin/molecule-askpass. Script body is hostname-
free and vendor-neutral — the deployer decides which remote the
credentials apply to by virtue of populating the env vars.
2. applyAgentGitIdentity (already the per-agent commit-identity
chokepoint at workspace_provision_shared.go:134) now also sets
GIT_ASKPASS=/usr/local/bin/molecule-askpass via the new
applyGitAskpass helper. Idempotent — respects pre-existing
workspace_secret / env-mutator overrides.
When git encounters an HTTPS auth challenge on a host with no configured
credential.helper, it invokes GIT_ASKPASS to read the username + password
from env. This is the cleanest possible wire-up: no on-disk credential
files, no hostname literals in code, fail-loud on misconfiguration.
Tests added: GIT_ASKPASS set on success, operator-override respected,
empty-name no-op symmetry, nil-map safety.
Companion PRs on the 3 open-source workspace templates ship the same
generic askpass script at scripts/git-askpass.sh → identical install
path. Image build + helper script are intentionally split so the
platform PR can ship without breaking external template builds, and vice
versa: applyGitAskpass setting a missing helper is harmless (git would
just emit "exec: not found" and fall through to whatever auth chain
existed before — same baseline as no env-only patch at all).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
1.5 KiB
Bash
Executable File
36 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# git-askpass helper. Reads HTTPS Basic-Auth credentials from env vars so
|
|
# the deployer can wire git authentication for any private remote without
|
|
# touching ~/.gitconfig or ~/.git-credentials inside the container.
|
|
#
|
|
# Wire-up: set GIT_ASKPASS=/usr/local/bin/molecule-askpass in the
|
|
# container env, then export GIT_HTTP_USERNAME / GIT_HTTP_PASSWORD (or the
|
|
# GITEA_USER / GITEA_TOKEN fallback pair). When git encounters an HTTPS
|
|
# auth challenge on a host that has no credential.helper configured for
|
|
# it, git invokes GIT_ASKPASS twice — once with a "Username for ..."
|
|
# prompt and once with a "Password for ..." prompt. We pattern-match on
|
|
# that prompt and emit the matching env var.
|
|
#
|
|
# No hardcoded hostnames or vendor names — the deployer decides which
|
|
# host these credentials apply to by virtue of setting GIT_ASKPASS only
|
|
# when the target remote is in scope. The helper itself is reusable for
|
|
# any HTTPS git remote.
|
|
#
|
|
# Failure mode: if the env vars are unset, we emit an empty string and
|
|
# let git surface "Authentication failed" — this is intentional, so a
|
|
# misconfigured deployment fails loudly at first push instead of silently
|
|
# falling through to an unrelated credential chain.
|
|
|
|
case "$1" in
|
|
Username*)
|
|
printf '%s\n' "${GIT_HTTP_USERNAME:-${GITEA_USER:-}}"
|
|
;;
|
|
Password*)
|
|
printf '%s\n' "${GIT_HTTP_PASSWORD:-${GITEA_TOKEN:-}}"
|
|
;;
|
|
*)
|
|
# Unknown prompt — emit empty and let git decide.
|
|
printf '\n'
|
|
;;
|
|
esac
|