sshproto

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sshproto holds the protocol-specific contract that bridges the SSH endpoint plugin and the SSH credential plugin. Lives in config/plugins/ rather than config/runtime/ so the runtime stays generic — runtime only knows about the cross-protocol shapes (HTTP / Postgres / TLS / ConnEndpoint) and discovers protocol extensions like this one through the AcceptCredentialRuntime hook.

Both plugins import this package — the credential side declares it satisfies AuthCredential, the endpoint side type-asserts against it. There is no other consumer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCredential

type AuthCredential interface {
	SSHAuth(sec runtime.Secret) (Creds, error)
}

AuthCredential is what the SSH endpoint runtime needs from a credential plugin to authenticate upstream on the agent's behalf. The credential never sees the agent connection — it just returns the material; the endpoint runtime drives the upstream handshake. Mirrors the postgres SCRAM-offload split.

type Creds

type Creds struct {
	PrivateKey []byte
	Passphrase string
	Password   string
	HostPubkey string
}

Creds is the materialised view an SSH credential hands to the SSH endpoint runtime. The credential carries only auth material — the upstream username comes from the agent (whatever the SSH client sent in the connect line). PrivateKey is the raw PEM bytes (PKCS#1, PKCS#8 or OpenSSH format — golang.org/x/crypto/ssh.ParsePrivateKey* handles all three). HostPubkey, when non-empty, is a single-line authorized_keys-style entry the endpoint pins for upstream verification (matches `ssh-keyscan` output).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL