API Design Feedback Request: swift-nio-ssh PR #220 (SSH Agent Hooks / External Signers)

Hi everyone,

I have had an open PR on swift-nio-ssh (PR #220 feat: support for external signers in NIOSSHPrivateKey by camunro · Pull Request #220 · apple/swift-nio-ssh · GitHub) for a while to add hook support for SSH agents and external signers. I've recently rebased the changes, and I would love to get some high-level architectural feedback from the community and the maintainers on the API design.

The Background:

Currently, swift-nio-ssh client handshakes are primarily geared toward static/in-memory private keys. For applications that need to integrate with local system credentials (such as standard ssh-agent , 1Password SSH Agent, or hardware signers like YubiKeys), we need a delegate hook pattern that can delegate signing operations during the authentication phase.

What this PR introduces:

  • Adds hooks/delegates to allow external signing mechanisms to participate in the client handshake.
  • Fully preserves backwards compatibility (public APIs are non-breaking).
  • Includes unit test coverage for the hook delegation paths.

I have just rebased the branch onto the latest main so it is conflict-free and ready for CI (currently awaiting maintainer approval to trigger).

I know the SwiftNIO maintainers have a lot on their plate, so I want to make sure I’m heading in the right direction. If anyone has a few minutes to look at the API layout on GitHub and share feedback or suggestions, it would be greatly appreciated!

Thanks,
Craig Munro

1 Like