feat(git-gate+orchestrator): slice 13c(v) — provision git-gate into the running gateway #375

Closed
didericis-claude wants to merge 1 commits from orchestrator-gateway-provision into orchestrator-gateway-network
Collaborator

Sub-slice of slice 13c. The execution side of 13c(i)'s provisioning render: places a bottle's git-gate credentials + bare repos into the live shared gateway container when it registers.

Changes

  • provision_git_gate(gateway, bottle_id, plan)mkdir the per-bottle creds dir, docker cp each upstream's identity key (+ known_hosts when present) into /git-gate/creds/<bottle_id>/, then docker exec the namespaced, init-only script from git_gate_render_provision. No-op with no upstreams.
  • deprovision_git_gate(gateway, bottle_id)rm the bottle's /git/<id> + creds on teardown (idempotent).
  • bottle_id is validated (shell/path-safe alphabet) before any docker cp/rm — the creds/repo dirs land in docker cp/rm path arguments, so a traversal id must never reach a path arg. Registry ids are token_hex; defense in depth at the docker boundary.

Verification

pyright 0 errors, pylint 9.83/10 (new files 10.00), unit suite green (1751 tests; the 13 test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise). Tests cover key+known_hosts copy, known_hosts-absent, no-upstreams no-op, docker-failure, and unsafe-id-rejected-before-any-docker.

Stacked on #374.

🤖 Generated with Claude Code

Sub-slice of **slice 13c**. The execution side of 13c(i)'s provisioning render: places a bottle's git-gate credentials + bare repos into the **live shared gateway container** when it registers. ### Changes - **`provision_git_gate(gateway, bottle_id, plan)`** — `mkdir` the per-bottle creds dir, `docker cp` each upstream's identity key (+ known_hosts when present) into `/git-gate/creds/<bottle_id>/`, then `docker exec` the namespaced, init-only script from `git_gate_render_provision`. No-op with no upstreams. - **`deprovision_git_gate(gateway, bottle_id)`** — `rm` the bottle's `/git/<id>` + creds on teardown (idempotent). - **`bottle_id` is validated** (shell/path-safe alphabet) **before any `docker cp`/`rm`** — the creds/repo dirs land in `docker cp`/`rm` path arguments, so a traversal id must never reach a path arg. Registry ids are token_hex; defense in depth at the docker boundary. ### Verification pyright **0 errors**, pylint **9.83/10** (new files 10.00), unit suite green (1751 tests; the 13 `test_sidecar_init` `/bin/sleep` errors are pre-existing NixOS-local noise). Tests cover key+known_hosts copy, known_hosts-absent, no-upstreams no-op, docker-failure, and unsafe-id-rejected-before-any-docker. Stacked on #374. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
didericis-claude added 1 commit 2026-07-13 21:59:39 -04:00
feat(git-gate+orchestrator): slice 13c(v) — provision git-gate into the running gateway
lint / lint (push) Successful in 2m16s
test / unit (pull_request) Successful in 1m8s
test / integration (pull_request) Successful in 29s
test / coverage (pull_request) Successful in 1m21s
20e83258bf
Places a bottle's git-gate credentials + bare repos into the live shared
gateway container when it registers — the execution side of the 13c(i)
provisioning render.

- provision_git_gate(gateway, bottle_id, plan): mkdir the per-bottle creds
  dir, docker cp each upstream's identity key (+ known_hosts when present)
  into /git-gate/creds/<bottle_id>/, then docker exec the namespaced,
  init-only script from git_gate_render_provision. No-op with no upstreams.
- deprovision_git_gate(gateway, bottle_id): rm the bottle's /git/<id> +
  creds on teardown (idempotent).
- bottle_id is validated (shell/path-safe alphabet) BEFORE any docker cp/rm,
  so a traversal id can never reach a path arg — the creds/repo dirs land in
  docker cp/rm arguments. Registry ids are token_hex; defense in depth.

pyright 0 errors; pylint 9.83/10; unit suite green (the 13 test_sidecar_init
/bin/sleep errors are pre-existing NixOS-local noise).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBMWTEtQdJ4W5UrWuLHCck
Author
Collaborator

Collapsed into the single stack PR #380 (per-host orchestrator, PRD 0070). Closing this slice PR; review + merge happens on #380.

Collapsed into the single stack PR #380 (per-host orchestrator, PRD 0070). Closing this slice PR; review + merge happens on #380.
didericis-claude closed this pull request 2026-07-14 00:57:43 -04:00
Some checks are pending
lint / lint (push) Successful in 2m16s
test / unit (pull_request) Successful in 1m8s
test / integration (pull_request) Successful in 29s
test / coverage (pull_request) Successful in 1m21s

Pull request closed

Sign in to join this conversation.