keyline

package
v14.39.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package keyline provides functionality for managing SSH key lines

Index

Constants

View Source
const (
	// PublicKeyPrefix is the prefix used for public keys
	PublicKeyPrefix = "key"

	// PrincipalPrefix is the prefix used for principals
	PrincipalPrefix = "username"

	// SSHOptions specifies SSH options for key lines
	SSHOptions = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyLine

type KeyLine struct {
	ID     string // This can be either an ID of a Key or username
	Value  string // This can be either a public key or a principal name
	Prefix string
	Config *config.Config
}

KeyLine represents a struct used for SSH key management

func NewPrincipalKeyLine

func NewPrincipalKeyLine(keyID, principal string, config *config.Config) (*KeyLine, error)

NewPrincipalKeyLine creates a new KeyLine for a principal

func NewPublicKeyLine

func NewPublicKeyLine(id, publicKey string, config *config.Config) (*KeyLine, error)

NewPublicKeyLine creates a new KeyLine for a public key

func (*KeyLine) ToString

func (k *KeyLine) ToString() string

ToString converts a KeyLine to a string representation

Jump to

Keyboard shortcuts

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