Repository navigation
git: enable sandboxed SSH commit signing - #120
Merged
Merged
Conversation
Make the SwiftPorts signing port reachable through the virtual command catalog so git signs and verifies without host processes. Exercise sandbox home and temp paths, encrypted keys with a scripted prompt, and signing failures. Keep the missing-signer diagnostic regression visible as a known issue tracked in Cocoanetics/SwiftPorts#175 rather than work around it in SwiftBash. Suite: +3 tests, including four signing cases. Required swiftbuild build and full serial suite pass with one known upstream issue; strict SwiftLint passes. Co-Authored-By: Claude <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Windows filesystems do not expose POSIX permission bits, so the mode assertion failed even though key generation and signing succeeded. Keep the file type check on every platform and limit the mode check to POSIX hosts. Remove the branch-introduced lint violation in the manifest as well.\n\nSuite: test count unchanged.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
odrobnik
commented
Nov 15, 2026
odrobnik
left a comment
Contributor
Author
There was a problem hiding this comment.
No blocking findings.
What I checked:
ssh-keygenreaches the shell throughSwiftPortsCommands.argumentParserCommandsin SwiftPorts 0.2.0. BecauseregisterSwiftPortsCommands()installs that list, the only code change needed here is the newBinCatalogentry for/usr/bin/ssh-keygen.- The test target's
SSHKeygenCommanddependency is left out on Android. This matches SwiftPorts'androidDroppedTargets, andGitSigningTests.swiftis wrapped in#if !os(Android). - Moving SwiftPorts to
.upToNextMinor(from: "0.2.0")with an updatedPackage.resolvedfollows the dependency rules in AGENTS.md. GitKit (2.10.0), ShellKit (0.1.2) and the NIO packages come in as SwiftPorts dependencies. SwiftBash doesn't import GitKit itself. - The ssh-keygen port reads and writes key files through
Shell.resolveandShell.authorize, so files stay behind the sandbox's URL gate. Default key paths use the shell'sHOME, and the key comment comes fromhostInfo. That keeps the filesystem and identity rules intact. - The tests use the real
BashProcessLauncher. They cover encrypted and unencrypted keys, commits and tags, verification output, a0600mode on the private key, cleanup of temporary files, and that no commit ref is written when the signer is missing. ThewithKnownIssuegate for SwiftPorts#175 matches what the PR description says.
Notes (not blocking):
- By default, encrypted-key passphrase prompts read from the host's controlling terminal, not from
Shell.current.stdin. The docs cover this and point embedders toSSHKeygenExecutable.run(passphrasePrompt:). - Windows CI was still pending when I reviewed. The exact stderr strings in
missingSignerDoesNotWriteCommithaven't been checked on that platform.
👍 No findings.
Reviewed by Claude · opus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #119.
Added sandboxed SSH commit and tag signing, verification, key generation, and setup documentation. The required macOS build, full test suite, and lint passed, with one known upstream error-message defect tracked in SwiftPorts #175; other platforms and interactive terminal prompts were not verified. Signing failures correctly prevent commits, but the missing-signer error wording still needs that upstream fix, so this PR delivers part of #119 and leaves it open.