mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
43 lines
689 B
Go
43 lines
689 B
Go
// 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 (
|
|
HAT Kind = "hat"
|
|
)
|
|
|
|
// Hat represents a single AppArmor hat.
|
|
type Hat struct {
|
|
RuleBase
|
|
Name string
|
|
Rules Rules
|
|
}
|
|
|
|
func (r *Hat) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
func (p *Hat) Less(other any) bool {
|
|
o, _ := other.(*Hat)
|
|
return p.Name < o.Name
|
|
}
|
|
|
|
func (p *Hat) Equals(other any) bool {
|
|
o, _ := other.(*Hat)
|
|
return p.Name == o.Name
|
|
}
|
|
|
|
func (p *Hat) String() string {
|
|
return renderTemplate(p.Kind(), p)
|
|
}
|
|
|
|
func (p *Hat) Constraint() constraint {
|
|
return blockKind
|
|
}
|
|
|
|
func (p *Hat) Kind() Kind {
|
|
return HAT
|
|
}
|