authkeys

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: EUPL-1.2 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxInputSize           = 256 * 1024 * 1024 // 256MB
	MaxPermitConnectLength = 1024
	MaxPermitTCPLength     = 512
	MaxPermitSocketLength  = 512
)
View Source
const (
	MaxLineLength           = 16 * 1024 * 1024 // 16MB
	MaxMacroExpansionDepth  = 10
	MaxMacroExpansionTokens = 256 * 1024
)

Variables

This section is empty.

Functions

func MatchHostPattern

func MatchHostPattern(pattern, host string) bool

func MatchNamePattern

func MatchNamePattern(pattern, value string) bool

func MatchPathPattern

func MatchPathPattern(pattern, value string) bool

func MatchPermitConnect

func MatchPermitConnect(pattern, target PermitConnect) bool

func MatchPortPattern

func MatchPortPattern(pattern string, port any) bool

func MatchUserPattern

func MatchUserPattern(pattern, user string) bool

func ParseFrom

func ParseFrom(s string) (string, error)

func ParseKey

func ParseKey(line []byte) (ssh.PublicKey, string, []string, error)

func ParseTimespec

func ParseTimespec(s string) (time.Time, error)

func QuoteOptionValue

func QuoteOptionValue(s string) string

func SplitOption

func SplitOption(s string) (name, value string, ok bool)

Types

type AuthorizedKeyOptions

type AuthorizedKeyOptions struct {
	PermitConnects      []PermitConnect        `json:"permit_connects"`
	PermitOpens         []PermitTCP            `json:"permit_opens"`
	PermitListens       []PermitTCP            `json:"permit_listens"`
	PermitSocketOpens   []PermitSocket         `json:"permit_socket_opens"`
	PermitSocketListens []PermitSocket         `json:"permit_socket_listens"`
	Environments        []Environment          `json:"environments"`
	Froms               []string               `json:"froms"`
	StartTime           *time.Time             `json:"start_time"`
	ExpiryTime          *time.Time             `json:"expiry_time"`
	TimeWindow          *timewindow.TimeWindow `json:"time_window"`
	Command             string                 `json:"command"`
	NoPortForwarding    bool                   `json:"no_port_forwarding"`
	NoSocketForwarding  bool                   `json:"no_socket_forwarding"`
	NoPty               bool                   `json:"no_pty"`
	NoRecording         bool                   `json:"no_recording"`
	Comment             string                 `json:"comment"`
}

func ParseLine

func ParseLine(line []byte) (*AuthorizedKeyOptions, ssh.PublicKey, error)

func ParseOptions

func ParseOptions(opts []string) (*AuthorizedKeyOptions, error)

type Environment

type Environment struct {
	Sign  string `json:"sign"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

func ParseEnvironment

func ParseEnvironment(s string) (*Environment, error)

type PermitConnect

type PermitConnect struct {
	User string `json:"user"`
	Host string `json:"host"`
	Port string `json:"port"`
}

func ParsePermitConnect

func ParsePermitConnect(s string) (*PermitConnect, error)

type PermitSocket

type PermitSocket struct {
	Path string `json:"path"`
}

func ParsePermitSocket

func ParsePermitSocket(s string) (*PermitSocket, error)

type PermitTCP

type PermitTCP struct {
	Host string `json:"host"`
	Port string `json:"port"`
}

func ParsePermitTCP

func ParsePermitTCP(s string) (*PermitTCP, error)

type Warning

type Warning struct {
	Message string
	Line    int
	Context string
}

func ParseFile

func ParseFile(content []byte) (map[string][]*AuthorizedKeyOptions, []Warning, error)

Jump to

Keyboard shortcuts

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