pam

package
v0.0.0-...-fdb02f3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

Authenticator drives PAM authentication using a configurable session opener.

func NewAuthenticator

func NewAuthenticator(service string, opener SessionOpener) (*Authenticator, error)

NewAuthenticator constructs a PAM authenticator using the provided service name. A nil opener selects the default implementation that talks to the host PAM stack.

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(ctx context.Context, username, password string) (err error)

Authenticate validates a user/password pair against the configured PAM service.

type Session

type Session interface {
	Authenticate(ctx context.Context, password string) error
	Close() error
}

Session represents an authenticated PAM transaction lifecycle.

type SessionOpener

type SessionOpener interface {
	Open(ctx context.Context, service, username string) (Session, error)
}

SessionOpener creates new PAM sessions for a given service/username.

Jump to

Keyboard shortcuts

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