Documentation
¶
Overview ¶
Package agent answers polkitd's BeginAuthentication and CancelAuthentication: one request at a time, first in first out, each a PAM conversation through polkit's helper shown in the shell's authentication dialog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the exported org.freedesktop.PolicyKit1.AuthenticationAgent.
func (*Agent) BeginAuthentication ¶
func (a *Agent) BeginAuthentication(actionID, message, iconName string, details map[string]string, cookie string, identities []polkit.Identity) *dbus.Error
BeginAuthentication authenticates one of identities for cookie and returns once the helper reported success to polkitd, the user or polkitd cancelled, or it failed.
func (*Agent) CancelAuthentication ¶
CancelAuthentication cancels the request for cookie, queued or running.
type Config ¶
type Config struct {
Dialogs Dialogs
Transport helper.Transport
// UserName is the login name of a uid, which the helper is given.
UserName func(context.Context, polkit.UID) (string, error)
// SessionUser is the uid of the session's user, the identity chosen
// first when it is offered.
SessionUser polkit.UID
Actions interface {
Lookup(ctx context.Context, id string) (libpolkit.ActionDescription, error)
}
ProcessName func(polkit.PID) (string, error)
Catalog locale.Catalog
Authorized func()
}
Config is what an Agent needs.
type Dialogs ¶
type Dialogs interface {
Authenticate(context.Context, portaldialogs.Caller, portaldialogs.AuthRequest) (portaldialogs.AuthReply, error)
ShowAuthentication(context.Context, portaldialogs.Caller, portaldialogs.AuthRequest) error
WatchAuthentication(ctx context.Context, handle string) (*portaldialogs.AuthWatch, error)
Dismiss(ctx context.Context, handle string) error
}
Dialogs is the shell's authentication dialog (portaldialogs.Client).