Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
ValidModes lists the accepted values for PolicyConfig.Mode.
Functions ¶
func GetStarterPack ¶
GetStarterPack returns the YAML bytes for a named starter pack.
func ListStarterPacks ¶
func ListStarterPacks() []string
ListStarterPacks returns the names of all available starter packs.
func ResolvePolicyYAML ¶
func ResolvePolicyYAML(pc *PolicyConfig, scope, baseDir string) ([]byte, error)
ResolvePolicyYAML resolves a PolicyConfig into raw YAML bytes suitable for keep.LoadFromBytes(). baseDir is used to resolve relative file paths; if empty, paths are used as-is.
Types ¶
type PolicyConfig ¶
type PolicyConfig struct {
Pack string `yaml:"-"`
File string `yaml:"-"`
Deny []string `yaml:"deny,omitempty"`
Mode string `yaml:"mode,omitempty"`
}
PolicyConfig represents a Keep policy parsed from moat.yaml. It accepts three shapes:
- Starter pack name: plain string without "/" or ".yaml" suffix
- File path: string containing "/" or ending in ".yaml"
- Inline rules: YAML mapping with deny/mode fields
func (*PolicyConfig) IsFile ¶
func (p *PolicyConfig) IsFile() bool
func (*PolicyConfig) IsInline ¶
func (p *PolicyConfig) IsInline() bool
func (*PolicyConfig) IsPack ¶
func (p *PolicyConfig) IsPack() bool
func (*PolicyConfig) ToKeepYAML ¶
func (p *PolicyConfig) ToKeepYAML(scope string) ([]byte, error)
ToKeepYAML converts inline rules to Keep's native YAML rule format. Listed deny operations get deny rules; everything else is implicitly allowed (Keep's default behavior for unmatched calls).
func (*PolicyConfig) UnmarshalYAML ¶
func (p *PolicyConfig) UnmarshalYAML(node *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.