From 28f4294774099c9aacaa1c62b03a7fefdcec832b Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Sun, 5 May 2024 13:57:15 +0100 Subject: [PATCH] feat(aa): move the all rule to its own file. --- pkg/aa/all.go | 33 +++++++++++++++++++++++++++++++++ pkg/aa/base.go | 25 ------------------------- 2 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 pkg/aa/all.go diff --git a/pkg/aa/all.go b/pkg/aa/all.go new file mode 100644 index 00000000..8c0527be --- /dev/null +++ b/pkg/aa/all.go @@ -0,0 +1,33 @@ +// apparmor.d - Full set of apparmor profiles +// Copyright (C) 2021-2024 Alexandre Pujol +// 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 +} diff --git a/pkg/aa/base.go b/pkg/aa/base.go index f0806746..ed12a1d7 100644 --- a/pkg/aa/base.go +++ b/pkg/aa/base.go @@ -97,28 +97,3 @@ func (r Qualifier) Less(other Qualifier) bool { func (r Qualifier) Equals(other Qualifier) bool { 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 -}