adapter

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Overview

Package adapter is the package for the PAM library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoSelectForUser

func AutoSelectForUser(client authd.PAMClient, username string) tea.Cmd

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 MsgFilter added in v0.5.0

func MsgFilter(model tea.Model, msg tea.Msg) tea.Msg

MsgFilter is the handler for the UI model.

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

type ChangeStage struct {
	Stage pam_proto.Stage
}

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

type List struct {
	tea_list.Model
	// contains filtered or unexported fields
}

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.

func (*List) Blur added in v0.5.0

func (m *List) Blur()

Blur releases the focus from this model.

func (List) Focus added in v0.5.0

func (m List) Focus() tea.Cmd

Focus focuses this model.

func (List) Focused added in v0.5.0

func (m List) Focused() bool

Focused returns if this model is focused.

func (List) Update added in v0.5.0

func (m List) Update(msg tea.Msg) (List, tea.Cmd)

Update handles events and actions.

func (List) View added in v0.5.0

func (m List) View() string

View renders a text view of the 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).

Jump to

Keyboard shortcuts

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