Skip to content

v0.x: ConfigureSSHKey returns an SSHKeySelection

The init wizard can now store a generated SSH key's passphrase in the OS keychain (spec 0210). The reference to that entry is a third thing the SSH stage settles on, so ConfigureSSHKey returns it with the type and path rather than as a third string.

Breaking change

Package: pkg/setup/forge

Before:

keyType, keyPath, err := forge.ConfigureSSHKey(ctx, profile, p, cfg)

After:

key, err := forge.ConfigureSSHKey(ctx, profile, p, cfg)
// key.Type, key.Path, key.Keychain

Migration: read key.Type and key.Path where the two strings were used. Record key.Keychain under <forge>.ssh.key.keychain when it is not empty, or gtb's git operations cannot open the key. A zero SSHKeySelection means the stage declined to generate a key nothing could open; record nothing for it.

The init commands do all of this already. Only a tool that calls ConfigureSSHKey itself needs a change.