Documentation
¶
Overview ¶
Package polkit implements interaction between snapd and polkit.
Snapd installs polkitd policy files on behalf of snaps that describe administrative actions they can perform on behalf of clients.
The policy files are XML files whose format is described here: https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions
Index ¶
- type Backend
- func (b *Backend) Initialize(*interfaces.SecurityBackendOptions) error
- func (b *Backend) Name() interfaces.SecuritySystem
- func (b *Backend) NewSpecification(*interfaces.SnapAppSet, interfaces.ConfinementOptions) interfaces.Specification
- func (b *Backend) Remove(snapName string) error
- func (b *Backend) SandboxFeatures() []string
- func (b *Backend) Setup(appSet *interfaces.SnapAppSet, opts interfaces.ConfinementOptions, ...) error
- type Policy
- type Specification
- func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
- func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
- func (spec *Specification) AddPolicy(nameSuffix string, content Policy) error
- func (spec *Specification) Policies() map[string]Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct{}
Backend is responsible for maintaining polkitd policy files.
func (*Backend) Initialize ¶
func (b *Backend) Initialize(*interfaces.SecurityBackendOptions) error
Initialize does nothing.
func (*Backend) Name ¶
func (b *Backend) Name() interfaces.SecuritySystem
Name returns the name of the backend.
func (*Backend) NewSpecification ¶
func (b *Backend) NewSpecification(*interfaces.SnapAppSet, interfaces.ConfinementOptions) interfaces.Specification
func (*Backend) Remove ¶
Remove removes polkit policy files of a given snap.
This method should be called after removing a snap.
func (*Backend) SandboxFeatures ¶
SandboxFeatures returns list of features supported by snapd for polkit policy.
func (*Backend) Setup ¶
func (b *Backend) Setup(appSet *interfaces.SnapAppSet, opts interfaces.ConfinementOptions, repo *interfaces.Repository, tm timings.Measurer) error
Setup installs the polkit policy files specific to a given snap.
Polkit has no concept of a complain mode so confinment type is ignored.
type Specification ¶
type Specification struct {
// contains filtered or unexported fields
}
Specification keeps all the polkit policies.
func (*Specification) AddConnectedPlug ¶
func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedPlug records polkit-specific side-effects of having a connected plug.
func (*Specification) AddConnectedSlot ¶
func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedSlot records polkit-specific side-effects of having a connected slot.
func (*Specification) AddPermanentPlug ¶
func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
AddPermanentPlug records polkit-specific side-effects of having a plug.
func (*Specification) AddPermanentSlot ¶
func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
AddPermanentSlot records polkit-specific side-effects of having a slot.
func (*Specification) AddPolicy ¶
func (spec *Specification) AddPolicy(nameSuffix string, content Policy) error
AddPolicy adds a polkit policy file to install.
func (*Specification) Policies ¶
func (spec *Specification) Policies() map[string]Policy
Policies returns a map of polkit policies added to the Specification.