Skip to content

Rename glab kit to gitlab, add gitlab-ssh for git-over-SSH - #271

Open
johnfeeney-docker wants to merge 1 commit into
docker:mainfrom
johnfeeney-docker:add-glab-kit
Open

Rename glab kit to gitlab, add gitlab-ssh for git-over-SSH#271
johnfeeney-docker wants to merge 1 commit into
docker:mainfrom
johnfeeney-docker:add-glab-kit

Conversation

@johnfeeney-docker

Copy link
Copy Markdown
Contributor

Summary

  • Renames the glab mixin to gitlab (directory + name: field) for clarity.
  • Adds a new gitlab-ssh mixin, mirroring github-ssh: pins GitLab.com's published SSH host keys into known_hosts so git clone/push/pull over SSH work without an interactive host-key prompt.
  • Updates the gitlab kit's README/agentInstructions to steer git operations at SSH remotes and point at gitlab-ssh.

Why

The glab kit only wires up Bearer auth for glab/REST API traffic to gitlab.com. Git-over-HTTPS push/pull was never covered, and I tried closing that gap by adding a second credentials[].apiKey.inject rule with scheme: basic (GitLab accepts oauth2:<PAT> as HTTP Basic) on the same gitlab.com domain.

I tested this against a live sandbox and confirmed it does not work: the proxy does not disambiguate two inject rules on one domain by which auth scheme the client already sent, so the Basic-auth git request is never rewritten and GitLab rejects the literal sentinel value with HTTP Basic: Access denied. Bearer auth for glab api continued to work fine throughout.

GitHub avoids this exact collision because its Bearer traffic goes to api.github.com while git-over-HTTPS goes to github.com — different domains, no collision. GitLab serves both the API and git smart-HTTP from the single gitlab.com host, so there's no domain split to fall back on. This looks like a proxy-level gap (no way to disambiguate same-domain inject rules by scheme), not something fixable from the kit side — I'll file a separate feature request for that.

Given HTTPS push isn't fixable here, gitlab-ssh makes the documented workaround (SSH remotes via the forwarded host SSH agent) actually usable non-interactively, the same way github-ssh does for GitHub.

Breaking change note for maintainers

glab was merged in #225 and is already published as docker.io/sbx/glab-kit:latest. Renaming it to gitlab means that published tag goes stale rather than updating — happy to add a redirect/alias if there's a preferred mechanism, or to keep the old name if you'd rather avoid the break. Given it's only been live ~2 weeks I judged the clearer name worth it, but deferring to you here.

Test plan

  • sbx kit validate — both kits
  • TCK (scripts/test-kit.sh) — both kits, passing
  • e2e under deny-all (scripts/test-kit-e2e.sh) — both kits, passing
  • Manual verification in a live sandbox:
    • glab auth status / glab api user — Bearer auth unaffected by the rename
    • Basic-auth git-over-HTTPS clone — confirmed still rejected (HTTP Basic: Access denied), documenting the proxy limitation
    • gitlab-ssh: known_hosts populated at create; ssh -T git@gitlab.com passes host-key verification (fails cleanly on publickey, not on host trust)
    • Full round-trip with a real registered SSH key: clone + commit + push over git@gitlab.com:... succeeded

🤖 Generated with Claude Code

The glab kit's Bearer-auth injection only covers glab/REST API calls;
git-over-HTTPS push/pull was never wired up. Tried adding a second
apiKey.inject rule with scheme: basic on the same gitlab.com domain
(GitLab accepts oauth2:<PAT> as Basic auth) and confirmed via a live
sandbox that it does not work: the proxy does not disambiguate two
inject rules on one domain by which auth scheme the client sent, so
the Basic-auth request is never rewritten and GitLab rejects the
literal sentinel. Unlike GitHub (api.github.com vs github.com), GitLab
serves both the API and git smart-HTTP from the same gitlab.com host,
so there's no domain split to fall back on — this is a proxy-level
gap, not something fixable from the kit side.

Adds gitlab-ssh, mirroring the existing github-ssh kit: pins GitLab's
published SSH host keys into known_hosts so git clone/push/pull over
SSH work without an interactive host-key prompt (verified end-to-end
against a real sandbox: host-key verification now passes, auth fails
cleanly on publickey rather than on host trust). Updates glab's
README/agentInstructions to steer git operations at SSH remotes.

Renames the glab directory/kit name to gitlab for clarity. This kit
was already merged and published as docker.io/sbx/glab-kit:latest, so
this is a breaking rename for that specific tag; flagging in the PR
for maintainers to decide on an alias/redirect if needed.

Co-Authored-By: Claude
Signed-off-by: John Feeney <john.feeney@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant