Documentation ¶
Index ¶
- Variables
- func ErrorContains(out error, want string) bool
- func LoadAuthorizedKeys(filename string) (map[ssh.PublicKey]bool, error)
- func LoadPrivateKey(filename string) (ssh.Signer, error)
- func LoadPrivateKeyBytesWithPassword(keyBytes []byte, passphrase []byte) (ssh.Signer, error)
- func LoadPrivateKeyWithPassword(filename string, passphrase []byte) (ssh.Signer, error)
- func LoadPublicKey(filename string) (ssh.PublicKey, error)
- func LoadPublicKeyBytes(key []byte) (ssh.PublicKey, error)
- type Settings
- type UserPrincipals
Constants ¶
This section is empty.
Variables ¶
var ErrKeyPassphraseRequired = errors.New("the ssh key requires a passphrase")
ErrKeyPassphraseRequired is a sentinel error for missing passphrases
Functions ¶
func ErrorContains ¶
ErrorContains checks error contents see https://stackoverflow.com/a/55803656
func LoadAuthorizedKeys ¶
LoadAuthorizedKeys loads authorized_keys from file
func LoadPrivateKey ¶
LoadPrivateKey loads a private key from file (best not to use)
func LoadPrivateKeyBytesWithPassword ¶
LoadPrivateKeyBytesWithPassword loads a private key with password from bytes
func LoadPrivateKeyWithPassword ¶
LoadPrivateKeyWithPassword loads a private key with password from file
func LoadPublicKey ¶
LoadPublicKey loads a public key from file
Types ¶
type Settings ¶
type Settings struct { Validity uint32 `yaml:"validity"` Organisation string `yaml:"organisation"` Banner string `yaml:"banner"` Extensions map[string]string `yaml:"extensions,flow"` Users []*UserPrincipals `yaml:"user_principals"` // contains filtered or unexported fields }
Settings sets out the main yaml settings structure, which incorporates a slice of UserPrincipals together with general server settings
func SettingsLoad ¶
SettingsLoad loads a settings yaml file into a Settings struct
func (*Settings) UserByFingerprint ¶
func (s *Settings) UserByFingerprint(fp string) (*UserPrincipals, error)
UserByFingerprint extracts a user's UserPrincipals struct by public key fingerprint
type UserPrincipals ¶
type UserPrincipals struct { Name string Principals []string PublicKey ssh.PublicKey Fingerprint string }
UserPrincipals are configured in the yaml settings file to have certificates created for the stated Principals given access to the sshagentca server with SSHPublicKey. SSH Key fingerprints are used for lookups as these are more convenient for logging. See settings.example.yaml for the example settings file.
func (*UserPrincipals) UnmarshalYAML ¶
func (up *UserPrincipals) UnmarshalYAML(value *yaml.Node) (err error)
UnmarshalYAML unmarshals the Users slice of a yaml file