policy

package
v0.0.0-...-f890545 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 8 Imported by: 16

Documentation

Overview

Package policy implements the declaration based policy checks for connecting or permitting installation of snaps based on their slots and plugs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectCandidate

type ConnectCandidate struct {
	Plug                *interfaces.ConnectedPlug
	PlugSnapDeclaration *asserts.SnapDeclaration

	Slot                *interfaces.ConnectedSlot
	SlotSnapDeclaration *asserts.SnapDeclaration

	BaseDeclaration *asserts.BaseDeclaration

	Model *asserts.Model
	Store *asserts.Store
}

ConnectCandidate represents a candidate connection.

func (*ConnectCandidate) Check

func (connc *ConnectCandidate) Check() error

Check checks whether the connection is allowed.

func (*ConnectCandidate) CheckAutoConnect

func (connc *ConnectCandidate) CheckAutoConnect() (interfaces.SideArity, error)

CheckAutoConnect checks whether the connection is allowed to auto-connect.

func (*ConnectCandidate) PlugAttr

func (connc *ConnectCandidate) PlugAttr(arg string) (interface{}, error)

func (*ConnectCandidate) PlugPublisherID

func (connc *ConnectCandidate) PlugPublisherID() string

func (*ConnectCandidate) SlotAttr

func (connc *ConnectCandidate) SlotAttr(arg string) (interface{}, error)

func (*ConnectCandidate) SlotPublisherID

func (connc *ConnectCandidate) SlotPublisherID() string

type InstallCandidate

type InstallCandidate struct {
	Snap            *snap.Info
	SnapDeclaration *asserts.SnapDeclaration

	BaseDeclaration *asserts.BaseDeclaration

	Model *asserts.Model
	Store *asserts.Store
}

InstallCandidate represents a candidate snap for installation.

func (*InstallCandidate) Check

func (ic *InstallCandidate) Check() error

Check checks whether the installation is allowed.

type InstallCandidateMinimalCheck

type InstallCandidateMinimalCheck struct {
	Snap            *snap.Info
	BaseDeclaration *asserts.BaseDeclaration
	Model           *asserts.Model
	Store           *asserts.Store
}

InstallCandidateMinimalCheck represents a candidate snap installed with --dangerous flag that should pass minimum checks against snap type (if present). It doesn't check interface attributes.

func (*InstallCandidateMinimalCheck) Check

func (ic *InstallCandidateMinimalCheck) Check() error

Check checks whether the installation is allowed.

Jump to

Keyboard shortcuts

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