Documentation
¶
Overview ¶
Package adapter is the package for the PAM library
Index ¶
- func AutoSelectForUser(client authd.PAMClient, username string) tea.Cmd
- func GetPamTTY(mTx pam.ModuleTransaction) (tty *os.File, cleanup func())
- func IsTerminalTTY(mTx pam.ModuleTransaction) bool
- func MsgFilter(model tea.Model, msg tea.Msg) tea.Msg
- func NewUIModel(mTx pam.ModuleTransaction, clientType PamClientType, mode authd.SessionMode, ...) tea.Model
- func TeaHeadlessOptions() ([]tea.ProgramOption, error)
- type AuthModeSelected
- type BrokerListReceived
- type BrokerSelected
- type ChangeStage
- type GetAuthenticationModesRequested
- type List
- type PamClientType
- type PamReturnError
- type PamReturnStatus
- type PamSuccess
- type SessionEnded
- type SessionStarted
- type StageChanged
- type UILayoutReceived
- type UsernameSelected
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoSelectForUser ¶
AutoSelectForUser requests if any previous broker was used by this user to automatically selects it.
func GetPamTTY ¶ added in v0.4.1
func GetPamTTY(mTx pam.ModuleTransaction) (tty *os.File, cleanup func())
GetPamTTY returns the file to that is used by PAM tty or stdin.
func IsTerminalTTY ¶ added in v0.4.1
func IsTerminalTTY(mTx pam.ModuleTransaction) bool
IsTerminalTTY returns whether the pam.Tty or the os.Stdin is a terminal TTY.
func NewUIModel ¶ added in v0.5.0
func NewUIModel(mTx pam.ModuleTransaction, clientType PamClientType, mode authd.SessionMode, conn *grpc.ClientConn, exitStatus *PamReturnStatus) tea.Model
NewUIModel creates and initializes the main model orchestrator.
func TeaHeadlessOptions ¶
func TeaHeadlessOptions() ([]tea.ProgramOption, error)
TeaHeadlessOptions gets the options to run a bubbletea program in headless mode.
Types ¶
type AuthModeSelected ¶
type AuthModeSelected struct {
ID string
}
AuthModeSelected is triggered when the authentication mode has been chosen.
type BrokerListReceived ¶
type BrokerListReceived struct{}
BrokerListReceived is received when we got the broker list.
type BrokerSelected ¶
type BrokerSelected struct {
BrokerID string
}
BrokerSelected signifies that the broker has been chosen.
type ChangeStage ¶
ChangeStage signals that the model requires a stage change.
type GetAuthenticationModesRequested ¶
type GetAuthenticationModesRequested struct{}
GetAuthenticationModesRequested signals that a model needs to get the broker authentication modes.
type List ¶ added in v0.5.0
List is a tea_list.Model implementation for authd list views.
func NewList ¶ added in v0.5.0
func NewList(clientType PamClientType, title string) List
NewList creates a new [list] model.
type PamClientType ¶
type PamClientType int
PamClientType indicates the type of the PAM client we're handling.
const ( // Native indicates a PAM Client that is not supporting any special protocol. Native PamClientType = iota // InteractiveTerminal indicates an interactive terminal we can directly write our interface to. InteractiveTerminal // Gdm is a gnome-shell client via GDM display manager. Gdm )
type PamReturnError ¶
type PamReturnError interface {
PamReturnStatus
Status() pam.Error
}
PamReturnError is an interface that PAM errors return types should implement.
type PamReturnStatus ¶
type PamReturnStatus interface {
Message() string
}
PamReturnStatus is the interface that all PAM return types should implement.
type PamSuccess ¶
type PamSuccess struct {
BrokerID string
// contains filtered or unexported fields
}
PamSuccess signals PAM module to return with provided pam.Success and Quit tea.Model.
func (PamSuccess) Message ¶
func (p PamSuccess) Message() string
Message returns the message that should be sent to pam as info message.
type SessionEnded ¶
type SessionEnded struct{}
SessionEnded signals that the session is done and closed from the broker.
type SessionStarted ¶
type SessionStarted struct {
// contains filtered or unexported fields
}
SessionStarted signals that we started a session with a given broker.
type StageChanged ¶ added in v0.5.0
type StageChanged ChangeStage
StageChanged signals that the model just finished a stage change.
type UILayoutReceived ¶
type UILayoutReceived struct {
// contains filtered or unexported fields
}
UILayoutReceived means that we got the ui layout to display by the broker.
type UsernameSelected ¶
type UsernameSelected struct{}
UsernameSelected is received when the user name is filled (from pam or manually).