Documentation
¶
Index ¶
- func GetDefaultSigner() (ssh.Signer, error)
- func GetSignerFromFile(path string) (ssh.Signer, error)
- func MatchPatternList(patterns []*Pattern, input string) bool
- func ParseAuthorizedKeys(b []byte) ([]ssh.PublicKey, error)
- func ParseSSHTimespec(value string) (time.Time, error)
- func ParseTimePattern(patt string) (time.Time, time.Time, error)
- func RenderTime(seconds uint64) string
- func ShowNotification(message string)
- type AllowedSigner
- type AuthorizedKey
- type MarshalledAllowedSigner
- type Pattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultSigner ¶
func MatchPatternList ¶
MatchPatternList returns true if the input matches any of the patterns in the list. Negated patterns are matched first; if a negated pattern matches, the function returns false immediately. If no patterns match, the function
func RenderTime ¶
func ShowNotification ¶
func ShowNotification(message string)
Types ¶
type AllowedSigner ¶
type AllowedSigner struct {
Key ssh.PublicKey
Principals []*Pattern
Namespaces []*Pattern
IsCA bool
ValidAfter *time.Time
ValidBefore *time.Time
Comment string
}
func ParseAllowedSigners ¶
func ParseAllowedSigners(in []byte) ([]AllowedSigner, error)
ParseAllowedSigners parses a list of AllowedSigners from a byte slice.
func (*AllowedSigner) Marshal ¶
func (as *AllowedSigner) Marshal() MarshalledAllowedSigner
type AuthorizedKey ¶
type AuthorizedKey struct {
Key ssh.PublicKey
Comment string
Principals []string
IsCA bool
Command sql.NullString
Environment map[string]string
ExpiryTime sql.NullTime
AgentForwarding bool
From []*Pattern
PortForwarding bool
Pty bool
UserRC bool
X11Forwarding bool
PermitListen sql.NullString
PermitOpen sql.NullString
NoTouchReq bool
VerifyReq bool
Tunnel sql.NullString
}
AuthorizedKey represents an SSH authorized_keys entry
func NewAuthorizedKey ¶
func (*AuthorizedKey) MatchesPrincipal ¶
func (k *AuthorizedKey) MatchesPrincipal(input string) bool
type MarshalledAllowedSigner ¶
type MarshalledAllowedSigner struct {
Key string `json:"key"` // in openssh format
Principals []string `json:"principals"`
Namespaces []string `json:"namespaces"`
IsCA bool `json:"is_ca"`
ValidAfter int `json:"valid_after"` // unix timestamp
ValidBefore int `json:"valid_before"` // unix timestamp
Comment string `json:"comment"`
}
func (*MarshalledAllowedSigner) Unmarshal ¶
func (m *MarshalledAllowedSigner) Unmarshal() (AllowedSigner, error)
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
Pattern is a pattern in a Host declaration. Patterns are read-only values; create a new one with NewPattern().
func NewPattern ¶
NewPattern creates a new Pattern for matching hosts. NewPattern("*") creates a Pattern that matches all hosts.
From the manpage, a pattern consists of zero or more non-whitespace characters, `*' (a wildcard that matches zero or more characters), or `?' (a wildcard that matches exactly one character). For example, to specify a set of declarations for any host in the ".co.uk" set of domains, the following pattern could be used:
Host *.co.uk
The following pattern would match any host in the 192.168.0.[0-9] network range:
Host 192.168.0.?