mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
* interfaces: add method to SnapAppSet for getting list of runnable entities * interfaces: replace references to hooks/apps in backends with usage of SnapAppSet.Runnables * interfaces: rename SecurityTagGlob to SecurityTagGlobs and make it handle component hooks * snap: add method for getting component hooks for a specific plug * interfaces: add component hooks to output of SecurityTagsForConnectedPlug * snapstate: add methods for getting components installed for the current and arbitrary revisions of a snap * o/ifacestate: properly set up SnapAppSets with components prior to passing them off to security backends * o/snapstate: create setup-profiles task when installing a component * many: add side info param to snaptest.MockComponent * many: fix failing tests caused by changes in rebase * snap: add ComponentHookSecurityTag for getting a component hook's security tag * interfaces: implement SecurityTagGlobs with snap.ComponentHookSecurityTag * interfaces: move some helper functions to helpers.go * o/snapstate: add functions that are useful when operating on component-related tasks * o/ifacestate: use functions from snapstate rather than local functions * i/apparmor: cleanup comment and whitespace * o/snapstate: replace some speculative code with TODOs for now * interfaces, o/ifacestate: remove Type from interfaces.Runnable and do not sort the result of SnapAppSet.Runnables() * o/snapstate: remove unused variable
34 lines
1017 B
Go
34 lines
1017 B
Go
// -*- Mode: Go; indent-tabs-mode: t -*-
|
|
|
|
/*
|
|
* Copyright (C) 2016 Canonical Ltd
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 3 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
package interfaces
|
|
|
|
import (
|
|
"github.com/snapcore/snapd/snap"
|
|
)
|
|
|
|
// SecurityTagGlobs returns patterns that match all security tags belonging to
|
|
// the same snap as the given app.
|
|
func SecurityTagGlobs(snapName string) []string {
|
|
return []string{
|
|
snap.AppSecurityTag(snapName, "*"),
|
|
snap.ComponentHookSecurityTag(snapName, "*", "*"),
|
|
}
|
|
}
|