conf

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Filters are programs offering additional restrictions on public keys.
	Filters []string
	// AllowStaticKeys specifies whether PAM-SSHCA should check public keys from StaticKeys for the current user.
	AllowStaticKeys bool
	// StaticKeys specifies the file paths to authorized keys.
	// The path is either an absolute path or one relative to the current user's home directory.
	StaticKeys []string
	// AllowCertificate specifies whether PAM-SSHCA should check certificates that signed by the trust CAs in CAKeys.
	AllowCertificate bool
	// SupportedCriticalOptions lists the CriticalOptions of SSH certs that PAM-SSHCA allows.
	SupportedCriticalOptions []string
	// CAKeys specified the paths of the trust CA public keys.
	CAKeys []string

	// Prompters is the list of prompters to prompt messages to users during authentication.
	Prompters []Prompter
	// contains filtered or unexported fields
}

Config is the parsed config settings in pam_sshca.conf.

func (*Config) AuthorizedPrincipals

func (c *Config) AuthorizedPrincipals(username string) (principals map[string]bool, err error)

AuthorizedPrincipals returns the authorized principals for the given username.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is the parser to parse pam_sshca.conf.

func NewParser

func NewParser(userName, userHome string) *Parser

NewParser creates a Parser.

func (*Parser) ParseConfigFile

func (p *Parser) ParseConfigFile(path string) Config

ParseConfigFile reads the content in a file and parse the directives in it.

type Prompter

type Prompter struct {
	// KeyIDProperty is the property/field in Key ID.
	// Please refer to the type `KeyID` in SSHRA repo.
	KeyIDProperty string
	// RE is the regular expression to match the key ID property.
	RE *regexp.Regexp
	// Message is the message that printed to users when the RE matches to KeyIDProperty.
	Message string
}

Prompter prompt message to users during authentication.

Jump to

Keyboard shortcuts

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