Documentation ¶
Overview ¶
Package utils defines shared methods in package signing component
Index ¶
- Variables
- func CompareRepoPerKeys(a, b map[string][]Repository) []string
- func GetLinuxGlobalSigningPolicies(logger log.Component) (bool, bool)
- func GetPackageManager() string
- func GetRepoPathFromPkgManager(pkgManager string) (string, string)
- func IsPackageSigningEnabled() (bool, error)
- type MainData
- type Repository
Constants ¶
This section is empty.
Variables ¶
var ( YumConf = "/etc/yum.conf" YumRepo = "/etc/yum.repos.d/" )
Not const for testing purpose
Functions ¶
func CompareRepoPerKeys ¶
func CompareRepoPerKeys(a, b map[string][]Repository) []string
CompareRepoPerKeys is a method used on tests
func GetLinuxGlobalSigningPolicies ¶
GetLinuxGlobalSigningPolicies returns: * if package signing is enabled on the host * if repository signing is enabled on the
func GetPackageManager ¶
func GetPackageManager() string
GetPackageManager is a lazy implementation to detect if we use APT or YUM (RH or SUSE)
func GetRepoPathFromPkgManager ¶
GetRepoPathFromPkgManager returns the path to the configuration file and the path to the repository files for RH or SUSE based OS
func IsPackageSigningEnabled ¶
IsPackageSigningEnabled returns the signature policy for the host. When no-debsig is written (and uncommented) in the configuration it means GPG package signing verification is disabled
Types ¶
type MainData ¶
MainData contains the global definitions of gpg checks
func ParseRPMRepoFile ¶
func ParseRPMRepoFile(inputFile string, mainConf MainData) (MainData, map[string][]Repository, error)
ParseRPMRepoFile extracts information from yum repo files Save the global gpgcheck value when encountering a [main] table (should only occur on `/etc/yum.conf`) Match several entries in gpgkey field, either file references (file://) or http(s)://. From observations, these reference can be separated either by space or by new line. We assume it possible to mix file and http references