github.com/meulengracht/snapd@v0.0.0-20210719210640-8bde69bcc84e/interfaces/builtin/autopilot.go (about) 1 // -*- Mode: Go; indent-tabs-mode: t -*- 2 3 /* 4 * Copyright (C) 2017 Canonical Ltd 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 3 as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 package builtin 21 22 const autopilotIntrospectionSummary = `allows introspection of application user interface` 23 24 const autopilotIntrospectionBaseDeclarationSlots = ` 25 autopilot-introspection: 26 allow-installation: 27 slot-snap-type: 28 - core 29 deny-auto-connection: true 30 ` 31 32 const autopilotIntrospectionPlugAppArmor = ` 33 # Description: Allows an application to be introspected and export its ui 34 # status over DBus 35 36 #include <abstractions/dbus-session-strict> 37 38 dbus (receive) 39 bus=session 40 path=/com/canonical/Autopilot/** 41 interface=org.freedesktop.DBus.Introspectable 42 member=Introspect 43 peer=(label=unconfined), 44 dbus (receive) 45 bus=session 46 path=/com/canonical/Autopilot/Introspection 47 interface=com.canonical.Autopilot.Introspection 48 member=GetVersion 49 peer=(label=unconfined), 50 dbus (receive) 51 bus=session 52 path=/com/canonical/Autopilot/Introspection 53 interface=com.canonical.Autopilot.Introspection 54 member=GetState 55 peer=(label=unconfined), 56 ` 57 const autopilotIntrospectionPlugSecComp = ` 58 # Description: Allows an application to be introspected and export its ui 59 # status over DBus. 60 recvmsg 61 sendmsg 62 sendto 63 ` 64 65 func init() { 66 registerIface(&commonInterface{ 67 name: "autopilot-introspection", 68 summary: autopilotIntrospectionSummary, 69 implicitOnCore: true, 70 implicitOnClassic: true, 71 baseDeclarationSlots: autopilotIntrospectionBaseDeclarationSlots, 72 connectedPlugAppArmor: autopilotIntrospectionPlugAppArmor, 73 connectedPlugSecComp: autopilotIntrospectionPlugSecComp, 74 }) 75 }