Versions in this module Expand all Collapse all v0 v0.1.0 Oct 19, 2026 Changes in this version + const ApprovalTimeout + const CredentialsNone + const FingerDeadline + const PolicyPoll + const ResponseQuantum + var ErrConfig = errors.New("configuration error") + var ErrSecretTimeout = errors.New("console: no password entered") + var ErrTooManyNoMatch = errors.New("fingerprint: three consecutive non-matching fingers") + var Paint = ui.Painter + func Bell(io IO) + func CloseVerifier(v fingerprint.Verifier) + func Decode(req ipc.Request, v any) *ipc.Response + func DenyReason(ans string) string + func ErrResp(id int64, code int, msg string) ipc.Response + func FormatChanges(changes []config.Change) []string + func Harden() error — darwin/amd64, linux/amd64, windows/amd64 + func Level(ctx context.Context, quantum time.Duration, start time.Time) + func Loosens(changes []config.Change) bool + func OKResp(id int64, v any) ipc.Response + func PeerFrom(ctx context.Context) (ipc.Cred, bool) + func PeerText(ctx context.Context) string + func ProcessText(pid int) string + func Run(ctx context.Context, p kit.Product, b Backend, o Options) error + func SameUserRefusal(p kit.Product) string + func SameUserRefused(p kit.Product, sys *sysconf.Config, allowSameUser bool) error + func StampPeer(ctx context.Context, b *audit.Base) + func WithPeer(ctx context.Context, c ipc.Cred) context.Context + type Approval struct + Approved bool + Auto bool + Refusal ipc.Response + Retype bool + type Approver interface + Approve func(ctx context.Context, d Decision) Result + Mode func() string + func NewDesktopTypedApprover(io IO) Approver + func NewFingerprintApprover(io IO, v fingerprint.Verifier, finger string, deadline time.Duration) Approver + func NewTypedApprover(io IO) Approver + type Backend interface + Checks func(ctx context.Context, s Session) []Finding + Connect func(ctx context.Context, c Credentials) (Session, error) + LoadPolicy func() (Policy, error) + Methods func() map[string]Handler + Status func(s Session) any + type Beller interface + Bell func() + type Credentials struct + Secret []byte + User string + type Decision struct + Expected string + Production bool + Prompt string + Retype string + type Env interface + Approve func(ctx context.Context, id int64, s Screen) Approval + Audit func(rec audit.Record) + AuditBase func(ctx context.Context, b audit.Base) + Auto func() bool + End func(reason string) + Level func(ctx context.Context, start time.Time) + Lost func() + Policy func() Policy + Println func(line string) + Safe func(s string) string + Sanitizer func() *sanitize.Sanitizer + Session func(ctx context.Context) (Session, error) + ShowResults func() bool + UnmaskAllowed func() bool + type Finding struct + Refuse bool + Text string + type Handler func(ctx context.Context, req ipc.Request, env Env) ipc.Response + type IO interface + Ask func(ctx context.Context, prompt string, timeout time.Duration) (string, bool) + AskSecret func(ctx context.Context, prompt string) ([]byte, error) + Println func(s string) + type Isolation struct + Desktop bool + Display sysconf.Display + GID int + Product kit.Product + Self int + Sys *sysconf.Config + Verifier fingerprint.Verifier + func CheckIsolation(p kit.Product, io IO, env IsolationEnv) (*Isolation, error) + func (iso *Isolation) Boundary() string + func (iso *Isolation) Level() int + func (iso *Isolation) Listen(path string) (net.Listener, error) + func (iso *Isolation) PeerCheck() func(ipc.Cred) bool + func (iso *Isolation) RefuseX11IfProduction(production bool) error + func (iso *Isolation) SocketPath(projectKey, profile string) (string, error) + type IsolationEnv struct + AccountExists func(uid int) bool + AllowSameUser bool + ClientAllowed func(sys *sysconf.Config, uid int) bool + ClientGID func(sys *sysconf.Config) (int, error) + DesktopEnv func() bool + Display func() sysconf.Display + DisplaySet func() bool + EnrolledTimeout time.Duration + LoadSys func() (*sysconf.Config, error) + LoginUID func() (int, bool) + MachinectlUIDs func() ([]int, bool) + NewVerifier func(user string) (fingerprint.Verifier, error) + ParentChain func() ([]sysconf.Proc, error) + Relay func() string + TerminalOwner func() (int, bool) + UID func() int + UserName func() (string, error) + func RealIsolationEnv(p kit.Product, tty *os.File) IsolationEnv + type Key int + const KeyCtrlO + const KeyShiftTab + type KeySource interface + Keys func() <-chan Key + SetKeyHandler func(func(Key)) + type LineSource interface + Lines func() <-chan string + type Loop struct + Clear func() + Command func(ctx context.Context, line string) + End func(reason string) + Ended func() bool + Handle func(ctx context.Context, req ipc.Request) ipc.Response + IO IO + Key func(Key) + PeerAllowed func(ipc.Cred) bool + Poll func() + Refresh func() + Tick func() + func (l *Loop) Serve(ctx context.Context, ln net.Listener, lines <-chan string) error + type Options struct + AllowUnmask bool + Auto bool + Harden func() error + IO IO + Isolation *IsolationEnv + Keychain *secrets.Keychain + Now func() time.Time + Profile string + ProjectRoot string + Quantum time.Duration + Ready func(socket string) + Sanitizer *sanitize.Sanitizer + ShowResults bool + StateDir string + TTY *os.File + VaultRead func(ctx context.Context, path string) (*secrets.VaultCredentials, error) + type Outcome int + const Approved + const Denied + const NoFinger + const RetypeRequested + const Unanswered + type PIIBackend interface + CheckMask func(pattern string) (string, error) + PIIRules func(p Policy) (mask, allow []string) + SaveMask func(pattern string) error + WithMask func(p Policy, pattern string) Policy + type Policy interface + Profile func() Profile + type Profile struct + Credentials string + CredentialsTTL time.Duration + DefaultPort int + Host string + IdleTimeout time.Duration + MaxSession time.Duration + Name string + Port int + Production bool + User string + VaultPath string + Where string + type Result struct + Answer string + Err error + Outcome Outcome + type Screen struct + Body []string + Header string + NeverAuto bool + Note string + Production bool + Record func(audit.Base) audit.Record + Red bool + Requester string + Retype string + Warnings []string + type Server struct + func NewServer(cfg ServerConfig) (*Server, error) + func (s *Server) Approve(ctx context.Context, id int64, sc Screen) Approval + func (s *Server) Audit(rec audit.Record) + func (s *Server) AuditBase(ctx context.Context, b audit.Base) + func (s *Server) Auto() bool + func (s *Server) CheckPolicy() + func (s *Server) Close() + func (s *Server) Command(ctx context.Context, line string) + func (s *Server) End(reason string) + func (s *Server) Ended() (string, bool) + func (s *Server) Handle(ctx context.Context, req ipc.Request) ipc.Response + func (s *Server) Key(k Key) + func (s *Server) Level(ctx context.Context, start time.Time) + func (s *Server) Loop() *Loop + func (s *Server) Lost() + func (s *Server) Policy() Policy + func (s *Server) PolicyPending() bool + func (s *Server) Println(line string) + func (s *Server) Safe(text string) string + func (s *Server) Sanitizer() *sanitize.Sanitizer + func (s *Server) Session(ctx context.Context) (Session, error) + func (s *Server) ShowResults() bool + func (s *Server) Status() StatusResult + func (s *Server) Tick() + func (s *Server) UnmaskAllowed() bool + type ServerConfig struct + AllowUnmask bool + ApprovedKey string + Approver Approver + Audit *audit.Log + Auto bool + Backend Backend + Boundary string + IO IO + Level int + Now func() time.Time + PeerAllowed func(ipc.Cred) bool + Policy Policy + Product kit.Product + Quantum time.Duration + Reconnect func(ctx context.Context, p Profile) (Session, error) + Refused string + Sanitizer *sanitize.Sanitizer + Session Session + ShowResults bool + StateDir string + type Session interface + Close func() error + type Sized interface + Width func() int + type StatusLine interface + SetStatus func(string) + type StatusResult struct + AllowUnmask bool + AutoApprove bool + IdleTimeoutInS int + Level int + Product any + Production bool + Profile string + SessionEndsInS int + ShowResults bool + type Terminal struct + func NewTerminal(in *os.File, out io.Writer) *Terminal + func (t *Terminal) Ask(ctx context.Context, prompt string, timeout time.Duration) (string, bool) + func (t *Terminal) AskSecret(ctx context.Context, prompt string) ([]byte, error) + func (t *Terminal) Bell() + func (t *Terminal) Interactive() error + func (t *Terminal) Keys() <-chan Key + func (t *Terminal) Lines() <-chan string + func (t *Terminal) Println(s string) + func (t *Terminal) Restore() + func (t *Terminal) SetKeyHandler(f func(Key)) + func (t *Terminal) SetStatus(s string) + func (t *Terminal) Width() int