Skip to content

feat(context): lock the SSH identity a repo pushes with - #37

Merged
sandstream merged 3 commits into
mainfrom
feat/context-lock-ssh
Jun 22, 2026
Merged

sandstream merged 3 commits into
mainfrom
feat/context-lock-ssh

Conversation

@sandstream

Copy link
Copy Markdown
Owner

The "mainly lock" ask: a per-project SSH-identity context-lock, slotting next to the github/gitlab/bitbucket remote locks. Catches pushing/deploying a repo with the wrong account's SSH key — your multi-account reality.

What

  • [context.ssh] — declare any of: identity (IdentityFile path, ~ expanded for comparison), fingerprint (SHA256:…, machine-portable, most robust), or host_alias (the ~/.ssh/config Host the remote uses).
  • kit context check reads the repo's effective identity:
    • per-repo git config core.sshCommand -i <path> override wins, else
    • ssh -G <remote-host> → first configured identityfile,
    • fingerprint via ssh-keygen -lf, host token from the origin remote.
  • Verifies declared vs live → wrong key/fingerprint/alias is a mismatch, missing/unreadable is unknown (never a silent pass). Same data-driven (tool, field) model.

Verify

npm run build && npm test → build clean, 1340 tests, 0 fail (+3: SSH-identity parsers + fingerprint/host-alias lock ok/mismatch/unknown). Pure parsers fixture-tested; live ssh -G read smoke-tests on a real machine.

Merge order: rebase after the 1.13.0 release PR (#36) — both touch CHANGELOG [Unreleased] (trivial conflict, keep both). This is next-release (1.14.0) material.

🤖 Generated with Claude Code

[context.ssh] joins the per-project context lock: declare identity (path),
fingerprint (SHA256, machine-portable), or host_alias (~/.ssh/config Host).
kit context check reads the effective identity — per-repo core.sshCommand
-i override wins, else resolves the remote host via ssh -G — derives the
fingerprint via ssh-keygen -lf, and verifies the match. Wrong-account key =
mismatch, not a silent pass (the SSH analog of the git-host remote lock).
Pure parsers unit-tested; live ssh -G read smoke-tests on a real machine.
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit bf65955 into main Jun 22, 2026
15 checks passed
@sandstream
sandstream deleted the feat/context-lock-ssh branch June 22, 2026 09:28
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