feat(aa): move the all rule to its own file.

This commit is contained in:
Alexandre Pujol 2024-05-05 13:57:15 +01:00
parent 1e79d27232
commit 28f4294774
Failed to generate hash of commit
2 changed files with 33 additions and 25 deletions

33
pkg/aa/all.go Normal file
View file

@ -0,0 +1,33 @@
// apparmor.d - Full set of apparmor profiles
// Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
// SPDX-License-Identifier: GPL-2.0-only
package aa
const (
tokALL = "all"
)
type All struct {
RuleBase
}
func (r *All) Less(other any) bool {
return false
}
func (r *All) Equals(other any) bool {
return false
}
func (r *All) String() string {
return renderTemplate(r.Kind(), r)
}
func (r *All) Constraint() constraint {
return blockKind
}
func (r *All) Kind() string {
return tokALL
}

View file

@ -97,28 +97,3 @@ func (r Qualifier) Less(other Qualifier) bool {
func (r Qualifier) Equals(other Qualifier) bool { func (r Qualifier) Equals(other Qualifier) bool {
return r.Audit == other.Audit && r.AccessType == other.AccessType return r.Audit == other.Audit && r.AccessType == other.AccessType
} }
type All struct {
RuleBase
}
func (r *All) Less(other any) bool {
return false
}
func (r *All) Equals(other any) bool {
return false
}
func (r *All) String() string {
return renderTemplate(r.Kind(), r)
}
func (r *All) Constraint() constraint {
return blockKind
}
func (r *All) Kind() string {
return tokALL
}