polkit

package
v0.0.0-...-d8279b7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: GPL-3.0 Imports: 8 Imported by: 3

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

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

Initialize does nothing.

func (*Backend) Name

func (b *Backend) Name() interfaces.SecuritySystem

Name returns the name of the backend.

func (*Backend) Remove

func (b *Backend) Remove(snapName string) error

Remove removes polkit policy files of a given snap.

This method should be called after removing a snap.

func (*Backend) SandboxFeatures

func (b *Backend) SandboxFeatures() []string

SandboxFeatures returns list of features supported by snapd for polkit policy.

func (*Backend) Setup

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 Policy

type Policy []byte

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.

Jump to

Keyboard shortcuts

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